VaultStreetHistoricalReader

Documentation for eth_defi.vault_street.historical.VaultStreetHistoricalReader Python class.

class VaultStreetHistoricalReader

Bases: eth_defi.vault.base.VaultHistoricalReader

Read historical primeUSD supply and NAV/share.

primeUSD is not ERC-4626. Its historical TVL is derived from the ERC-20 totalSupply() and Vault Street’s PriceStorage.getPrice() oracle.

Create a Vault Street historical reader.

Parameters
  • vault – Vault Street primeUSD adapter.

  • stateful – Whether to attach adaptive reader state for the shared historical scanner.

Attributes summary

address

first_block

Methods summary

__init__(vault, stateful)

Create a Vault Street historical reader.

construct_multicalls()

Construct supply and NAV/share calls for a historical block.

process_result(block_number, timestamp, ...)

Convert primeUSD multicall results to a vault price row.

__init__(vault, stateful)

Create a Vault Street historical reader.

Parameters
  • vault (VaultStreetVault) – Vault Street primeUSD adapter.

  • stateful (bool) – Whether to attach adaptive reader state for the shared historical scanner.

construct_multicalls()

Construct supply and NAV/share calls for a historical block.

Returns

Multicall batch reading totalSupply() and getPrice().

Return type

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

process_result(block_number, timestamp, call_results)

Convert primeUSD multicall results to a vault price row.

Parameters
Returns

Historical primeUSD supply, NAV/share and TVL.

Return type

eth_defi.vault.base.VaultHistoricalRead