Skip to main content
Oracles & Alarms

Price Is Calculated Using the Exponential Moving Average (EMA) Method

Updated over 2 weeks ago

Market Data Price Oracle

The Market Data Price Oracle is an on-chain service delivering real-time market prices to system components. It allows these components to receive notifications when prices reach predefined levels, with multiple price points available for monitoring per component.

Market Data Price Feeder

The Market Data Price Feeder collects denomination pairs from the Market Data Price Oracle and fetches prices from Osmosis for the supported pairs. It averages the retrieved prices and updates the Oracle with the latest data feed at intervals, typically every few seconds. Only governance-approved feeders are permitted to actively contribute price data to the Oracle.

Supported currency pairs are configurable through governance, with the feeder's base currency set at initialization and unchangeable afterward. Pairs can be requested in reverse (e.g., A/B data is valid for a B/A request) and can span a resolution path (e.g., [A/C, B/C], or [A/C, C/B]).

Price Calculation Algorithm

Price feeders use an Exponential Moving Average (EMA) algorithm to determine cryptocurrency pair prices, adding a security layer by prioritizing recent data. A discounting factor between 0 and 1 is applied, with higher values discounting older observations more quickly, unlike the equal-weight approach of a Standard Moving Average (SMA).

Global Time Oracle

The Global Time Oracle is an on-chain timing mechanism that updates based on the latest Market Data Price Feed’s Tendermint block time. Its Global Time Alarm enables notifications when specific time thresholds are reached, ensuring synchronized timing across system components.

Did this answer your question?