🌑️Funding for Perpetual Futures

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

FundingFeeRate=(Pfairβˆ’Pspot)Pspotβ‹…Ξ”tIntervalFundingFeeRate = \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 (3600 seconds), 8 hours (28800 seconds), or 24 hours (86400 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

Due to limitations of smart contract implementation, liquidities added through Earn (AMM pools) are exempted from the funding income/fees. The smart contracts keeps track of the total OI of long positions and total OI of short positions, excluding the OIs in liquidity.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

In a market scenario where price rapidly goes up, totalLongPositionOI is likely to be much larger than totalShortPositionOI as liquidity in Oyster AMM 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 Oyster AMM 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

Last updated