MellowVaultHistoricalReader
Documentation for eth_defi.mellow.historical.MellowVaultHistoricalReader Python class.
- class MellowVaultHistoricalReader
Bases:
eth_defi.vault.base.VaultHistoricalReaderRead the currently supported Mellow historical state.
The reader samples tokenised
ShareManager.totalSupply()and the latest Mellow oracle report for the denomination asset. Mellow reports raw shares per raw asset aspriceD18; the reader converts it to the shared asset-per-share historical price convention and derives denomination-token TVL asshare_price * total_supply.Create a Mellow historical reader.
- Parameters
vault – Mellow vault adapter.
stateful – Whether to attach adaptive reader state used by the shared historical multicaller.
Attributes summary
addressfirst_blockMethods summary
__init__(vault, stateful)Create a Mellow historical reader.
Construct Mellow historical multicalls.
process_result(block_number, timestamp, ...)Convert Mellow multicall results to a vault price row.
- __init__(vault, stateful)
Create a Mellow historical reader.
- Parameters
vault (MellowVault) – Mellow vault adapter.
stateful (bool) – Whether to attach adaptive reader state used by the shared historical multicaller.
- construct_multicalls()
Construct Mellow historical multicalls.
- Returns
Multicall batch reading
ShareManager.totalSupply(),Oracle.getReport(denomination_token)and FeeManager rates.- Return type
collections.abc.Iterable[eth_defi.event_reader.multicall_batcher.EncodedCall]
- process_result(block_number, timestamp, call_results)
Convert Mellow multicall results to a vault price row.
- Parameters
block_number (int) – Historical block number.
timestamp (datetime.datetime) – Naive UTC block timestamp.
call_results (list[eth_defi.event_reader.multicall_batcher.EncodedCallResult]) – Multicall results for calls from
construct_multicalls().
- Returns
VaultHistoricalReadwith Mellow share price and supply.- Return type