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

# Perpetual futures

A perpetual future ("perp") is a contract that lets you take a leveraged long or short position on an asset without ever expiring. Unlike traditional futures, there is no settlement date; instead, periodic **funding payments** flow between longs and shorts to keep the contract price anchored to spot.

On AgentDex, every perp is **non-deliverable** and **USDT-quoted**. You never receive the underlying — PnL is settled in USDT against the contract price.

### Contract specification

Each instrument has a fixed specification, returned by `get_instruments` and `get_instrument`:

| Field              | Meaning                                                            |
| ------------------ | ------------------------------------------------------------------ |
| `instrument_id`    | Stable identifier, e.g. `BTC_USDT_PERPETUAL`                       |
| `default_leverage` | Leverage applied if you don't override (currently 5×)              |
| `maximum_leverage` | Hard cap per instrument (20× for BTC/ETH, up to 50× for some alts) |
| `contract_size`    | The base-asset quantity represented by one contract                |
| `price_step`       | Minimum price increment (tick)                                     |
| `min_order_size`   | Minimum notional you can place                                     |

You'll see USDT amounts everywhere unless you explicitly use the `*-by-base-currency` REST endpoints, which size orders in the base asset (BTC, ETH, etc.).

### Position lifecycle

A position is created the moment a buy or sell order fills, sized in contracts but reported in USDT notional. Opening, increasing, and reducing all flow through the same order interface:

* **Open** — first fill in a direction. PnL starts at zero.
* **Increase** — same-side fill on an existing position. Entry price is updated as a weighted average.
* **Reduce** — opposite-side fill below current size. Realised PnL is booked from the closed portion.
* **Flip** — opposite-side fill larger than current size. Position closes, then opens in the new direction; both legs are realised.
* **Close** — opposite-side fill exactly equal to current size. Realised PnL is booked, position disappears.

You can mark an order **reduce-only** so it cannot grow the position; useful for safe automation and hedging.

### Long vs. short

| Direction | Profit when                       | Loss when                         |
| --------- | --------------------------------- | --------------------------------- |
| **Long**  | Mark price rises above your entry | Mark price falls below your entry |
| **Short** | Mark price falls below your entry | Mark price rises above your entry |

Unrealised PnL is marked against the **mark price** ([Mark price](/agentdex-docs/trading/mark-price.md)), not the last trade. This is what triggers margin calls and liquidations, so it matters even when the last-traded price stays still.

### Where to go next

The rest of this section explains the mechanics that govern your position:

* [Order types](/agentdex-docs/trading/order-types.md) — how to place, modify, and cancel orders.
* [Margin and leverage](/agentdex-docs/trading/margin-and-leverage.md) — how collateral backs a position.
* [Funding](/agentdex-docs/trading/funding.md) — the periodic cashflow that keeps the contract anchored.
* [Mark price](/agentdex-docs/trading/mark-price.md) — the canonical price reference and why it's not the last trade.
* [Liquidations](/agentdex-docs/trading/liquidations.md) — when the protocol closes your position for you.
* [Fees](/agentdex-docs/trading/fees.md) — maker, taker, and what funding is *not*.


---

# 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://agentdex.gitbook.io/agentdex-docs/trading/perpetual-futures.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.
