# Funding

> The continuous payment that balances long and short exposure: formula, cap, direction and examples.

Source: https://docs.botradix.com/funding/

Funding is a small, continuous charge or credit on open positions that rewards the side that balances the market. It is calculated per second and quoted as a rate per 8 hours.

## How the rate is calculated

The rate depends on the imbalance between long (L) and short (S) open interest of the market:

```text
funding rate (per 8 h) = (L − S) / (L + S) × 0.03%
```

- The rate is capped at **0.03% per 8 hours** (3 basis points), reached only when all open interest is on one side. This 0.03% is the current operational policy, configured in the oracle reporters and the website; the contract does not impose it and it can be adjusted. The contract separately enforces its absolute limit of ±1% per 8 hours.
- A positive rate means **longs pay and shorts receive**; a negative rate, the reverse.
- Payments go to and come from the protocol's liquidity vault, which is the counterparty of the net exposure.
- There is no separate borrowing fee.

## Examples

| Situation | Rate per 8 h | 1,000 USDC long | 1,000 USDC short |
|---|---|---|---|
| L = 600,000, S = 400,000 | +0.006% | pays 0.06 USDC | receives 0.06 USDC |
| L = 400,000, S = 600,000 | −0.006% | receives 0.06 USDC | pays 0.06 USDC |
| Only longs | +0.03% (cap) | pays 0.30 USDC | — |

At the cap, a long held for 30 days pays about 0.03% × 3 × 30 = 2.7% of its size.

## When it is paid

Funding accrues continuously and is settled when the position is reduced or closed. It counts in your equity while the position is open, so it gradually moves the liquidation price.

## Freshness of the rate

The funding rate of each market is published by the oracle and is currently valid for 2 hours; the protocol republishes it regularly. To open or increase risk, the DEX requires a valid rate at most 2 hours old; if a market's rate expires, new positions there are blocked until a fresh rate is published. Accrued funding follows the source index when available; the contract's fallback only accrues the last rate over a 2-hour window. The contracts also enforce an absolute limit of ±1% per 8 hours. The validity period (between 15 minutes and 8 hours) and the absolute limit (between 0.01% and 1% per 8 hours) can be adjusted by the administrator within those bounds written in the code in force; each observation keeps the validity it was published with, and lowering limits does not rewrite funding already accrued.

If a market is settled because it received no prices (see [Exit without BotRadix](https://docs.botradix.com/exit/)), or during an emergency, freezing the market also fixes its funding index, and closes use that index.

## Where to see it

The terminal shows each market's current rate per 8 hours and the time to the next update. Your positions show the funding accumulated, and closed positions record the funding paid or received. Through the API, use `GET /markets/{pair_id}/funding` and the `funding.charged` / `funding.credited` webhooks.
