WSTGBPVaultHistoricalReader
Documentation for eth_defi.wstgbp.historical.WSTGBPVaultHistoricalReader Python class.
- class WSTGBPVaultHistoricalReader
Bases:
eth_defi.vault.base.VaultHistoricalReaderRead historical supply and NAV/share for Wren Staked tGBP.
wstGBP does not implement ERC-4626
convertToAssets()ortotalAssets(). Its canonical onchain share price isnavprice(). Historical TVL is thereforetotalSupply() * navprice()in the ERC-20 denomination returned bygem().Create a Wren Staked tGBP historical reader.
- Parameters
vault – Wren Staked tGBP vault adapter.
stateful – Whether to attach adaptive reader state used by the shared historical multicaller.
Attributes summary
addressfirst_blockReturn this reader's sparse share-price comparison threshold.
Return whether this reader supplies protocol-sourced observations.
Return whether cash flows must be ignored by the sparse filter.
write_all_samplesRetain every successful static Multicall sample, including unchanged NAVs.
Methods summary
__init__(vault, stateful)Create a Wren Staked tGBP historical reader.
Construct Wren Staked tGBP historical multicalls.
Yield protocol-sourced historical rows outside the static call grid.
process_result(block_number, timestamp, ...)Convert Wren Staked tGBP multicall results to a vault price row.
- __init__(vault, stateful)
Create a Wren Staked tGBP historical reader.
- Parameters
vault (WSTGBPVault) – Wren Staked tGBP vault adapter.
stateful (bool) – Whether to attach adaptive reader state used by the shared historical multicaller.
- construct_multicalls()
Construct Wren Staked tGBP historical multicalls.
- Returns
Multicall batch reading ERC-20
totalSupply()and wstGBPnavprice().- Return type
collections.abc.Iterable[eth_defi.event_reader.multicall_batcher.EncodedCall]
- fetch_contextual_historical_reads(start_block, end_block, step)
Yield protocol-sourced historical rows outside the static call grid.
Contextual readers override this method and read an already-prefilled local cache. Network collection belongs before the common price scan.
- Parameters
- Returns
Ordinary
VaultHistoricalReadrows for the common writer.- Raises
NotImplementedError – If a reader opts into contextual history without implementing it.
- Return type
- process_result(block_number, timestamp, call_results)
Convert Wren Staked tGBP multicall results to a vault price 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 for calls from
construct_multicalls().
- Returns
Historical NAV/share, supply, TVL and observed error information.
- Return type
- property share_price_change_threshold: float
Return this reader’s sparse share-price comparison threshold.
Event-only readers may require every exact price change; ordinary readers retain the existing ten-basis-point suppression threshold.
- Returns
Non-negative relative suppression threshold.
- property uses_contextual_history: bool
Return whether this reader supplies protocol-sourced observations.
Most EVM vaults expose static calldata that the common multicaller can execute on a regular block grid. Protocols such as GMX instead expose sparse value events that are prefetched into a protocol-owned cache.
- Returns
Falsefor the ordinary static-multicall path.
- property uses_share_price_equivalence: bool
Return whether cash flows must be ignored by the sparse filter.
Vault-like products without a standard share-price method can still expose a supply-normalised price equivalent. Their TVL and supply changes must not create false performance observations.
- Returns
Truewhen the vault carries theshare_price_equivalencefeature.