Information on BSX's oracle provider and price feeds

Oracle Provider

A core component of a perpetuals exchange is the oracle which provides the external price feeds that power the funding rate and liquidation process. When evaluating which Oracle to use, BSX wanted to make sure that the Oracle was performant enough to keep up with trader needs on BSX while also being cost-efficient.

BSX leverages Stork, which is an ultra-low-latency, decentralized, hybrid oracle network. At the core of its design is an emphasis on high performance. Stork ensures the availability of reference prices at millisecond precision, paralleling the speed found in centralized exchanges (CEXs) and traditional financial (TradFi) exchange venues.

The innovative hybrid on/off-chain architecture of Stork enables initial off-chain processing, followed by relevant on-chain price updates for BSX. This approach is vital for maintaining a high-performing decentralized exchange (DEX), setting it apart from purely on-chain oracle providers that offer less frequent price updates. In scenarios where pure on-chain oracles are used, the less frequent price updates can hinder the support of long-tail assets, especially when the associated gas fees outweigh the on-chain demand for these assets. Moreover, in times of significant market volatility, these pure on-chain models are less effective compared to the more adaptable hybrid on/off-chain models of Stork.

BSX benefits from Stork's system, achieving robust, cost-effective, and high-performance reference prices, while minimizing the risk of pricing vulnerabilities across a diverse range of assets.

Stork carefully selects its publishers and data sources for their proven reliability in delivering low-latency price updates. The chosen methodologies are tailored to enable Stork clients to achieve targeted outcomes and are subject to continuous evolution. Each publisher within Stork's network contributes both index and mark prices for the markets they support, adhering to established calculations for both index and mark prices.

For a more detailed understanding of Stork's oracle architecture, please refer to their documentation here -

BSX leverages two price feeds from Stork:

Mark Perp Index Price

The mark perp index price is the median perp price across Binance, OKx and ByBit. The price is normalized using a median of the USDT-USD spot price across (Coinbase, Kraken, BinanceUS). Please refer to the formula below to understand how the price is calculated:

MarkPrice=median(PerpPrice1,PerpPrice2,...,PerpPricen)median(USDT/USD1,USDT/USD2,...,USDT/USDTn)MarkPrice = \frac{median(PerpPrice_1, PerpPrice_2,...,PerpPrice_n)}{median(USDT/USD_1,USDT/USD_2,...,USDT/USDT_n)}

The mark perp index price is used for the following:

  • Calculating estimated PnL

  • Calculating when a users position is liquidated

Using this price to calculate the liquidation threshold allows for removing what are commonly known as “scam wicks.” Unnecessary liquidations often occur on other exchanges due to liquidations occurring on the index price - using the mark perp index price prevents instances of severe volatility from causing unnecessary liquidations.

Index Price

The index price is the median of the last trade price from spot markets on the following exchanges:

  • Binance

  • Coinbase Pro

  • Kraken

  • OKx

The index price is used when calculating the funding rate.

Last updated