IPORVaultHistoricalReader

Documentation for eth_defi.ipor.vault.IPORVaultHistoricalReader Python class.

class IPORVaultHistoricalReader

Bases: eth_defi.erc_4626.vault.ERC4626HistoricalReader

Read IPOR vault core data + fees + utilisation

Attributes summary

address

first_block

one_raw_share

share_price_change_threshold

Return this reader's sparse share-price comparison threshold.

uses_contextual_history

Return whether this reader supplies protocol-sourced observations.

uses_share_price_equivalence

Return whether cash flows must be ignored by the sparse filter.

write_all_samples

Retain every successful static Multicall sample, including unchanged NAVs.

Methods summary

__init__(vault, stateful)

construct_core_erc_4626_multicall()

Polling endpoints defined in ERC-4626 spec.

construct_fee_calls()

construct_multicalls()

Get the onchain calls that are needed to read the share price.

construct_utilisation_calls()

Add idle assets call for utilisation calculation.

dictify_multicall_results(block_number, ...)

Convert batch of multicalls made for this vault to more digestible dict.

fetch_contextual_historical_reads(...)

Yield protocol-sourced historical rows outside the static call grid.

get_risk()

get_warmup_calls()

Yield warmup calls for IPOR vaults.

process_core_erc_4626_result(call_by_name)

Decode common ERC-4626 calls.

process_ipor_fee_result(call_by_name)

Decode IPOR specific data.

process_result(block_number, timestamp, ...)

Process the result of mult

process_utilisation_result(call_by_name, ...)

Decode IPOR utilisation data.

should_skip_call(function_name)

Check if a specific function call should be skipped.

get_warmup_calls()

Yield warmup calls for IPOR vaults.

Return type

collections.abc.Iterable[tuple[str, callable, any]]

construct_multicalls()

Get the onchain calls that are needed to read the share price.

Return type

collections.abc.Iterable[eth_defi.event_reader.multicall_batcher.EncodedCall]

construct_utilisation_calls()

Add idle assets call for utilisation calculation.

Return type

collections.abc.Iterable[eth_defi.event_reader.multicall_batcher.EncodedCall]

process_ipor_fee_result(call_by_name)

Decode IPOR specific data.

Parameters

call_by_name (dict[str, eth_defi.event_reader.multicall_batcher.EncodedCallResult]) –

Return type

tuple

process_utilisation_result(call_by_name, total_assets)

Decode IPOR utilisation data.

Utilisation = (totalAssets - idle) / totalAssets

Parameters
Return type

tuple[decimal.Decimal | None, float | None]

process_result(block_number, timestamp, call_results)

Process the result of mult

  • Calls are created in construct_multicalls()

  • This method combines result of this calls to a easy to manage historical record VaultHistoricalRead

Parameters
Return type

eth_defi.vault.base.VaultHistoricalRead

__init__(vault, stateful)
Parameters
construct_core_erc_4626_multicall()

Polling endpoints defined in ERC-4626 spec.

  • Does not include fee calls which do not have standard

Return type

Iterable[eth_defi.event_reader.multicall_batcher.EncodedCall]

dictify_multicall_results(block_number, call_results, allow_failure=True)

Convert batch of multicalls made for this vault to more digestible dict.

  • Assert that all multicalls succeed

Returns

Dictionary where each multicall is keyed by its EncodedCall.extra_data["function"]

Parameters
Return type

dict[str, eth_defi.event_reader.multicall_batcher.EncodedCallResult]

fetch_contextual_historical_reads(start_block, end_block, step)

Yield protocol-sourced historical rows outside the static call grid.

Contextual readers override this method and read an already-prefilled local cache. Network collection belongs before the common price scan.

Parameters
  • start_block (int) – Inclusive archive block boundary.

  • end_block (int) – Exclusive archive block boundary.

  • step (int) – Approximate block spacing used to downsample source observations.

Returns

Ordinary VaultHistoricalRead rows for the common writer.

Raises

NotImplementedError – If a reader opts into contextual history without implementing it.

Return type

Iterable[eth_defi.vault.base.VaultHistoricalRead]

process_core_erc_4626_result(call_by_name)

Decode common ERC-4626 calls.

Parameters

call_by_name (dict[str, eth_defi.event_reader.multicall_batcher.EncodedCallResult]) –

Return type

tuple

property share_price_change_threshold: float

Return this reader’s sparse share-price comparison threshold.

Event-only readers may require every exact price change; ordinary readers retain the existing ten-basis-point suppression threshold.

Returns

Non-negative relative suppression threshold.

should_skip_call(function_name)

Check if a specific function call should be skipped.

Uses the reader state’s call_status map if available.

Parameters

function_name (str) – The function name to check

Returns

True if the call should be skipped

Return type

bool

property uses_contextual_history: bool

Return whether this reader supplies protocol-sourced observations.

Most EVM vaults expose static calldata that the common multicaller can execute on a regular block grid. Protocols such as GMX instead expose sparse value events that are prefetched into a protocol-owned cache.

Returns

False for the ordinary static-multicall path.

property uses_share_price_equivalence: bool

Return whether cash flows must be ignored by the sparse filter.

Vault-like products without a standard share-price method can still expose a supply-normalised price equivalent. Their TVL and supply changes must not create false performance observations.

Returns

True when the vault carries the share_price_equivalence feature.