YieldBasisHistoricalReader
Documentation for eth_defi.yield_basis.vault.YieldBasisHistoricalReader Python class.
- class YieldBasisHistoricalReader
Bases:
eth_defi.vault.base.VaultHistoricalReaderRead cached YieldBasis observations on a common block grid.
Historical archive calls are prefetched into the protocol context table; this reader only converts exact source rows to the common vault format.
Attributes summary
addressfirst_blockReturn this reader's sparse share-price comparison threshold.
Select the protocol-owned context path.
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)Return no static calls; observations are prefetched.
Yield the latest context observation inside each block bucket.
process_result(block_number, timestamp, ...)Reject the ordinary static-call path.
- property uses_contextual_history: bool
Select the protocol-owned context path.
- construct_multicalls()
Return no static calls; observations are prefetched.
- process_result(block_number, timestamp, call_results)
Reject the ordinary static-call path.
- Parameters
block_number (int) –
timestamp (datetime.datetime) –
call_results (list[eth_defi.event_reader.multicall_batcher.EncodedCallResult]) –
- Return type
- fetch_contextual_historical_reads(start_block, end_block, step)
Yield the latest context observation inside each block bucket.
- Parameters
- Return type
collections.abc.Iterable[eth_defi.vault.base.VaultHistoricalRead]
- __init__(vault)
- Parameters
vault (eth_defi.vault.base.VaultBase) –
- 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_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.