The Oracle
Some parts of the protocol need information that does not live on Bitcoin, most importantly prices. For example, FIRE bond pricing needs a reference price to work, and TUNDRA lending needs to know what collateral is worth. SUBFROST provides this through a decentralized oracle.
How it works
Rather than trusting a single server to report a value, the oracle runs as a small distributed group. Each participant independently reads the relevant external source and the current chain state, and the group must reach agreement before a value is committed on-chain. A single participant cannot dictate the result on its own.
Because the value is agreed by a threshold of the group and posted on-chain, contracts that depend on it (such as the FIRE bond mechanism) can read a price that is resistant to any one party manipulating it.
Where it is used
- FIRE bonds. The bond price is anchored to an oracle-reported reference, with a floor tied to the protocol treasury, so bonds cannot be sold below the value backing them.
- TUNDRA lending. Every TUNDRA market prices its collateral through the oracle. It decides how much can be borrowed and when a position can be liquidated. See below.
- Perpetual futures (unreleased). Details will be released when ready.
The oracle behind TUNDRA lending
TUNDRA reads its prices from TUNDRACLE (4:9010), a price layer that subscribes to DOOMACLE (4:9000).
- Who writes. Prices are written to DOOMACLE by a 6-of-9 FROST signing group at
bc1pp9xj9ww24x5wenae96dpj3jtxnvrwehn4gqtam7xfc0dfwcmn2rqnms0du. Six of the nine signers must sign the same transaction before a price lands. Its write history is public on the explorer. - What it measures. Prices are read from on-chain AMM pools on Bitcoin rather than from an exchange API, so every signer computes the same number from the same chain state. BTC comes from the frBTC / frUSD pool, DIESEL from the DIESEL / frBTC pool, frBTC equals BTC, and frUSD is fixed at $1.
- How it smooths. Each price is the median of 12 samples taken 12 blocks apart, about one day. Moving a pool for a single block cannot move the median.
- Freshness. TUNDRACLE marks a price stale when it has not been updated for 144 blocks. TUNDRA refuses to open borrows or liquidate while its price is stale, and keeps supply, withdraw, repay, add collateral and close working, so a market can always be wound down.
- What it cannot do. The signing group can write prices. It cannot move anyone's funds, change a TUNDRA market's rules, or point TUNDRA at a different oracle: each market's oracle is fixed when the market is created.
The FIRE bond oracle is a separate oracle contract with its own signing group.
For the details, see the oracle section of the TUNDRA protocol page and the TUNDRA contract reference.
Where to go next
- FIRE Vault: where the oracle price is used for bonds.
- Lending (TUNDRA): where the oracle price is used for collateral.
- What is SUBFROST: the big picture.