BETA — mainnet live (chain 482120); features are still being finished. Transparency →
Bitcoin Swap BETA Chain 482120
Developers · Concepts

Price oracle

How BTC/USD and the prices of the 200 tracker tokens (crypto and US stocks) are sourced, written and protected.

Concepts › Price oracle

BTC/USD — BtcwPriceFeed

Contract 0x6E0687A5D5a5b98CC5fb05c4d8d742fBD75ba96c, Chainlink AggregatorV3Interface-compatible, 8 decimals.

BtcwPriceFeed provides the BTC/USD price. BTCw price = this price × OracleAMM's peg ratio ratioWad (currently 1).

200 price-tracker tokens — PriceHub

Contract 0xE87FDdCC0b668564a20B23F3bE1EE108C805ecb4, 18 decimals. Each token's price is the median across multiple sources (at least 3, discarding any source more than 2% from the median) — if one source goes down, others remain. Each class has its own source set:

The feeder only prices tokens on each class's list — unknown tokens in the factory are skipped, never guessed from their symbol. It writes when the price deviates by at least 0.1%, or at most every 120 seconds. There is also a per-write jump guard; a blocked write emits a Rejected event instead of reverting the whole batch.

function latestRoundData(address asset) view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
function prices(address[] assets) view returns (int256[] answers, uint256[] updatedAts)

Full signatures: Contract reference.

Staleness and when to stop

OracleAMM and OracleRebalancer stop trading when the price is older than 300 seconds. Your application should do the same:

If the feeder stops (server failure, all sources failing at once), the price freezes — nothing on-chain updates it automatically.

Oracle risks