DenominationTokenRate
Documentation for eth_defi.feed.stablecoin_rate.DenominationTokenRate Python class.
- class DenominationTokenRate
Bases:
objectRate data section exported for a vault denomination token.
This dataclass is returned by
StablecoinRateFeeder.get_denomination_token_rate_section()and is serialised byeth_defi.research.vault_metrics.export_lifetime_row()for thedenomination_token_ratefield in lifetime metrics JSON output. Source-currency values originate frometh_defi.stablecoin_metadata.StablecoinMetadataand are updated byrefresh_stablecoin_rates().Attributes summary
CoinGecko coin id used to fetch
usd_rate.Stablecoin source currency ticker, e.g.
Latest token price in USD from CoinGecko.
Naive UTC timestamp when
usd_ratewas fetched.Provider/source for
usd_rate.Latest token price in
source_currencyfor non-USD stablecoins.Currency ticker for
native_rate.Naive UTC timestamp for
native_rate.Provider chain for
native_rate, e.g.USD per one
source_currencyunit used to derivenative_rate.Naive UTC timestamp when
source_currency_usd_ratewas read from the currency database.Currency database provider/source for
source_currency_usd_rate.Methods summary
__init__(coingecko_id, source_currency, ...)- coingecko_id: Optional[str]
CoinGecko coin id used to fetch
usd_rate.
- source_currency: Optional[str]
Stablecoin source currency ticker, e.g.
usd,eurorjpy.
- usd_rate: Optional[float]
Latest token price in USD from CoinGecko.
- usd_rate_fetched_at: Optional[datetime.datetime]
Naive UTC timestamp when
usd_ratewas fetched.
- usd_rate_source: Optional[str]
Provider/source for
usd_rate. Currentlycoingeckowhen present.
- native_rate: Optional[float]
Latest token price in
source_currencyfor non-USD stablecoins.This is omitted for
source_currency == "usd"becauseusd_ratealready carries the native value.
- native_rate_currency: Optional[str]
Currency ticker for
native_rate. Populated only for non-USD source currencies.
- native_rate_fetched_at: Optional[datetime.datetime]
Naive UTC timestamp for
native_rate. Matchesusd_rate_fetched_atwhen populated.
- native_rate_source: Optional[str]
Provider chain for
native_rate, e.g.coingecko+fawazahmed0.
- source_currency_usd_rate: Optional[float]
USD per one
source_currencyunit used to derivenative_rate.
- source_currency_usd_rate_fetched_at: Optional[datetime.datetime]
Naive UTC timestamp when
source_currency_usd_ratewas read from the currency database.
- source_currency_usd_rate_source: Optional[str]
Currency database provider/source for
source_currency_usd_rate.
- __init__(coingecko_id, source_currency, usd_rate, usd_rate_fetched_at, usd_rate_source, native_rate, native_rate_currency, native_rate_fetched_at, native_rate_source, source_currency_usd_rate, source_currency_usd_rate_fetched_at, source_currency_usd_rate_source)
- Parameters
usd_rate_fetched_at (Optional[datetime.datetime]) –
native_rate_fetched_at (Optional[datetime.datetime]) –
source_currency_usd_rate_fetched_at (Optional[datetime.datetime]) –
- Return type
None