FrankencoinHistoricalReader
Documentation for eth_defi.erc_4626.vault_protocol.frankencoin.vault.FrankencoinHistoricalReader Python class.
- class FrankencoinHistoricalReader
Bases:
eth_defi.erc_4626.vault.ERC4626HistoricalReaderRead Frankencoin savings TVL across the wrapper and savings module.
Frankencoin’s ERC-4626
totalAssets()only reports assets attributed to the svZCHF wrapper inside the savings module. Most savings deposits sit directly in the underlying savings module, outside the ERC-4626 wrapper.For Trading Strategy vault TVL we treat the savings product as a whole and write
ZCHF.balanceOf(savings_module) + ZCHF.balanceOf(svZCHF_wrapper)tototal_assets. The share price and total supply still come from the ERC-4626 wrapper, so performance calculations keep using the wrapper’s own exchange rate.Attributes summary
addressfirst_blockone_raw_shareMethods summary
__init__(vault, stateful)Polling endpoints defined in ERC-4626 spec.
Create calls for Frankencoin historical reads.
Create ZCHF balance calls used to calculate savings product TVL.
dictify_multicall_results(block_number, ...)Convert batch of multicalls made for this vault to more digestible dict.
Yield warmup calls for Frankencoin vaults.
process_core_erc_4626_result(call_by_name)Decode common ERC-4626 calls.
process_result(block_number, timestamp, ...)Process a Frankencoin historical read result.
process_savings_tvl_result(call_by_name)Decode Frankencoin savings TVL calls.
should_skip_call(function_name)Check if a specific function call should be skipped.
- get_warmup_calls()
Yield warmup calls for Frankencoin vaults.
Includes the standard ERC-4626 calls plus the ZCHF balances that define the savings product TVL.
- Returns
Tuples consumed by the vault warmup scanner.
- Return type
collections.abc.Iterable[tuple[str, callable, object]]
- construct_multicalls()
Create calls for Frankencoin historical reads.
- Returns
Encoded calls for ERC-4626 state and Frankencoin savings TVL.
- Return type
collections.abc.Iterable[eth_defi.event_reader.multicall_batcher.EncodedCall]
- construct_savings_balance_multicalls()
Create ZCHF balance calls used to calculate savings product TVL.
- Returns
Encoded ZCHF
balanceOfcalls for the savings module and wrapper.- Return type
collections.abc.Iterable[eth_defi.event_reader.multicall_batcher.EncodedCall]
- process_savings_tvl_result(call_by_name)
Decode Frankencoin savings TVL calls.
- Parameters
call_by_name (dict[str, eth_defi.event_reader.multicall_batcher.EncodedCallResult]) – Multicall results keyed by
extra_data["function"].- Returns
(total_assets, errors)wheretotal_assetsis denominated in ZCHF.- Return type
tuple[decimal.Decimal | None, list[str]]
- process_result(block_number, timestamp, call_results)
Process a Frankencoin historical read result.
- Parameters
block_number (int) – Block number used for the read.
timestamp (datetime.datetime) – Naive UTC block timestamp.
call_results (list[eth_defi.event_reader.multicall_batcher.EncodedCallResult]) – Multicall results for this vault.
- Returns
Historical row with Frankencoin savings product TVL for canonical wrappers, or regular ERC-4626 wrapper TVL for duplicate wrappers.
- Return type
- __init__(vault, stateful)
- Parameters
vault (eth_defi.erc_4626.vault.ERC4626Vault) –
stateful (bool) –
- construct_core_erc_4626_multicall()
Polling endpoints defined in ERC-4626 spec.
Does not include fee calls which do not have standard
- dictify_multicall_results(block_number, call_results, allow_failure=True)
Convert batch of multicalls made for this vault to more digestible dict.
Assert that all multicalls succeed
- Returns
Dictionary where each multicall is keyed by its
EncodedCall.extra_data["function"]- Parameters
block_number (int) –
call_results (list[eth_defi.event_reader.multicall_batcher.EncodedCallResult]) –
- Return type
dict[str, eth_defi.event_reader.multicall_batcher.EncodedCallResult]
- process_core_erc_4626_result(call_by_name)
Decode common ERC-4626 calls.
- Parameters
call_by_name (dict[str, eth_defi.event_reader.multicall_batcher.EncodedCallResult]) –
- Return type