tokenised_fund.sygnum.historical
Documentation for eth_defi.tokenised_fund.sygnum.historical Python module.
Historical state reader for Sygnum FILQ shares.
Classes
Read FILQ supply and its official Chainlink bundle NAV. |
|
Adaptive reader state for FILQ's synthetic USD denomination. |
- class SygnumVaultReaderState
Bases:
eth_defi.erc_4626.vault.VaultReaderStateAdaptive reader state for FILQ’s synthetic USD denomination.
- Parameters
vault – The vault we are reading historical data for
tvl_threshold_1d_read – If the TVL is below this threshold, we will not read it more than once per day, otherwise hourly.
down_hard – Stop reading the vault if the TVL is down by this percentage from the peak.
min_tvl_threshold – If the vault never reaches this TVL, we stop reading it after the traction period.
traction_period – How long we wait for the vault to get traction before we stop reading it.
- Parm peaked_tvl_threshold
The TVL value we first need to reach to trigger down hard condition.
- property exchange_rate: decimal.Decimal
Return one because FILQ NAV and TVL are already denominated in USD.
- __init__(vault, tvl_threshold_1d_read=Decimal('10000'), tiny_tvl_threshold_rare_read=Decimal('1000'), peaked_tvl_threshold=Decimal('200000'), min_tvl_threshold=Decimal('1500'), down_hard=0.98, traction_period=datetime.timedelta(days=60))
- Parameters
vault (eth_defi.erc_4626.vault.ERC4626Vault) – The vault we are reading historical data for
tvl_threshold_1d_read – If the TVL is below this threshold, we will not read it more than once per day, otherwise hourly.
down_hard – Stop reading the vault if the TVL is down by this percentage from the peak.
min_tvl_threshold – If the vault never reaches this TVL, we stop reading it after the traction period.
traction_period (datetime.timedelta) – How long we wait for the vault to get traction before we stop reading it.
- Parm peaked_tvl_threshold
The TVL value we first need to reach to trigger down hard condition.
- get_broken_calls()
Get all calls marked as broken.
- get_call_status(function_name)
Get the status of a function call.
- get_frequency()
How fast we are reading this vault or should the further reading be skipped.
- on_called(result, total_assets=None, share_price=None)
- Parameters
result (eth_defi.event_reader.multicall_batcher.EncodedCallResult) – Result of convertToAssets() call
total_assets (Optional[decimal.Decimal]) –
share_price (Optional[decimal.Decimal]) –
- on_unpriced_call(result)
Update adaptive scan state for a successful supply-only read.
Some tokenised funds expose their share supply but no reviewed scalar NAV or TVL. They still need persistent reader state so the stateful scanner can cache token metadata, advance its last-read block and throttle historical calls. Zero values are internal scheduling sentinels only; the exported historical row must continue to expose
Nonefor its share price and total assets.- Parameters
result (eth_defi.event_reader.multicall_batcher.EncodedCallResult) – Successful supply call carrying a block number and timestamp.
- Return type
None
- set_call_status(function_name, check_block, reverts)
Record the status of a function call.
- should_invoke(call, block_identifier, timestamp)
Check the condition if this multicall is good to go.
- Parameters
call (eth_defi.event_reader.multicall_batcher.EncodedCall) –
block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, hexbytes.main.HexBytes, int]) –
timestamp (datetime.datetime) –
- Return type
- should_skip_call(function_name)
Check if a specific function call should be skipped for this vault.
Part of the warmup system to detect and skip broken contract calls. See README-reader-states.md for documentation.
- first_seen_at_block
Passed from the vault discovery reader, pass the block number as args when we know this vault popped in to the existing
- last_tvl: decimal.Decimal
TVL from the last read
- first_read_at: datetime.datetime
Timestamp of the block of the first successful read of this vault.
- max_tvl: decimal.Decimal
Start with zero TVL
Start with zero share price
- last_call_at: Optional[datetime.datetime]
When this vault received its last eth_call update
- peaked_at: datetime.datetime
Disable reading if the vault has peaked (TVL too much down) and is no longer active
- faded_at: datetime.datetime
Disable reading if the vault has never gotten any traction
- traction_period
How much time after deployment we allow to get traction
- min_tvl_threshold
Minimum TVL traction threshold to start reading the vault
- tiny_tvl_threshold_rare_read
Vaults we do no really care about
- entry_count
How many on_called() invocations have we had
- invoke_count_passed
How many should_invoke() invocations have we had
- invoke_count_first_read
How many should_invoke() invocations have we had
- invoke_count_missing_freq
How many should_invoke() invocations have we had
- invoke_count_throttled
How many should_invoke() invocations have we had
- rpc_error_count
Track RPCc errors
- denomination_token_address
Cache denomination token address when preparing readers
Cache share token address when preparing readers
One share in its raw units
- one
Cache denomination token address when preparing readers
- chain_id
Copy for state debuggin
- vault_poll_frequency
Cache for how often we are polling this vault, the mode name
- token_symbol
Cache for debuggin
- unsupported_token
Cache for debuggin
- class SygnumVaultHistoricalReader
Bases:
eth_defi.vault.base.VaultHistoricalReaderRead FILQ supply and its official Chainlink bundle NAV.
FILQ’s price feed is a Chainlink bundle proxy rather than an AggregatorV3 feed. Historical state reads use
latestBundle()at the sampled block; the targeted Sygnum backfill separately reads every accepted report event througheth_defi.chainlink.bundle_aggregatorand Hypersync.Create the FILQ state reader.
- Parameters
vault – FILQ adapter.
stateful – Retained for shared reader compatibility.
- __init__(vault, stateful)
Create the FILQ state reader.
- Parameters
vault (SygnumVault) – FILQ adapter.
stateful (bool) – Retained for shared reader compatibility.
- construct_multicalls()
Construct FILQ supply and Chainlink bundle calls.
- Returns
Supply, bundle, report-timestamp and schema-validation calls.
- Return type
collections.abc.Iterable[eth_defi.event_reader.multicall_batcher.EncodedCall]
- process_result(block_number, timestamp, call_results)
Convert supply and bundle results to a priced history 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 from
construct_multicalls().
- Returns
FILQ supply, NAV/share and total NAV history row.
- Return type