Astros
  • Astros - Dex Aggregator
    • šŸ™ŒIntroduction
    • šŸ’”Contact Page
    • āš’ļøAstros UI SDK
      • ⭐Getting Started
      • šŸ…°ļøAggregator Components
    • 🧰Aggregator SDK
    • āš™ļøAggregator API
    • Cross-Chain Swaps SDK
      • šŸš€Quick Start
      • 🪜Dive into
  • Astros - Perpetual
    • šŸ™ŒIntroduction
    • šŸ“šTutorial
      • Deposits and Withdrawals
      • Trading
    • šŸ“ˆPerpetual Trading
      • Funding
      • Margin
      • Index and Mark Price
      • Liquidation Process
      • Insurance Funds
      • ADL
      • Trading Fees
    • šŸ‘¬Referral
Powered by GitBook
On this page
  • Index Price
  • Mark Price
  • Unrealized Profit and Loss (PnL) Clarification
  1. Astros - Perpetual
  2. Perpetual Trading

Index and Mark Price

Index Price

The Index Price represents the real-time price of the underlying asset derived from aggregated spot market prices. Astros calculates this price every second by combining market data from multiple exchanges alongside the Pyth Network oracle.

Aggregation Sources:

  • Exchanges: Coinbase, Binance, OKX

  • Oracle Protocol: Pyth Network

Note: For BTC-denominated trading pairs, the price is converted to USD using the OKX BTC-USD index.

Index Price Validation and Adjustment:

To maintain price accuracy and stability, Astros applies two safeguards:

  • Exchange Data Validity: Prices from exchanges that have outdated trade data (no recent trades or insufficient trading volume within a predefined period) are excluded from calculations.

  • Price Deviation Adjustment: If an exchange's reported price deviates by more than ±3% from the median price of all exchanges, the outlier price is adjusted as follows:

\text{Adjusted Exchange Price} = \begin{cases} \text{Median Price} \times 1.03 & \text{(if Exchange Price > Median by 3%)} \[6pt] \text{Median Price} \times 0.97 & \text{(if Exchange Price < Median by 3%)} \end{cases}

Mark Price

Astros adopts a Mark Price mechanism (Fair Price Marking) to mitigate liquidation risk due to temporary market manipulation, volatility, or illiquidity.

Calculation Formula:

MarkĀ Price=IndexĀ Price+30-MinuteĀ MovingĀ AverageĀ (Premium)\text{Mark Price} = \text{Index Price} + \text{30-Minute Moving Average (Premium)}MarkĀ Price=IndexĀ Price+30-MinuteĀ MovingĀ AverageĀ (Premium)

Where the 30-Minute Moving Average (Premium) is computed as:

30-MinuteĀ MovingĀ Average=MovingĀ Average[(BidĀ Price+AskĀ Price)2āˆ’IndexĀ Price]\text{30-Minute Moving Average} = \text{Moving Average}\left[ \frac{(\text{Bid Price} + \text{Ask Price})}{2} - \text{Index Price} \right]30-MinuteĀ MovingĀ Average=MovingĀ Average[2(BidĀ Price+AskĀ Price)ā€‹āˆ’IndexĀ Price]

This moving average is continuously sampled every second over a rolling 30-minute window.


Unrealized Profit and Loss (PnL) Clarification

After executing a trade, traders may observe positive or negative unrealized profits and losses (PnL) caused by temporary differences between the executed trade price and the Mark Price.

  • Important: Unrealized PnL fluctuations do not represent actual realized gains or losses unless the position is closed or liquidated.

  • It is crucial to monitor your liquidation price closely to avoid unintended liquidation due to short-term price discrepancies.

PreviousMarginNextLiquidation Process

Last updated 1 month ago

šŸ“ˆ