Stork Documentation

Stork Methodologies and Best Practices

Stork publishers and data sources are chosen for their demonstrated ability to reliably provide low latency price updates. The methodologies are chosen to enable Stork clients to achieve specific results, and will evolve over time.

Index Price

Each publisher is able to contribute an index price for the markets supported by Stork; currently, the implementation of the index calculation is at each publisher’s individual discretion, ergo not every publisher will converge to the exact same price.

General Methodology

Aggregation of real-time prices from select exchanges
  • Dexterity: Median of order book midpprices from supported exchanges
  • Other publishers: Median of last trade price from supported exchanges
Supported exchanges: Exchanges with major USD or BUSD markets, including: Binance, Coinbase Pro, Kraken
Support for USDT markets is under development using Binance spot USDT - BUSD to convert into USD denominated prices. USDT markets from the following exchanges are used: Binance, OKX, ByBit, KuKoin, and Bitfinex. A beta version of this publisher is available to Stork customers for testing purposes.

Perp (Mark) Index Price

The perp index price is a volume-weighted perp price across supported exchanges, converted from USDT to USD (technically USDC) using a volume-weighted average of USDC-USDT and BUSD-USDT spot markets.
  • Exchanges: Binance, ByBit, OKX
  • Markets: Markets quoted in USDT and converted to USD using volume-weighted spot price for USDC-USDT and BUSD-USDT markets
  • Volume: trailing four (4) hours trailing volume for each perp market
For any asset where Stork provides a mark price, it is calculated as follows:
MarkPricet=i=1nPerpPriceitWeightitUSDT/USDCtMark Price_{t} = \frac{\sum_{i=1}^{n} Perp Price_{it} \cdot Weight_{it}}{USDT/USDC_{t}}
  • PerpPrice(it): Price of asset on exchange i at time t
  • Weight(it): 4-hour trailing trade volume for perp on exchange i as of time t
USDT/USDCt=i=1ncitviti=invitUSDT/USDC_{t} = \frac{\sum_{i=1}^{n}c_{it} \cdot v_{it}}{\sum_{i=i}^{n}v_{it}}
  • c(it): the spot price for spot USDC/USDT market (or BUSD/USDT market on Binance) on exchange i at time t
  • v(it): 4-hour trailing volume for spot USDC/USDT market (or BUSD/USDT market on Binance) on exchange i
Note that unlike the index price, every Stork publisher follows the same calculation for the perp index price.

Using Stork in a Perpetual Exchange

Calculating Funding Rate

We recommend using the spot index price and your exchange’s contract price, to calculate the funding rate. If you elect to calculate the funding rate in discrete interval, we recommend using a time-weighted average.

Calculating Liquidations

We recommend using the mark price for liquidations, as it is meant to reflect the prevailing market price of the underlying contract.