Oracle
How the DomFi oracle computes dominance, publishes it on-chain, and protects trades from bad prices.
DomFi's oracle computes each pair's dominance from live exchange trades and verified supply data, and publishes a signed value on-chain that every trade, trigger and liquidation settles against.
DomFi has no order book. Each pair's price is the oracle price, and every execution starts from it. The price impact spread is applied on top.
Methodology
The oracle uses three inputs:
- Exchange trades and order books from 15 major exchanges, across about 3,500 spot markets quoted in USD, USDT or USDC.
- Stablecoin rates from direct USDT/USD and USDC/USD markets, so a price quoted in a stablecoin converts to dollars at that stablecoin's market rate, not at an assumed $1.
- Circulating supply from the blockchains and issuers themselves where they publish it, cross-checked against independent market-data providers.
Each asset's price is built from its latest trades on every exchange that lists it, combined into a volume-weighted median. No single exchange can dominate an asset's price, and an exchange whose price strays from the rest is left out. Each market cap is that price times a circulating supply cross-checked between independent sources. The pair's value is its asset's market cap divided by the total of the Top-200.
The result is the dominance value defined on Dominance.
Update Cadence
The oracle recomputes every pair continuously, many times a second.
Publishing
When you open or close a position, or remove collateral, the protocol requests a fresh price. The oracle answers with the first price it publishes after your request, and your action settles at that price. A transaction cannot choose its own price, which prevents frontrunning. The round trip takes about a second.
The oracle also publishes every 60 seconds, so the on-chain price stays current between trades.
The contract accepts a price only when it carries a valid signature from a registered signer. DomfiVerifier checks every signature on-chain.
Freshness and Staleness
Every value the oracle signs expires after a short validity window. An expired value is never published.
On-chain, market orders and collateral removals accept only a price published after the request, so they never settle at an older price. Limit orders, stop orders, take-profit, stop-loss and liquidations execute at a recent price published for the pair.
| Action | When no fresh price arrives |
|---|---|
| Market open or close | The order waits for the next published price. If none arrives within the order timeout (about 6 seconds), you can cancel it: a cancelled open returns your collateral, and a cancelled close leaves your position open. |
| Limit order, TP or SL trigger | The trigger executes only at a recent published price. If the price it was waiting for doesn't arrive, the trigger clears after its timeout (about 6 seconds) and the order stays in place. |
| Liquidation | Decided and executed at a recent published price, the same way as a trigger. |
| Remove collateral | The request waits for the next published price. If none arrives before the timeout, the request lapses and your collateral stays in the position. |
A price is rejected if it is not signed by a registered signer, belongs to another pair, is not the price the order is waiting for, or is older than the value already stored. The oracle also never signs a value outside 0–100% or one that fails the checks below. A rejected price is never used: the order keeps waiting for a valid one, and the timeouts above apply.
Safeguards
Sanity checks
| Check | Threshold | On breach |
|---|---|---|
| Exchange outliers | An exchange's price falls outside a band around the volume-weighted median, set by the asset's size | That exchange is left out of the asset's price |
| Exchange concentration | One exchange would carry too much of an asset's weight | Its weight is capped |
| Exchange coverage | Too few live exchanges for a pair's own asset | No fresh price; the pair is not published until enough exchanges return |
| Stale prices | A pair's own asset has no fresh price for more than a few seconds | The pair is not published |
| Stale index share | Too much of the index rests on stale prices | The pair is not published |
| Supply confirmation | An asset's supply sources disagree, or its figure jumps without confirmation | The last agreed figure is held; once it is too old, the pair is not published |
| Value range | Dominance outside 0–100% | The value is not signed or published |
| Signature | A price not signed by a registered signer | Rejected on-chain by DomfiVerifier |
Circuit breakers
- Automatic, per pair: a pair stops publishing the moment its value fails any check above, and resumes on its own with the next value that passes.
- Manual, protocol-wide: DomFi can pause new trades and resume them. Closing positions stays available while new trades are paused.
What Reads the Oracle
| Action | Reads the oracle? | Which price |
|---|---|---|
| Market open | Yes | The first price published after your order |
| Market close (full or partial) | Yes | The first price published after your order |
| Limit and stop order trigger | Yes | A recent published price decides that the target is crossed, and the order fills at that price with price impact applied |
| Take-profit and stop-loss trigger | Yes | A recent published price decides the trigger, and the position closes at that price with price impact applied |
| Liquidation | Yes | A recent published price decides that a position is liquidatable |
| Remove collateral | Yes | The first price published after your request |
| Update take-profit or stop-loss | No price request | The new level applies at once. It can trigger only on the price that was current when you set it, or a later one |
| Funding | No | Funding accrues from open interest over time, not from the price |
| Vault accounting (open PnL at each epoch boundary) | No | The vault samples its accumulated open PnL, which each trade updates at its own oracle price |
Adding collateral does not read the oracle. It executes immediately with no price lookup and no oracle fee. Updating a take-profit or stop-loss also executes immediately, without a price request, and charges the oracle fee.
Supported Pairs
The oracle publishes a price for every pair live in the app. The pair selector always lists them. Integrators can list them in code; see Oracle Feeds › Discovering Pairs.
Operation
DomFi operates the oracle and the infrastructure that publishes prices.
If the oracle stops, no new prices are published. Market orders and collateral removals wait for the next price, and you can cancel a market order after its timeout.