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