EnzymeBlueVaultHistoricalReader
Documentation for eth_defi.enzyme.blue_historical.EnzymeBlueVaultHistoricalReader Python class.
- class EnzymeBlueVaultHistoricalReader
Bases:
eth_defi.vault.base.VaultHistoricalReaderRead Blue GAV, share supply, and derived denomination-token price.
Blue’s
ComptrollerProxy.calcGav()returns the gross asset value in the denomination-token’s raw units. Combining this with VaultProxy supply in one Multicall request gives TVL and the gross share value without requiring an ERC-4626 interface. Historical fee configurations are deliberately TODO: Blue fees may be changed during a release migration. Historical deposit and redemption availability is also unsupported: Blue does not expose a universal availability flag, and its mutable policies can depend on the investor and exact transaction. The reader consequently leavesdeposits_openandredemption_openasNonerather than inferring them from GAV, supply, or a current policy configuration.Create a Blue historical reader with optional adaptive state.
Attributes summary
addressfirst_blockReturn this reader's sparse share-price comparison threshold.
Return whether this reader supplies protocol-sourced observations.
Return whether cash flows must be ignored by the sparse filter.
write_all_samplesRetain every successful static Multicall sample, including unchanged NAVs.
Methods summary
__init__(vault, stateful)Create a Blue historical reader with optional adaptive state.
Construct GAV and VaultProxy supply calls for the shared batch.
Yield protocol-sourced historical rows outside the static call grid.
process_result(block_number, timestamp, ...)Decode one sampled Blue GAV/supply response into a vault row.
- __init__(vault, stateful)
Create a Blue historical reader with optional adaptive state.
- Parameters
vault (EnzymeBlueVault) –
stateful (bool) –
- construct_multicalls()
Construct GAV and VaultProxy supply calls for the shared batch.
- process_result(block_number, timestamp, call_results)
Decode one sampled Blue GAV/supply response into a vault row.
- Parameters
block_number (int) – Sampled chain block.
timestamp (datetime.datetime) – Naive UTC time of
block_number.call_results (list[eth_defi.event_reader.multicall_batcher.EncodedCallResult]) – The two grouped Multicall responses.
- Returns
Derived share price, TVL, supply, and individual call errors.
- Return type
- 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
- Returns
Ordinary
VaultHistoricalReadrows for the common writer.- Raises
NotImplementedError – If a reader opts into contextual history without implementing it.
- Return type
- 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.
- 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
Falsefor 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
Truewhen the vault carries theshare_price_equivalencefeature.