GMXHistoricalReader

Documentation for eth_defi.gmx.vault.GMXHistoricalReader Python class.

class GMXHistoricalReader

Bases: eth_defi.vault.base.VaultHistoricalReader

Read cached GMX value-and-supply observations.

Attributes summary

address

first_block

share_price_change_threshold

Return this reader's sparse share-price comparison threshold.

uses_contextual_history

Select the protocol-sourced history branch in the common scanner.

uses_share_price_equivalence

Return whether cash flows must be ignored by the sparse filter.

write_all_samples

Retain every successful static Multicall sample, including unchanged NAVs.

Methods summary

__init__(vault)

construct_multicalls()

Return no static calls because GMX history is event sourced.

fetch_contextual_historical_reads(...)

Yield GMX observations downsampled to common block buckets.

process_result(block_number, timestamp, ...)

Reject the static multicall path for GMX.

property uses_contextual_history: bool

Select the protocol-sourced history branch in the common scanner.

construct_multicalls()

Return no static calls because GMX history is event sourced.

Return type

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

process_result(block_number, timestamp, call_results)

Reject the static multicall path for GMX.

Raises

RuntimeError – Always; fetch_contextual_historical_reads() owns GMX reads.

Parameters
Return type

eth_defi.vault.base.VaultHistoricalRead

fetch_contextual_historical_reads(start_block, end_block, step)

Yield GMX observations downsampled to common block buckets.

Parameters
  • start_block (int) – Inclusive archive range boundary.

  • end_block (int) – Exclusive archive range boundary.

  • step (int) – Common scan’s positive block bucket width.

Returns

Supply-normalised GM or GLV historical rows.

Return type

collections.abc.Iterable[eth_defi.vault.base.VaultHistoricalRead]

__init__(vault)
Parameters

vault (eth_defi.vault.base.VaultBase) –

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_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

True when the vault carries the share_price_equivalence feature.