βš–οΈOracle

The role of a price oracle is to provide prices for futures trading pairs. The platform classifies currencies into CEX currencies and DEX currencies based on their liquidity. Below, we will describe the oracle implementation for these two types of currencies.

CEX Currencies

CEX currencies are those primarily with liquidity concentrated on centralized exchanges. We'll use BTC as an example to explain the price feed mechanism.

  1. Calculate the USDT/USD price:

The platform selects the USDT/USD prices from four exchanges (coinbase, kraken, bitfinex, crypto.com) and takes the median as the fair USDT/USD price.

  1. Calculate the BTC/USDT price:

The platform selects the BTC/USDT prices from five exchanges (binance, okx, coinbase, bitget, gate), calculates the median price, and then applies an outlier handling mechanism to data with a difference from the median exceeding 3% (prices greater than 1.03 times the median are calculated as 1.03 times, and prices less than 0.97 times the median are calculated as 0.97 times). Finally, the mean is calculated as the fair BTC/USDT price.

  1. Calculate the BTC/USD price:

The fair USDT/USD price and BTC/USDT price are multiplied to obtain the BTC/USD price.

We use Chainlink on-chain price feeds for oracle risk management. When the oracle price deviates by a certain threshold (adjusted based on different pairs and markets), it is rejected. This risk management measure effectively prevents the risk of abnormal oracle data.

DEX Currencies

DEX currencies are those primarily with liquidity concentrated on decentralized exchanges. We'll use UNIBOT as an example to explain the price feed mechanism.

  • Calculate the UNIBOT/USD price:

The platform selects the pool with the highest liquidity on Uniswap (e.g., UNIBOT/WETH v2 pool), retrieves the UNIBOT price, and converts it into USD price.

Last updated