For the complete documentation index, see llms.txt. This page is also available as Markdown.

Fair Price Marking

Mark price is the fair price of a perpetual contract. Mark price is calculated using the liquidity in the perpetual market order book and the index price (spot price of the underlying market). At any point in time, mark price is defined as follows:

Impact Notional Amount=500 USDC/Initial Margin FractionImpact Bid Pricet=Avg execution price for a market sell of the impact notional valueImpact Ask Pricet=Avg execution price for a market buy of the impact notional valueImpact Pricet=(Impact Bid Pricet+Impact Ask Pricet)/2 price1t=indext+EMA⁡8 min(clamp(Impact Pricet−indext,−indext/200,+indext/200))whereclamp⁡(x,a,b)=max⁡(a,  min⁡(b,x))andEMA⁡8 minrefers to the Exponential Moving Average of the value over 8 minutes price2t=median(cexPricest)where cexPricest are mark prices from different centralized exchanges Mark Price=Median(Impact Pricet,price1t,price2t)\small \text{Impact Notional Amount} = 500 \text{ USDC} / \text{Initial Margin Fraction} \\ \text{Impact Bid Price}_t = \text{Avg execution price for a market sell of the impact notional value} \\ \text{Impact Ask Price}_t = \text{Avg execution price for a market buy of the impact notional value} \\ \text{Impact Price}_t = (\text{Impact Bid Price}_t + \text{Impact Ask Price}_t) / 2 \\ \\~\\ \text{price1}_t = index_t + \operatorname{EMA}_{8\ \mathrm{min}}( \text{clamp}( \text{Impact Price}_t - index_t, -index_t/200,+index_t/200 )) \\ \text{where} \operatorname{clamp}(x,a,b) = \max\bigl(a,\;\min(b,x)\bigr) \\ \text{and} \operatorname{EMA}_{8\ \mathrm{min}} \text{refers to the Exponential Moving Average of the value over 8 minutes} \\~\\ \text{price2}_t = median(\text{cexPrices}_t) \\ \text{where cexPrices}_t \text{ are mark prices from different centralized exchanges} \\~\\ \text{Mark Price} = Median(\text{Impact Price}_t, price1_t, price2_t)

Lighter uses a combination of oracles (Chainlink, Stork, Pyth) to determine the index price. Markets without a continuous external feed (RWAs outside trading hours, Pre-IPO and Prelaunch markets) also use the Internal Pricing Mechanism.

Note: because the mark price is used when deciding if liquidations should be happening, the mark price should reflect as much as possible the impact price, so that the execution of liquidations should happen close to mark price. Because of this, we chose to incorporate the impact price directly in the mark price formula. Price 1 can be summarised as Index Price + Lighter Perpetual Premium, where the premium is capped at 0.5% of the Index Price. The usage of the EMA makes it so if someone tries to manipulate the order book, they'd need to do so for a prolonged period of time. The ±0.5% cap applies to the premium component (price1) relative to the index price. In summary, the EMA component should yield better results than just using the funding rate due to the shorter time span, while also being resilient to manipulation.

Risk Checks

Index and mark prices for all markets (crypto, RWA and Pre-IPO) are validated by risk checks before they are pushed:

  • Other platforms: the price is compared against prices for the same asset on other trading platforms.

  • Leverage: the allowed price movement is bounded based on the market's maximum leverage.

If the price diverges significantly, the new price might not be pushed.

These checks are discretionary: their thresholds can be widened or tightened based on liquidity and market conditions.

Last updated

Was this helpful?