erc_4626.vault_protocol.rysk.vault

Documentation for eth_defi.erc_4626.vault_protocol.rysk.vault Python module.

Read-only adapter for Rysk Premium option-writing pools.

Rysk Premium pools issue ERC-20 LP shares but are not ERC-4626 vaults or legally structured funds. Deposits and withdrawals settle asynchronously by epoch. Final historical prices are reconstructed from EpochPriceSet, EpochPriceDisputed and epochExecuted logs:

share_price_equivalent = final withdrawal price / 10**collateral decimals

Verified Ethereum implementation: https://etherscan.io/address/0x6ca8d390c37acc6883e96fa5283246fc39239741#code

Module Attributes

RYSK_POOL_ABI

Minimal verified LiquidityPool interface used by the read-only adapter.

Classes

RyskVault

Expose onchain identity and final epoch history for a Rysk pool.

RYSK_POOL_ABI = [{'inputs': [], 'name': 'collateralAsset', 'outputs': [{'internalType': 'address', 'name': '', 'type': 'address'}], 'stateMutability': 'view', 'type': 'function'}, {'inputs': [], 'name': 'getTVL', 'outputs': [{'internalType': 'uint256', 'name': '', 'type': 'uint256'}], 'stateMutability': 'view', 'type': 'function'}]

Minimal verified LiquidityPool interface used by the read-only adapter. Historical prices and discovery use event topics instead of this ABI.

class RyskVault

Bases: eth_defi.vault.base.VaultBase

Expose onchain identity and final epoch history for a Rysk pool.

Generic transaction and investor-flow adapters remain disabled until the complete queued lifecycle has guarded transaction coverage.

Create an adapter for an event-discovered Rysk pool.

The adapter has no mutable application-catalogue dependency. Contract identity comes from spec and collateral metadata comes from the verified LiquidityPool interface.

Parameters
  • web3 – Pool-chain Web3 connection.

  • spec – Chain and pool share-token address.

  • token_cache – Optional shared token metadata cache.

  • features – Persisted scanner features.

  • default_block_identifier – Default block for metadata reads.

  • require_denomination_token – Whether collateral-token read failure is fatal.

Returns

None.

__init__(web3, spec, token_cache=None, features=None, default_block_identifier=None, require_denomination_token=False)

Create an adapter for an event-discovered Rysk pool.

The adapter has no mutable application-catalogue dependency. Contract identity comes from spec and collateral metadata comes from the verified LiquidityPool interface.

Parameters
  • web3 (web3.main.Web3) – Pool-chain Web3 connection.

  • spec (eth_defi.vault.base.VaultSpec) – Chain and pool share-token address.

  • token_cache (Optional[dict]) – Optional shared token metadata cache.

  • features (Optional[set[eth_defi.erc_4626.core.ERC4626Feature]]) – Persisted scanner features.

  • default_block_identifier (Optional[Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]]) – Default block for metadata reads.

  • require_denomination_token (bool) – Whether collateral-token read failure is fatal.

Returns

None.

Return type

None

property chain_id: int

Return the pool deployment chain.

Returns

EVM chain identifier from the scanner specification.

property address: eth_typing.evm.HexAddress

Return the pool and LP share-token address.

Returns

Checksum EVM address.

property vault_address: eth_typing.evm.HexAddress

Return the scanner-compatible pool identity.

Returns

Pool and LP share-token address.

property name: str

Return the onchain ERC-20 share-token name.

Returns

Pool name stored by the deployed contract.

property symbol: str

Return the onchain ERC-20 share-token symbol.

Returns

LP token symbol.

property short_description: str

Return a conservative product description.

Returns

Description that does not infer a strategy from token naming.

fetch_share_token()

Fetch ERC-20 metadata for the pool’s LP shares.

Returns

Share-token details from the pool contract.

Return type

eth_defi.token.TokenDetails

fetch_share_token_address(block_identifier='latest')

Return the pool itself as its share-token address.

Parameters

block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Ignored because the identity is immutable for the adapter.

Returns

Pool address.

Return type

eth_typing.evm.HexAddress

fetch_denomination_token_address()

Read the pool collateral token from collateralAsset().

Returns

Checksum collateral-token address.

Return type

eth_typing.evm.HexAddress

fetch_denomination_token()

Fetch collateral-token metadata used to scale epoch prices.

Returns

Collateral ERC-20 details, or None after a recoverable metadata failure.

Return type

Optional[eth_defi.token.TokenDetails]

fetch_total_supply(block_identifier='latest')

Fetch the human-readable ERC-20 LP share supply.

Parameters

block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Requested EVM state block.

Returns

Outstanding LP shares.

Return type

decimal.Decimal

fetch_reported_tvl(block_identifier='latest')

Fetch Rysk’s collateral-only getTVL() value.

This value is useful for pool-size reporting but is not marked option- book NAV and must not be used as total_assets or a share price.

Parameters

block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Requested EVM state block.

Returns

Free plus allocated collateral in denomination-token units.

Return type

decimal.Decimal

fetch_share_price(block_identifier='latest')

Reject a point-in-time price read before epoch finalisation.

Parameters

block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Requested EVM state block.

Returns

Never returns.

Raises

NotImplementedError – Always; use the contextual historical reader.

Return type

Optional[decimal.Decimal]

fetch_total_assets(block_identifier='latest')

Reject collateral-only TVL as full marked option-book NAV.

Parameters

block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Requested EVM state block.

Returns

Never returns.

Raises

NotImplementedError – Always; the contract’s getTVL() omits option liabilities.

Return type

Optional[decimal.Decimal]

fetch_nav(block_identifier='latest')

Reject an isolated NAV read outside final epoch accounting.

Parameters

block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Requested EVM state block.

Returns

Never returns.

Return type

Optional[decimal.Decimal]

fetch_info()

Return the onchain pool identity and accounting source.

Returns

Pool, collateral and final-price source fields.

Return type

eth_defi.vault.base.VaultInfo

fetch_scan_record_extra_data()

Export Rysk-specific valuation and flow caveats.

Returns

Private metadata fields for common scanner rows.

Return type

dict[str, object]

fetch_portfolio(universe, block_identifier=None)

Return no fabricated spot portfolio for the option book.

Open option liabilities need protocol-specific position accounting; collateral balances alone are incomplete.

Parameters
  • universe (eth_defi.vault.base.TradingUniverse) – Ignored common trading universe.

  • block_identifier (Optional[Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]]) – Ignored EVM state block.

Returns

Empty common spot portfolio.

Return type

eth_defi.vault.base.VaultPortfolio

get_historical_reader(stateful)

Create the finalised-epoch contextual reader.

Parameters

stateful (bool) – Ignored because the shared event context owns incrementality.

Returns

Rysk historical reader.

Return type

eth_defi.vault.base.VaultHistoricalReader

get_flow_manager()

Reject incomplete generic investor-flow accounting.

Rysk does emit pool-local deposit, redemption and withdrawal events, but their queued lifecycle needs a protocol-specific flow manager.

Returns

Never returns.

Raises

NotImplementedError – Always until the full lifecycle is implemented.

Return type

eth_defi.vault.base.VaultFlowManager

get_deposit_manager()

Reject generic transaction construction for queued flows.

Returns

Never returns.

Raises

NotImplementedError – Always until both subscription and redemption are implemented.

Return type

eth_defi.vault.deposit_redeem.VaultDepositManager

has_block_range_event_support()

Return whether a common investor-flow manager is implemented.

Rysk event logs are used for discovery and pricing, but generic investor-flow replay is not yet implemented.

Returns

Always False.

Return type

bool

has_deposit_distribution_to_all_positions()

Return that deposits do not map to generic spot positions.

Returns

Always False.

Return type

bool

get_management_fee(block_identifier)

Return no mapped recurring LP management fee.

Parameters

block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Ignored.

Returns

None because option-premium fees are a different fee model.

Return type

Optional[float]

get_performance_fee(block_identifier)

Return no mapped generic LP performance fee.

Parameters

block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Ignored.

Returns

None because option-premium fees are a different fee model.

Return type

Optional[float]

get_fee_data()

Return unspecified common LP fee fields.

Returns

Common fee payload without misclassified option-sale fees.

Return type

eth_defi.vault.fee.FeeData

get_share_price_source()

Classify final epoch values as authoritative smart-contract data.

Returns

Smart-contract source classification.

Return type

eth_defi.vault.price_source.PriceSource

Return the canonical Rysk Premium application.

Rysk does not publish a stable per-pool URL pattern.

Parameters

referral (Optional[str]) – Ignored because no generic referral URL exists.

Returns

Official Premium application entry point.

Return type

str

property denomination_token: Optional[eth_defi.token.TokenDetails]

Get the token which denominates the vault valuation

  • Used in deposits and redemptions

  • Used in NAV calculation

  • Used in profit benchmarks

  • Usually USDC

Returns

Token wrapper instance.

Maybe None for broken vaults like https://arbiscan.io/address/0x9d0fbc852deccb7dcdd6cb224fa7561efda74411#code

Note

None results are not cached — the next access will retry the on-chain call. This avoids permanently caching a transient RPC failure.

property deposit_manager: eth_defi.vault.deposit_redeem.VaultDepositManager

Deposit manager assocaited with this vault

property description: Optional[str]

Human-readable vault strategy description.

  • Fetched from protocol-specific offchain sources (e.g. Euler GitHub labels, Lagoon web app API)

  • Returns None if the protocol does not provide descriptions or the vault is not in the metadata source

  • Override in subclasses that support offchain metadata

fetch_available_liquidity(block_identifier='latest')

Get the amount of denomination token available for immediate withdrawal.

Only applicable to lending protocol vaults (IPOR, Euler, Morpho, Gearbox, etc.). Non-lending protocols should leave this method unimplemented.

Note: maxRedeem(address(0)) does NOT work as a proxy for available liquidity because it requires a specific address that has already deposited shares. For address(0), balanceOf is always 0, so maxRedeem returns 0 regardless of actual liquidity.

Parameters

block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Block to query. Defaults to “latest”.

Raises

NotImplementedError – For non-lending protocol vaults.

Returns

Amount in denomination token units (human-readable Decimal).

Return type

Optional[decimal.Decimal]

fetch_deposit_closed_reason()

Get human-readable reason why deposits are closed.

  • Override in protocol-specific subclasses

  • Default behaviour: no closure reason is known (return None)

Returns

Human-readable string explaining why deposits are closed, or None if deposits are open or the adapter cannot determine a closure reason. Use fetch_deposit_open() for explicit tri-state availability metadata.

Example reasons:

  • ”Epoch redemption window closed (opens in 14h)”

  • ”Vault paused by admin”

  • ”Max deposit cap reached”

  • ”Vault utilisation too high”

Return type

Optional[str]

fetch_deposit_next_open()

Get when deposits will next be open.

  • For epoch-based vaults (Ostium, D2), return calculated window open time

  • For non-epoch vaults (Plutus, IPOR, Morpho), return None

  • Override in protocol-specific subclasses

Returns

Naive UTC datetime when deposits will next be available, or None if:

  • Deposits are currently open

  • Timing is unpredictable (manually controlled)

  • Protocol does not support timing information

Return type

Optional[datetime.datetime]

fetch_deposit_open()

Fetch the current protocol-defined deposit availability.

This is deliberately a tri-state value. True and False mean that the adapter read an authoritative vault-wide state; None means that the generic adapter cannot safely determine the state. It is separate from fetch_deposit_closed_reason(), because an absent human-readable reason does not prove that deposits are open.

Returns

True when deposits are open, False when they are closed, or None when the protocol does not expose a reliable global availability read.

Return type

Optional[bool]

fetch_minimum_deposit(block_identifier='latest')

Fetch a source-proven minimum deposit in decimal token units.

A None result means this adapter does not expose a known minimum; it does not prove the protocol accepts arbitrarily small deposits. A zero result means the adapter positively established that the vault has no minimum deposit.

Parameters

block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Block at which to read the protocol configuration.

Returns

Decimal denomination-token minimum, or None when unknown.

Return type

Optional[decimal.Decimal]

fetch_minimum_redemption(block_identifier='latest')

Fetch a source-proven redemption minimum in decimal share units.

A None result means this adapter does not expose a known minimum; it does not prove the protocol accepts arbitrarily small redemptions. A zero result means the adapter positively established that the vault has no minimum redemption.

Parameters

block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Block at which to read the protocol configuration.

Returns

Decimal vault-share minimum, or None when unknown.

Return type

Optional[decimal.Decimal]

fetch_redemption_closed_reason()

Get human-readable reason why redemptions are closed.

  • Override in protocol-specific subclasses

  • Default behaviour: assume redemptions are always open (return None)

Returns

Human-readable string explaining why redemptions are closed, or None if redemptions are open.

Example reasons:

  • ”Epoch funding phase in progress (opens in 2d 5h)”

  • ”Vault paused by admin”

  • ”Vault utilisation too high - insufficient liquidity”

Return type

Optional[str]

fetch_redemption_next_open()

Get when withdrawals/redemptions will next be open.

  • For epoch-based vaults (Ostium, D2), return calculated window open time

  • For non-epoch vaults (Plutus, IPOR, Morpho), return None

  • Override in protocol-specific subclasses

Returns

Naive UTC datetime when withdrawals will next be available, or None if:

  • Withdrawals are currently open

  • Timing is unpredictable (manually controlled)

  • Protocol does not support timing information

Return type

Optional[datetime.datetime]

fetch_utilisation_percent(block_identifier='latest')

Get the percentage of assets currently lent out.

Only applicable to lending protocol vaults (IPOR, Euler, Morpho, Gearbox, etc.). Non-lending protocols should leave this method unimplemented.

Parameters

block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Block to query. Defaults to “latest”.

Raises

NotImplementedError – For non-lending protocol vaults.

Returns

Utilisation as float between 0.0 and 1.0 (0% to 100%).

Return type

Optional[float]

property flow_manager: eth_defi.vault.base.VaultFlowManager

Flow manager associated with this vault

get_deposit_fee(block_identifier)

Deposit fee is set to zero by default as vaults usually do not have deposit fees.

Internal: Use get_fee_data().

Parameters

block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) –

Return type

Optional[float]

get_deposit_manager_capability()

Return static public transaction-adapter support, if any.

This method deliberately does not attempt to construct a manager or query live pause, cap, epoch, balance, allow-list, or liquidity state. Adapters opt in only after their complete deposit and redemption lifecycles have focused coverage. None is therefore the safe default for unknown and protocol-specific vaults.

Returns

Adapter-specific capability object, or None when unsupported.

Return type

Optional[eth_defi.vault.deposit_redeem.VaultDepositManagerCapability]

get_estimated_lock_up()

What is the estimated lock-up period for this vault.

Returns

None if not know

Return type

Optional[datetime.timedelta]

get_fee_mode()

Get how this vault accounts its fees.

Return type

Optional[eth_defi.vault.fee.VaultFeeMode]

get_flags()

Get various vault state flags from the smart contract.

The vault metadata scan stores this result as _flags in vault-metadata-db.pickle. top_vaults_by_chain.json is generated from those stored values through scripts/erc-4626/vault-analysis-json.py / eth_defi.vault.top_vaults_json.

After editing manual flags in eth_defi.vault.flag, rerun the vault metadata scan and top-vault JSON post-processing. Regenerating the JSON from an old metadata database will not pick up new manual flags.

Returns

Flag set.

Do not modify in place.

Return type

set[eth_defi.vault.flag.VaultFlag]

get_notes()

Get a human readable message if we know somethign special is going on with this vault.

Return type

Optional[str]

get_protocol_name()

Return the name of the vault protocol.

Return type

str

get_risk()

Get risk profile of this vault.

Return type

Optional[eth_defi.vault.risk.VaultTechnicalRisk]

get_strategy_tags()

Get the known investment strategy classifications for this vault.

Override this method when an adapter or its metadata source can determine the vault’s strategy. None means the strategy information is missing or has not yet been classified; it is distinct from an empty set, which would mean the strategy was evaluated but did not match any available tag. Maintained mappings normally omit an unclassified address; use StrategyTag.unknown only when research establishes that the strategy itself is unknown.

Returns

Strategy tag set, or None when the information is missing.

Return type

Optional[set[eth_defi.vault.strategy_tag.StrategyTag]]

get_whitelist_notes()

Return an export caveat for the vault-wide whitelist status.

Adapters may attach a concise, stable explanation when a classification is an explicitly requested operating assumption or excludes an integration-specific permission mechanism. The note describes the policy classification only; it must not be used to report temporary deposit availability.

Returns

Export note, or None when the classification needs no caveat.

Return type

Optional[str]

get_withdraw_fee(block_identifier)

Withdraw fee is set to zero by default as vaults usually do not have withdraw fees.

Internal: Use get_fee_data().

Parameters

block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) –

Return type

float

get_withdrawal_period()

Return binding withdrawal timing and optional settlement estimates.

Unlike get_estimated_lock_up(), this reports the redemption lifecycle after a user submits a valid withdrawal request. Adapters use min_period and max_period only for a binding smart-contract timing rule. An adapter may instead return a non-binding estimated_settlement for backtesting an offchain operating cadence or redemption wait; that estimate never establishes claimability and does not require a synthetic timing bound.

Returns

Withdrawal period details, or None when unavailable.

Return type

Optional[eth_defi.vault.base.WithdrawalPeriod]

has_custom_fees()

Does this vault have fees outside the shared fee model.

Custom fees cause risk in vault comparison because the shared management/performance/deposit/withdraw fee fields cannot describe the full fee structure.

Do not return True merely because a vault implements custom accessors for ordinary management, performance, deposit, or withdraw fees. Return True only when some vault fee cannot be reflected in those standard fields as a fee-like value.

Returns

True if the vault has fees outside the shared fee model.

Return type

bool

property info: eth_defi.vault.base.VaultInfo

Get info dictionary related to this vault deployment.

  • Get cached data on the various vault parameters

Returns

Vault protocol specific information dictionary

is_account_whitelisted(address)

Determine whether an account has completed the vault’s KYC policy.

The result concerns KYC, manual identity approval, or recipient allowlist membership only. A protocol may still require scheduling, a token balance, an allowance, available capacity, or an open epoch before a deposit can be submitted. Callers must use the relevant deposit manager pre-flight before broadcasting a transaction.

Parameters

address (eth_typing.evm.HexAddress) – Account whose deposit-policy membership is queried.

Returns

True when the account has the required pre-approval.

Raises

NotImplementedError – If the adapter cannot safely query account membership.

Return type

bool

is_whitelisted_deposit()

Determine whether deposits require pre-approved recipient accounts.

Protocol adapters override this predicate only when the deployed contract version has verified implementation source or a canonical application ABI that proves a reliable vault-wide policy read. An explicitly documented operating assumption may also override it, but must set whitelist_notes so consumers can distinguish it from a source-proven result. True means the vault requires KYC, manual identity approval, or a source-proven recipient allowlist; False means its policy is permissionless. An open date, lock-up, epoch, pause, cap, token balance, or other runtime eligibility condition must not affect the result. A source-proven override requires a fixed-block adapter test for every supported implementation generation. An operating assumption requires a unit test that asserts both its classification and its caveat. This is independent of a caller’s current balance, allowance, pause state, capacity, and request lifecycle.

Returns

True when deposits require account pre-approval and False when they do not.

Raises

NotImplementedError – If the adapter cannot safely determine the policy.

Return type

bool

property manager_name: Optional[str]

Protocol-supplied vault manager or curator display name.

  • Used when the vault name itself does not contain the curator brand

  • Returns None if the protocol does not expose separate manager metadata

  • Override in subclasses that support manager or operator metadata

property share_token: eth_defi.token.TokenDetails

ERC-20 that presents vault shares.

  • User gets shares on deposit and burns them on redemption

first_seen_at_block: int | None

Block number hint when this vault was deployed.

Must be set externally, as because of shitty Ethereum RPC we cannot query this. Allows us to avoid unnecessary work when scanning historical price data.