As perpetuals futures do not expire, funding rate payments are used to incentivise traders to restore the perpetual futures' mark price in line with the oracle price.
Each perpetual futures market on Sujiko has an isolated funding payment pool. This pool is used to pay out and receive funding payments to/from traders with active i.e. open perpetual futures positions.
Funding is paid directly into/out of a trader’s collateral. If a trader is paying funding, their margin ratio will decrease. Conversely, if a trader is receives funding, their margin ratio will increase. Funding payments can lead to liquidation if a trader does not actively monitor their active i.e. open perpetual futures positions.
Funding payments are paid by traders who move the mark price farther from the index price. For example, when the mark price is below index price, funding is negative so short positions pay funding and long positions earn funding. By opening more short positions, traders are moving the mark price farther from the index price and increasing divergence.
Funding payments are earned by traders who move the mark price closer to the index price. For example, when the mark price is below index price, funding is negative so short positions pay funding and long positions earn funding. By opening more long positions, traders are moving the mark price closer from the index price and decreasing divergence.
Funding payments are charged per hour on the hour (or up to 5 minutes over if network conditions are poor). The funding rate is calculated as the average hourly premium multiplied by 1/24. The average hourly premium is calculated as mark_twap - oracle_twap / mark_twap where:
- mark_twap = (bid_twap + ask_twap) / 2
- twap_window = 1 hour
Each market has a funding rate buffer that stores up to 8760 (~1 year of hourly funding rates) entries. This buffer is used to determine if a market has a persistent funding rate bias on-chain. A persistent funding rate bias is defined as a scenario where there is consistent funding payments to the same side (i.e. for the last 80 funding payments, longs have paid shorts every time).
The protocol can have asymmetric funding. Funding payments are capped at 1% per hour and funding rebates at 0.1% per hour. If there is an imbalance of longs and shorts in the vAMM, the isolated funding rate pool will be used to cover the funding delta between longs and shorts.
Historical funding rates are stored on-chain in a buffer. On any action with the protocol and if the hour has passed, the funding rate will calculated and added to this buffer. Trader positions are updated by an off-chain keeper whenever the buffer is updated.
- If there is a large oracle vs mark price divergence greater than 50%, funding payments will be paused.
- Funding rebate will be capped at 0% if there are not enough funds in the funding pool to cover the next payout. This ensures the funding pools aren’t drained.
- The market-specific funding pool will be used to pay funding rebates.
APR (annual percentage rate) = rate x 24 x 365.25
APY = (1 + rate) ^ (24 x 365.25) - 1