> For the complete documentation index, see [llms.txt](https://docs.fluvion.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fluvion.io/perpetual-futures-mechanics/pricing-system.md).

# Pricing: Index, Mark & Last

To ensure fair execution, eliminate price manipulation, and protect traders from flash-wick liquidations, Fluvion employs a **3-Price Architecture**:

1. **Index Price**: The true spot market price aggregated across major global exchanges.
2. **Mark Price**: The smoothed fair-value price used for calculating unrealized PnL and evaluating liquidations.
3. **Last Price**: The most recent execution price on the Fluvion orderbook.

***

## 1. The Three Prices Compared

| Price Type      | Definition                                         | Primary Purpose                                          |           Susceptible to Manipulation?          |
| --------------- | -------------------------------------------------- | -------------------------------------------------------- | :---------------------------------------------: |
| **Index Price** | Volume-weighted spot price across tier-1 exchanges | Benchmark for fair market value and funding calculations |    **No** (Multi-exchange median safeguards)    |
| **Mark Price**  | Index Price combined with a moving average basis   | **Used for all margin and liquidation calculations**     | **No** (Resistant to single-venue manipulation) |
| **Last Price**  | Most recent fill on the local orderbook            | Reference for current order matching and tape display    |         Local orderbook depth dependent         |

> \[!IMPORTANT] **Liquidations on Fluvion are NEVER triggered by the Last Price.** Liquidations are evaluated strictly against the **Mark Price**. Even if a localized spike or large order sweeps the local orderbook, your position will not be liquidated unless the broader global spot market (Mark Price) moves through your liquidation threshold.

***

## 2. Index Price Calculation & Safeguards

The **Index Price** represents the volume-weighted average price (VWAP) of the underlying spot asset across leading global exchanges (e.g., Binance, OKX, Bybit, Coinbase).

### Outlier & Manipulation Filters

To prevent bad data, exchange API outages, or localized price manipulation from skewing the index, the oracle applies three layers of protection:

1. **±5% Deviation Band**:
   * If any single exchange's spot price deviates by more than **5%** from the median of all sources, that source is automatically capped or floored at **Median ± 5%**.
2. **Median Fallback**:
   * If multiple exchange sources exhibit significant divergence (exceeding 5%), the algorithm switches automatically from a volume-weighted average to the **Median Price** of all sources.
3. **Stale Source Exclusion**:
   * If an exchange stops sending updates or its feed experiences latency greater than **10 seconds**, it is dropped from the calculation until connectivity recovers.

### Exchange Weights

Source exchange weights are dynamically updated every 5 minutes based on their rolling 4-hour spot trading volume:

```
Weight_i = Volume_i / Total Volume across all sources
```

***

## 3. Mark Price Calculation

The **Mark Price** is calculated using the Index Price plus a decaying basis (the difference between the perpetual futures price and the spot index price), smoothed via an Exponential Moving Average (EMA):

```
Basis = Perp Fair Price - Index Price
Mark Price = Index Price + EMA(Basis)
```

### Why the Mark Price Matters:

* **Protects against predatory wicks**: Market manipulators cannot trigger cascading liquidations by dumping low-liquidity books.
* **Fair Unrealized PnL**: Prevents artificial swings in your account equity during brief spread widening.
* **Accurate Margin Evaluation**: Ensures system margin requirements reflect genuine global market conditions.

***

## 4. Last Traded Price

The **Last Traded Price** is simply the execution price of the most recent matched order on the Fluvion orderbook. It is reflected on the main chart candles and the recent trades feed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fluvion.io/perpetual-futures-mechanics/pricing-system.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
