# Perps Funding Rate

As perpetual futures do not have a final settlement at maturity to guarantee convergence to the spot market index price, the **Monday Trade Perps Engine** employs **continuous funding** for its perpetual futures markets. The principle is to expect the deviation to converge in a specified cycle.

$$
FundingFeeRate = \frac{(P\_{\text{fair}} - P\_{\text{spot}})}{P\_{\text{spot}}} \cdot \frac{\Delta t}{Interval}
$$

**∆t** is the time difference in seconds between the current and last timestamp when the funding fee rate is calculated.

**Interval** can be set to different settings based on the trading pair, such as 1 hour (3,600 seconds), 8 hours (28,800 seconds), or 24 hours (86,400 seconds).

The Funding index of a pair is updated when anyone interacts with that pair.

**Unrealized funding payment/income of a position is realized or settled when the position is increased, reduced, or closed or its margin is adjusted.**

### Advanced <a href="#advanced" id="advanced"></a>

Due to limitations of smart contract implementations, the smart contracts only keep track of the total OI of long positions and total OI of short positions; liquidity added through AMM curves and not through limit orders are exempted from the funding income/fees.The actual funding payment amount calculation is as follows, let FundingFeeRate be the rate calculated above.

For the case long pays short：

* **FundingFeeRateForLong = -FundingFeeRate**
* **FundingFeeRateForShort = +FundingFeeRate \* totalLongPositionOI / totalShortPositionOI**

For the case short pays long：

* **FundingFeeRateForShort = FundingFeeRate**
* **FundingFeeRateForLong = -FundingFeeRate \* totalShortPositionOI / totalLongPositionOI**

**In other words, the side that pays funding always pays as is, but the side that receives funding may receive more or less funding depending on the position imbalance.**

### Implications <a href="#implications" id="implications"></a>

In a market scenario where **price rapidly goes up,** totalLongPositionOI is likely to be much larger than totalShortPositionOI as liquidity in Monday Trade Perps Engine is holding most of the short position until LP's remove those liquidity

* If the long positions need to pay funding, **short positions will receive much more fundings per unit of position**
* If the long positions are to receive funding, **long positions will receive less fundings per unit of position**

In a market scenario where **price rapidly goes down,** totalShortPositionOI is likely to be much larger than totalLongPositionOI as liquidity in Monday Trade Perps Engine is holding most of the long position until LP's remove those liquidity

* If the short positions need to pay funding, **long positions will receive more fundings per unit of position**
* If the short positions are to receive funding, **short positions will receive less fundings per unit of position**
