> For the complete documentation index, see [llms.txt](https://docs.nexus.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexus.xyz/trading/trading/perpetuals.md).

# Perpetuals

Perpetual futures on the Exchange: no expiry, tethered by funding, cross-margined in USDX.

Perpetual futures are the first market type on the Nexus Exchange and are **live on testnet**. The set changes as markets are listed and delisted, so `GET /markets` is the authority, not a count on this page. A perpetual is a leveraged long or short position with no expiry; it tracks an underlying index price through a periodic funding payment between longs and shorts.

Perpetuals are implemented natively in the exchange engine. Matching, margin checks, funding and liquidation all run inside the engine and settle deterministically, not through a smart contract.

### Market structure

* **Live markets are all quoted and collateralized in synthetic USDX.** `GET /markets` lists the current set, which is three crypto perpetuals today.
* Classes that follow as the set expands: equity indices, then pre-IPO perpetuals. See the [Asset directory](/asset-directory/asset-directory.md).
* Each market has its own contract specification: tick size, minimum/maximum order size, initial and maintenance margin rates, funding interval, and open-interest cap. See [Market Specifications](/trading/trading/perpetuals/market-specifications.md) for the full table.

### How a position works

1. **Fund collateral.** Deposit (or, on testnet, faucet) synthetic USDX into your account. Collateral is shared across all positions (cross-margin).
2. **Open a position.** Submit a buy (long) or sell (short) order via the API. The engine checks initial margin atomically before accepting the order. See Margining.
3. **Hold.** Your position accrues unrealized PnL as the mark price moves and pays or receives funding each interval.
4. **Close or get liquidated.** Close by submitting an opposing order. If your account equity falls below maintenance margin, the position is liquidated.

### Pricing

Each market has a **mark price** derived from an external index feed, used for margin and liquidation. Mark price is largely independent of the last trade price on the book, which prevents thin-book trades from triggering unfair liquidations. See Price Oracles.

**Funding is priced differently.** It measures the gap between the index and the **perp reference price**, which is the price the contract trades at on our book. Using the mark there would understate the real deviation, because the mark is mostly the index by construction. See Funding Rates.

### Leverage and margin

Margin is whole-account (cross): your entire USDX balance backs all open positions. Each market sets its own initial and maintenance margin rates, listed in [Market Specifications](/trading/trading/perpetuals/market-specifications.md). See Margining for how initial and maintenance margin are calculated.

### Sub-pages

* Margining
* Order types
* Positions
* Funding rates
* Liquidations
* Price oracles


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.nexus.xyz/trading/trading/perpetuals.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
