> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ocx.global/llms.txt
> Use this file to discover all available pages before exploring further.

# Perpetuals

> Index price, mark price, and the funding mechanism

A perpetual ("perp") is a futures-style contract with no expiry. Because it
never settles, OCX uses two distinct prices to keep it tethered to the real
market — the **index price** and the **mark price** — plus a periodic **funding**
mechanism that economically links the perp to its underlying.

## Index price

The **index price** is OCX's estimate of the perpetual's fair underlying value.
Rather than reading a single spot quote, OCX derives the index from the **CME
futures curve** for the underlying. In practice this means the index tracks the
**front-month** futures contract, and as that contract approaches expiry OCX
gradually rolls the index toward the next contract. The roll is smoothed over a
window so the index transitions continuously from one contract to the next
instead of jumping on a single day.

The index is the "honest" number: it comes only from external exchange data and
never from OCX's own order book, so it cannot be manipulated by activity on OCX
itself.

## Mark price

The **mark price** is the price OCX uses to value open positions, compute
unrealized PnL, and trigger liquidations. It is anchored to the index price but
is allowed to follow OCX's own order-book mid **when the book is healthy and the
mid sits close to the index**. If the OCX book is thin, one-sided, or has drifted
away from fair value, the mark stays on the index. This design keeps the mark
responsive to genuine OCX price discovery while preventing a sparse or
manipulated local book from dragging position values away from reality.

Because the mark is a smoothed value rather than the raw last trade, it
protects traders from liquidations caused by momentary wicks or single prints.

## Funding

Funding is the mechanism that keeps a perpetual's price aligned with its
underlying index over time. It is a **periodic cash flow exchanged directly
between long and short position holders** — OCX does not take a side.

<AccordionGroup>
  <Accordion title="What it is">
    At each funding interval, the funding rate is applied to the notional value
    of every open position. Depending on the sign of the rate, longs pay shorts
    or shorts pay longs.
  </Accordion>

  <Accordion title="Direction">
    When the perp trades at a **premium** to the index (mark above index), the
    rate is positive and **longs pay shorts**, which incentivizes selling and
    pushes the perp back down toward the index. When the perp trades at a
    **discount** (mark below index), the rate is negative and **shorts pay
    longs**, pushing it back up. A small interest component reflects the cost of
    carry.
  </Accordion>

  <Accordion title="Periodic">
    Funding accrues and settles on a fixed schedule (a recurring interval), not
    continuously. Only positions open at a funding timestamp participate in that
    period's exchange.
  </Accordion>

  <Accordion title="Capped">
    The rate is **clamped to a maximum magnitude** in each direction, so a
    temporary dislocation between mark and index can never produce an unbounded
    funding payment.
  </Accordion>
</AccordionGroup>

Conceptually, the funding rate moves with the premium of the perp over its
index, plus an interest term:

$$
\text{funding rate} \;\propto\; \frac{\text{mark} - \text{index}}{\text{index}} \;+\; \text{interest}
$$

The current per-market mark price, index price, and funding rate are published
through `GET /perps/market-stats`, so you can always see the live inputs.
