FranklinVaultHistoricalReader
Documentation for eth_defi.tokenised_fund.franklin.historical.FranklinVaultHistoricalReader Python class.
- class FranklinVaultHistoricalReader
Bases:
eth_defi.vault.base.VaultHistoricalReaderRead historical Benji share supply and issuer-published reference price.
Create the historical reader.
- Parameters
vault – Franklin Templeton Benji tokenised-fund adapter.
stateful – Whether to attach the shared adaptive reader state.
Attributes summary
addressfirst_blockMethods summary
__init__(vault, stateful)Create the historical reader.
Construct total-supply and reference-price calls.
process_result(block_number, timestamp, ...)Convert supply and price calls into a historical fund row.
- __init__(vault, stateful)
Create the historical reader.
- Parameters
vault (FranklinVault) – Franklin Templeton Benji tokenised-fund adapter.
stateful (bool) – Whether to attach the shared adaptive reader state.
- construct_multicalls()
Construct total-supply and reference-price calls.
- Returns
ERC-20 supply and
lastKnownPricecalls for every sample block.- Return type
collections.abc.Iterable[eth_defi.event_reader.multicall_batcher.EncodedCall]
- process_result(block_number, timestamp, call_results)
Convert supply and price calls into a historical fund row.
- Parameters
block_number (int) – Historical Ethereum block number.
timestamp (datetime.datetime) – Naive UTC block timestamp.
call_results (list[eth_defi.event_reader.multicall_batcher.EncodedCallResult]) – Results of
construct_multicalls().
- Returns
Benji share price, supply and USD TVL at the sampled block.
- Return type