# Funding Payments

Funding Payments is a mechanism used in perpetual futures to keep the market close to the index price. Payments are made between traders depending on whether they hold long or short positions.

When the Funding Rate is positive (i.e., when the Mark Price is higher than the Index Price), traders who hold long positions have to pay those who have short positions.

Similarly, when the Funding Rate is negative (i.e., when the Mark Price is lower than the Index Price), traders who hold short positions have to pay those who have long positions.

Funding for Ariable works in hour manner, meaning that it happens once per hours, 24 times per day. It means that Funding occurs only for that traders that have position during that time.&#x20;

### Funding Payment Calculation <a href="#funding-payment-calculation" id="funding-payment-calculation"></a>

At the start of each hour, an account will receive USDC or ETH (if `F` is positive) or pays USDC / ETH (if `F` is negative) in an amount equal to:

```
F = (-1) × S × P × R
```

Where:

* `S` is the size of the position (positive if long, negative if short)
* `P` is the oracle price for the market
* `R` is the funding rate (as a 1-hour rate)

### Funding Rate Calculation <a href="#funding-rate-calculation" id="funding-rate-calculation"></a>

The main component of the funding rate is a premium that takes into account market activity for the perpetual. It is calculated for each market every minute (at a random point within the minute) using the following formula:

```
Premium = (Max(0, Impact Bid Price - Index Price) - Max(0, Index Price - Impact Ask Price)) / Index Price
```

Where the impact bid and impact ask prices are defined as:

```
Impact Bid Price = Average execution price for a market sell of the impact notional value
Impact Ask Price = Average execution price for a market buy of the impact notional value
```

