> For the complete documentation index, see [llms.txt](https://learn.trovemarkets.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.trovemarkets.com/oracle/funding-rates.md).

# Funding rates

### Funding calculation

The oracle price helps calculate funding rates (payments between long and short traders). To help balance liquidity and maintain mark to oracle price.

{% hint style="info" %}
Funding = [rate calculation](/misc/appendix.md#key-formulas), paid every 8 hours
{% endhint %}

***

### Rate calculation

Funding Rate = Average Premium Index (P) + clamp (interest rate - Premium Index (P), -0.0005, 0.0005)

$$
Funding=P+clamp(I−P,−0.0005,+0.0005)
$$

[Standard](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/funding) by HyperLiquid

### How It Works

* If **Mark > Oracle**, longs pay shorts.
* If **Mark < Oracle**, shorts pay longs.
* Payments occur periodically (e.g., every 8 hours), calculated using the volume-weighted TWAP of the mark–oracle difference.

#### Safeguards

* Excludes tail-window samples and self-trades.
* Attenuates or pauses funding in shallow-liquidity periods.
* TWAP averaging prevents price “gaming” near funding windows.

#### Example

```
External Index = 200
Internal Mark EMA = 250
Oracle = (200 × 0.6) + (250 × 0.4) = 220
```

If mark trades at 230 → mark > oracle → longs pay shorts → shorts enter to earn funding → price normalizes.


---

# 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://learn.trovemarkets.com/oracle/funding-rates.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.
