mellow.historical

Documentation for eth_defi.mellow.historical Python module.

Historical reader for Mellow Core Vaults.

Classes

MellowVaultHistoricalReader

Read the currently supported Mellow historical state.

class MellowVaultHistoricalReader

Bases: eth_defi.vault.base.VaultHistoricalReader

Read 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 as priceD18; the reader converts it to the shared asset-per-share historical price convention and derives denomination-token TVL as share_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.

__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
Returns

VaultHistoricalRead with Mellow share price and supply.

Return type

eth_defi.vault.base.VaultHistoricalRead