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

# Funding

A perpetual has no expiry, so **funding** is the mechanism that keeps its price tethered to the underlying spot (index) price. It is a payment exchanged **directly between traders**. The protocol takes no cut.

## Which way it flows

![Funding direction: longs pay shorts when the perp trades above index, shorts pay longs when below](https://1949530945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDKUIMv3mUd02iALaez0P%2Fuploads%2Fgit-blob-86fbefa48bbabddfbe240951595a0221685e45c5%2Ffunding-direction.png?alt=media)

Funding direction depends on whether the perpetual is trading above or below the index price:

| Market condition           | Who pays             | Why                                                 |
| -------------------------- | -------------------- | --------------------------------------------------- |
| Perp price **above** index | **Longs pay shorts** | Long demand is high, so holding a long costs more   |
| Perp price **below** index | **Shorts pay longs** | Short demand is high, so holding a short costs more |

So funding is not always a cost: the side leaning *against* the crowd tends to **receive** it. If you hold no position, funding does not affect you.

## When it settles

Funding does **not** debit or credit your position margin on a fixed hourly schedule. It accrues to your position and is banked into your margin only when the position's size changes or you change leverage:

* **The market's funding accrues every hour.** Each hour the funding rate advances a market-wide funding index; your position accrues funding against it in proportion to its **size** and **side**.
* **In between, it is unrealized funding.** The accrued-but-not-yet-banked amount is your **unrealized funding**. Like unrealized PnL it is **part of your equity**, so it moves you toward or away from liquidation continuously (see [Liquidation](/elysia-perps/mechanics/liquidation.md)).
* **It is realized into your margin when the position's size changes**: when you increase, decrease, or close it. The accrued amount is then added to or subtracted from your margin and the accrual resets.
* Funding is commonly **quoted on an 8-hour basis** by convention; on Elysia Perps the quoted rate is converted to the hourly amount that is actually applied.

So a position you never touch banks nothing into its margin, yet its **unrealized funding still drifts its equity** the whole time: positive when funding is in your favor (you receive it), negative when it is against you (you pay). This is the drift noted in [Positions](/elysia-perps/trading/positions.md).

## How the rate is set

The rate has two parts:

* **Premium**: how far the perpetual is trading from the index, measured against realistic fill prices (order-book depth), sampled **once a minute** and averaged over the hour.
* **Interest rate**: a small baseline component.

The combined rate is **clamped** to a capped range so a single volatile moment cannot produce an extreme funding charge. The detailed formula lives in the protocol's funding policy and is not needed for everyday trading.

> The settlement interval, quote convention, and clamp range are platform-wide settings today; the interest-rate baseline is set per market. On Elysia Perps, funding settles hourly. As with every parameter, the module's direction is for a market to configure these itself.

## Where to go next

* How funding interacts with position margin: [Positions](/elysia-perps/trading/positions.md).
* The price funding is measured against: [Mark & Oracle Price](/elysia-perps/mechanics/mark-and-oracle.md).


---

# 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://elysia.gitbook.io/elysia-perps/mechanics/funding.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.
