# Perpetual Futures

## Overview

World's Perpetuals Market uses a **direct counterparty system** (no pools).

* A trader may be **long or short** on a pair, but not both.
* Opposite-direction trades reduce the existing position (partial or full), requiring settlement and adjustment, called a **True Up**.
* The market computes a **funding rate** every 8 hours.
* All orders must be an **integer multiple of the order size unit** (to avoid dust positions).

## Funding Rate

* The **funding rate** is exchanged every **8 hours** (00:00, 08:00, 16:00 UTC).
* Only positions still open at these times are charged/credited.
* The funding fee is:

$$
\text{Funding Fee} = \text{Notional Value} \times \text{Funding Rate}
$$

where:

$$
\text{Notional Value} = \text{Mark Price} \times \text{Position Size}
$$

* Positive rate → **longs pay shorts**
* Negative rate → **shorts pay longs**
* The exchange **does not charge additional fees** on funding transfers.

#### Formula & Rationale

Funding rates align perp prices with expected future prices.

* Predicted future price in 8 hours:

$$
\text{Predicted Future Price} = \text{Order Book Mid-Price} \times (1 + \text{Current Funding Rate})
$$

* Alternatively, a trader may pick a funding rate and compute:

$$
\text{Computed Mid-Price} = \text{Mark Price} + \text{Mark Price} \times (\text{Trade F. Rate} - \text{Current F. Rate})
$$

#### Funding Rate Calculation (World)

* Calculated from executed trades during an **8-hour window**, offset by 30 minutes:
  * **00:00 UTC** → trades from 15:30 – 23:30 UTC
  * **08:00 UTC** → trades from 23:30 – 07:30 UTC
  * **16:00 UTC** → trades from 07:30 – 15:30 UTC
* During the window, compute:

$$
\text{Total Adjusted Notional} = \sum \frac{\text{Trade Quantity} \times \text{Order Book Mid-Price}}{2 \times \text{Mark Price}}
$$

$$
\text{Total Quantity} = \sum \text{Trade Quantity}
$$

* New rate:

$$
\text{New Funding Rate} = \text{Current Funding Rate} + \Bigg(\frac{\text{Total Adjusted Notional}}{\text{Total Quantity}} - 0.5\Bigg)
$$

* **Clamp**: Change per period is limited to ±0.005%.

### True Up

A **True Up** adjusts positions in a financially neutral way for easier accounting.

1. You can see this button in the Actions menu in the Positions tab.
2. Reset position start time to **now**.
3. Adjust trade price to the **new trade price** (for fills) or **mark price** (for manual true up).
4. Immediately settle any financial difference.

* If the owing side lacks base currency, a **24h interest-free loan** is created.
* Unpaid loans after 24h → account becomes **liquidation-eligible**.
* Either counterparty may trigger a true up anytime.

**Example**

* Position: long 2 ETH at $3000 vs short at 07:45.
* At 10:00, mark price = $3010, funding rate = 0.01%.
* Settlements:

Price move:

$$
2 \times (3010 - 3000) = 20
$$

Funding:

$$
2 \times 0.0001 \times 3010 = 0.602
$$

Net:

$$
20 - 0.602 = 19.398
$$

So the short pays the long **$19.398**.

## Contract Settlement

Settlement occurs when a trader trades **opposite their current position**.

* WCM uses **LIFO (Last In, First Out)** settlement rules.
* Positions touched in settlement are first **Trued-Up**, then adjusted.
* Positions with same **start time and price** can be summed.

**Example 1**

Initial:

| Long | Short | Qty |
| ---- | ----- | --- |
| Fred | Wilma | 2   |

Fred shorts 7 ETH vs Barney.

Result:

| Long   | Short | Qty |
| ------ | ----- | --- |
| Barney | Wilma | 2   |
| Barney | Fred  | 5   |

**Example 2**

Initial:

| Long   | Short | Qty |
| ------ | ----- | --- |
| Fred   | Wilma | 11  |
| Barney | Wilma | 3   |

Barney goes long 7.5 ETH → matched: 5 vs Fred, 2.5 vs Wilma.

Result:

| Long   | Short | Qty  |
| ------ | ----- | ---- |
| Fred   | Wilma | 6    |
| Barney | Wilma | 10.5 |

***

### Fees

* **Charged on notional value** at trade execution.
* **In base currency** (not quote).
* Applied pro rata at trade price.
* Fees are **lower than spot markets** (because perps are leveraged).

**Example**

* ETH/USD perps fee schedule:
  * Maker: 0.005%
  * Taker: 0.01%
  * Fee cap: $2

Trade: 10 ETH @ $3000 (notional = $30,000).

* Buyer fee =

$$
\min(2, 30000 \times 0.00005) = 1.5
$$

* Seller fee =

$$
\min(2, 30000 \times 0.0001) = 2
$$

## Capital Requirements

### Takers

* Must cover **fees immediately**.
* Portfolio must remain **positive in risk-based valuation**.
* Example: If token risk parameter = 10%:

$$
\text{Required Collateral} = \text{Quantity} \times \text{Price} \times 0.1
$$

* Collateral can be cross-asset, but **base currency is recommended** to handle True Ups.

### Makers

* Must have:
  * **Fees in base currency**.
  * Extra collateral if trade price < mark price:

$$
\text{Required Collateral} = \text{Quantity} \times (\text{Mark Price} - \text{Trade Price})
$$

* If unavailable, order is canceled at match attempt.

### Maintenance & Requirements

* After a position is established, the trader must maintain **positive portfolio valuation**.
* Simplified rule of thumb:

$$
\text{Required Collateral} \approx \text{Risk Parameter} \times \text{Quantity} \times \text{Price}
$$

* For 10% risk parameter → keep \~10% of notional on hand.
* P\&L accrues with price movement and must be factored in.

***


---

# Agent Instructions: 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:

```
GET https://docs.world.inc/details/perpetual-futures.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
