Skip to content

Oracle Tables ​

feeddata ​

  • Table: feeddata
  • Code: eosio.oracle
  • Scope: eosio.oracle
  • Key: source

The table contains conversion rate cache and weight for individual exchanges.

FieldsTypeDescription
sourcenameName of the registered exchange
ratesstd::vector<uint64_t>Cached rates pushed by this exchange. Value stored is amount from the conversion rate asset type
weightuint64_tWeight of the exchange for the purpose of calculating weighted average between exchanges. It is equal to the last 24 hours trading volume for this exchange
source_typeuint8_tUnused

Most relevant actions: regexchange, unregexchg

oraclestate ​

  • Table: oraclestate
  • Code: eosio.oracle
  • Scope: eosio.oracle

This singleton contains common values used by oracle during it's operation.

FieldsTypeDescription
conversion_rate_symbolsymbolSymbol used for conversion rates asset type pushed by exchanges. Default value is 8,DUOS
trading_volume_symbolsymbolSymbol used for validation of the 24 hours trading volume asset. Default value is 8,USD
latest_timestampuint64_tStores the most recent timestamp extracted from the rates pushed by the exchanges
intervaluint8_tInterval enforced between rates pushed to the oracle. Forced to be 1 during initialization
cache_windowuint8_tTime window for exchanges/source to push the rates. Forced to be 60 during initialization
registered_sourcesuint32_tTotal number of exchange/sources registered
ultra_comprehensive_rate_weightuint32_tUnusued

Most relevant actions: init

feedcompl ​

This table is deprecated and is not currently in use.

finalaverage ​

  • Table: finalaverage
  • Code: eosio.oracle
  • Scope: time symbol_code
  • Key: param

The table contains moving averages for specified time units and windows.

Possible scopes for finalaverage table

  • SECONDS (or .1docnmjch2p3)
  • MINUTES (or .1doep2pdt4oh)
  • HOURS (or .....oumepboc)
  • DAYS (or ......2nf5.o4)
FieldsTypeDescription
averagerateCalculated moving average with a timestamp corresponding to the latest update
is_valid_deprecatedboolUnused
paramuint64_tStores the window size and EMA alpha coefficient. See addma for details
moving_window_counteruint8_tIncremental counter which is used to track how many values were accumulated by the moving average
unituint8_tUnused. Forced to be 1

Most relevant actions: pushrate

finalrates ​

  • Table: finalrates
  • Code: eosio.oracle
  • Scope: 0 (seconds) / 1 (minutes) / 2 (hours) / 3 (days)

The table contains intermediate values and calculated moving averages to be used for updating finalaverage table entries.

FieldsTypeDescription
indexuint64_tIndex pointing to the latest value in the rates vector that was updated
ratesstd::vector<urate>Cached rates calculated based on rates pushed by exchanges or calculated from rolling_moving_average of the previous scope of finalrates. Value stored is a pair of the timestamp of calculated conversion rate and associated price stored as unsigned integer
rolling_moving_averagemoving_average_implRefer to finalaverage table to see the structure of this type. This moving average is used to populate the rates vector of finalrates with scope one higher than the current one

Most relevant actions: pushrate

lastknwnrate ​

  • Table: lastknwnrate
  • Code: eosio.oracle
  • Scope: eosio.oracle

Stores the latest conversion rate pushed from any exchange.

FieldsTypeDescription
sourceeosio::nameName of the exchange that was the last to push the new rate
latest_rateratePair of asset storing the conversion rate of USD to UOS and a uint64_t UTC timestamp when this last rate was pushed