Oracle
How prices reach the chain: on-chain oracle contract and off-chain feeder.
The Nolus oracle is a two-layer system:
- On-chain Oracle contract - accepts signed spot prices from a
whitelisted set of feeders, aggregates them into an EMA, and serves
the EMA to consumers. Source:
nolus-money-market/protocol/contracts/oracle. - Off-chain price feeder - a Rust daemon that pulls spot prices
from configured sources (DEXs, CEX APIs), signs them, and feeds them
to the Oracle contract. Source:
oracle-price-feeder.
The on-chain Oracle is the real-time price source for the rest of the protocol. Consumers (Lease contracts, SDK clients, frontends) read EMA prices from it directly; they don't talk to feeders.
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).
Feeder responsibilities
- Pull spot prices from configured providers.
- Apply per-source weights and outlier filtering.
- Sign and submit spot prices within each oracle feed window.
- Recover gracefully from RPC errors and rate limits.