Skip to content
Paxeer X

Oracles and web data

Prices and web answers, signed by many

Contracts, programs and markets get validator-signed prices and attestor-signed web answers, final once the block is committed.

Prices / Web answers

The gap

A contract sees only what is on the chain

This system gives it two things it needs: trustworthy market prices, and verified answers from the web.

A dim equipment room aisle with server racks and a wall-mounted status panel.

Prices from validators

Prices come from the validators that already secure the network. A feed sidecar beside each validator signs quotes, and the node combines them after each block into one index price and one mark price per market.

Answers from attestors

Web answers come from a registered set of attestors. Each fetches the content independently and signs what it saw, so the chain can show who vouched for the result.

  • 18markets in the default table
  • 1 sfeed cadence in the shipped template
  • 188 bytesthe signed web record

Two tracks

Many sign, one result stands

Switch tracks to see how independent signers become one price or one answer. Both paths share one attestor set and one precompile address.

VALIDATOR 1VALIDATOR 2VALIDATOR 3VALIDATOR 4VALIDATOR 5MEDIANQUORUM
Sample
  • Every price is a median across bonded validators.
  • A source that diverges from the median by more than 50 basis points by default is dropped.
  • A market updates only when agreeing sources hold more than two thirds of bonded power.

Prices that no one controls

A single bad or late feed cannot move the price. The median is taken over fresh observations at the end of each block, and the market only moves when quorum and minimum source count are met.

PAGEATTESTOR 1ATTESTOR 2ATTESTOR 3RESULT
Sample
  • Attestors fetch independently, then sign a fixed 188-byte record.
  • A majority of the registered set must sign before anyone can submit the result.
  • A request can name one trusted attestor instead of a majority, and that choice is signed in.

At block end

Update, or keep the last price

After each block's transactions, the node checks the fresh observations. Either quorum holds and the market moves, or it does not and the last price stays.

Quorum holds

Quorum
PricePrice updated

Quorum short

Quorum
PriceLast price keptSkipped

Mark price inside a clamp

INDEXMARKCLAMP

Sample

  1. 01

    Combine the fresh observations of bonded validators.

  2. 02

    Find the median and drop sources that diverge too far.

  3. 03

    Update if quorum and source count hold; otherwise keep the last price and record a skipped event.

Mark price follows, gently

Perpetual markets need a mark price that tracks the index without jumping. The module smooths the gap as a moving average, then clamps it to a band. Defaults are 150 seconds and 500 basis points, set by governance.

The call

Read prices, request answers

Prices come from a native precompile at a fixed system address. Web data comes from the xweb precompile, for contracts and programs alike.

  • 64markets accepted in one call
  • 15 sdefault maximum price age
  • 4,096bytes stored with each result
Line drawing of data streams flowing into a small module, one blue square at the entry.

Prices in one call

Read index price, mark price, age and source count from the pricefeed precompile, with no oracle contract to deploy or trust. One call accepts up to 64 markets. A price is fresh only if its market is enabled and it is within 15 seconds by default.

Request a web answer

Call xweb with a request kind, a payload and a callback gas limit, and pay the fee. Ask for a fetched page, a search result, an API response or a storage receipt. The result and its callback arrive after fulfilment.

Proof stays attached

Each result stores up to 4,096 bytes with its content digest and full length, plus the signers. A callback that reverts is recorded but does not undo the fulfilment.

A fee that cannot stick

If no answer arrives before the timeout, the requester can take the fee back, exactly once. Signers are paid when a fulfilment lands.

Connections

One attestor set serves both

Bonded validators supply prices. Governance sets price parameters, the market list and the xweb attestor set.

  • Markets engine

    Spot and perps modules read prices and freshness straight from chain state.

  • Programs runtime

    LayerX programs emit a web request, a fulfilment of 1 to 16 signatures is checked against it, and the program reads the answer with a result query. Fetch and search are supported.

  • Perps trading app

    The app relies on the index and mark prices produced here.

  • Validator operators

    Run one Rust sidecar with health and readiness endpoints, a crash-recovery journal, and protected credentials.

  • Legacy oracle voting module

    It still exists, but its EVM precompile is retired and reverts with a message that oracle data queries are disabled. New contracts use the pricefeed precompile.

  • Read more

    Markets enginePrograms runtimePerps trading

Questions

What visitors ask first

Can one validator move a price?

No. Each price is a median across bonded validators, and a market updates only when agreeing sources hold more than two thirds of bonded power and meet the minimum source count.

What if validators do not agree?

The market keeps its last price and an event records that the update was skipped.

How do I know a price is fresh?

The precompile marks a price fresh only if its market is enabled and it is no older than the maximum price age, 15 seconds by default.

What if no web answer arrives?

After the timeout, the requester can take the fee back, exactly once.

Does a failing callback undo the answer?

No. A callback that reverts is recorded, but the fulfilment stands.

Can I still use the old oracle precompile?

No. It is retired and reverts with a message that oracle data queries are disabled. Use the pricefeed precompile.

Close view of a rack unit with a single small blue status light.