# Perpetual Funding System

Unlike dated futures, perps don’t have an expiry. In place of that, users are charged a funding rate based on their position and the orderbook on Zeta.

### How does Zeta calculate funding rates?

Over 24 hours, longs pay shorts based on the following formula:

$$
fundingRate = \frac{impactMidpoint}{oracle} - 1
$$

$$
payment = fundingRate \* oracle\*positionSize
$$

$$impactMidpoint$$ is the midpoint of the orderbook given $1000 worth of quotes on both the bid and ask side.

For example, let’s say you are long 100 lots of SOL-PERP and hold it for 24 hours. Over that time, the orderbook midpoint is $11.76 and the SOL oracle price is $12 (in reality these will fluctuate).

$$
fundingRate = \frac{11.76}{12} - 1 = -2%\ per\ day
$$

$$
payment = -2% \* 12 \* 100 = $24
$$

**A negative funding rate means that shorts pay longs.** Therefore your long position will be paid $24 per day as funding is negative.

### How is funding paid on Zeta?

Funding rates on Zeta are calculated on Zeta approximately every 10 seconds.

Rather than applying funding on a set timer, we apply it to your balance on any balance-sensitive operation (placeOrder, withdraw, liquidate, etc.), as well as every couple of minutes using our cranks.&#x20;

{% hint style="info" %}
At any point you can apply any unpaid funding to your account with our SDK's `utils.applyPerpFunding()` function.
{% endhint %}


---

# 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.zeta.markets/zeta-protocol/exchange-architecture/perpetual-funding-system.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.
