Skip to content

x/oracle — Oracle module

The x/oracle module brings external data — token prices, reference exchange rates — into chain state where economic logic can use it. Feeds are submitted, validated, and stored so that modules pricing marketplace services or evaluating policy have a consensus-visible data source.

Oracle design constrains manipulation: submissions are permissioned and validated rather than free-for-all, because a corrupted price feed corrupts everything priced by it.

Permissioned sources publish token prices and reference rates on a schedule. Each submission passes validation before entering state, becoming consensus-visible data that any module can reference deterministically.

Consumers then resolve against stored rates: fiat-referenced settlement conversions, bid pricing strategies anchoring to published references, and supply mechanics referencing market conditions. The module also carries its feed configuration (PriceFeedConfig) and an aggregated view (AggregatedPrice) derived from submitted entries.

Notably, the keeper carries delegation, rewards, and slashing logic: oracle participants are bonded and can be slashed for misbehavior. Feed integrity is backed by stake, not just by permission.

A marketplace that prices real-world compute in a volatile token needs a trustworthy bridge to external prices. Doing that bridging in a dedicated, auditable module keeps a sensitive dependency contained and governable.

ConceptDefinition
FeedA stream of externally-sourced values validated into chain state.
Oracle riskThe exposure created when on-chain logic depends on off-chain data quality.
  1. Submit — Feeds are submitted. Permissioned sources publish token prices and reference rates on a schedule.
  2. Validate — Values are checked. Submissions pass validation before entering state — the guardrail against corrupted data.
  3. Store — Rates become state. Consensus-visible data that any module can reference deterministically.
  4. Price — Logic consumes. Settlement conversions, bid anchors, and policy inputs resolve through stored rates.
MessagePurpose
MsgAddPriceEntrySubmits a price entry to a feed.
MsgUpdateParamsGovernance-only update of module parameters.
QueryPurpose
PricesStored price entries for a feed.
AggregatedPriceThe aggregated price derived from submitted entries.
PriceFeedConfigThe configuration of a price feed.
ParamsCurrent module parameters.
ModuleHow they interact
x/settlementFiat-referenced pricing resolves through oracle rates.
x/bmeSupply mechanics can reference oracle-reported market conditions.
x/marketBid pricing strategies can anchor to oracle-published references.

A stream of externally-sourced values — token prices, reference exchange rates — validated into chain state on a schedule.

The exposure created when on-chain logic depends on off-chain data quality. This module contains it by design: permissioned submissions, validation before storage, and a governable dependency surface.

Settlement for fiat-referenced pricing, market participants anchoring bid strategies, and supply mechanics referencing market conditions. See the x/settlement module.