Drift Protocol v2

โŒ˜K
๐Ÿ‘พWelcome to Drift Protocol
๐ŸงฎDrift DEX
๐Ÿ‘‹Getting Started
๐Ÿ“ˆPerpetual Futures
๐Ÿ“ŠSpot Margin Trading
๐ŸฆBorrow & Lend
๐Ÿ›๏ธStaking
๐Ÿ”ฌTechnical Explanations
๐Ÿ“Accounting and Settlement
โž—Borrow Interest Rate
๐Ÿ“œDelisting Process
โ›ฒDrift AMM
๐ŸƒJust-In-Time (JIT) Auctions
๐Ÿ“šKeepers & Decentralised Orderbook
โ˜ ๏ธLiquidators
๐Ÿ’งLiquidity Providers (LPs)
๐Ÿ“‹Protocol Guard Rails
๐Ÿ“Risks
๐Ÿ–ฅ๏ธDeveloper Resources
๐Ÿ“”Overview
โŒจ๏ธSDK Documentation
โŒจ๏ธTutorial: Bots
โš ๏ธTroubleshooting
๐Ÿ› ๏ธKeeper Bots
๐Ÿ› ๏ธTrading Bots
โŒจ๏ธHistorical Data (v1)
โŒจ๏ธAPI
๐Ÿ›ก๏ธSecurity
๐Ÿ›ก๏ธAudits
๐Ÿ›ก๏ธBug Bounty
โš–๏ธLegal and Regulations
๐Ÿ“Terms of Use
๐Ÿ“Disclaimer
๐Ÿ“Privacy Policy
๐Ÿ“Competition Terms and Conditions
๐Ÿ“šGlossary
Docs powered byย archbeeย 
7min

Funding Rates

Perpetuals futures have no expiry date, final settlement, or delivery. As such, funding rate payments are used as the incentive mechanism to bring the perpetual futures' mark price in line with the oracle price.

(For instance, a user with long position in a market whose mark price < oracle price will receive a payoff proportional to their position size).

Field

Description

Funding Rate % Calc

1/24 * (market_twap - oracle_twap)/oracle_twap

TWAP Calc

EMA with span = 1 hour

Frequency

End of Hour* (9:00 AM, 10:00 AM, ...)

Note: Funding rate magnitudes are clamped at 0.12626% and are delayed at large divergences (see ๏ปฟ๏ปฟOracles). Market TWAP updates utilize the side of book for trade executions. ๏ปฟ๏ปฟ

Unrealised -> Realised Funding

Funding rates are updated lazily every hour*.

Any time a user opens or closes a position, the exchange tries to update the funding rate.

The funding rate will still be updated if enough time has passed and no position has been opened or closed.

The update will reflect the premium or discount between the DAMMโ€™s mark price and the oracleโ€™s price TWAP over the previous hour.

The cumulative funding rate is checked against user positions in case the off-chain funding rate bot does not trigger on the hour. This will show up as "Unrealised P&L" until your next user action within the market (such as a trade, deposit, withdraw etc.), see also P&L.

* if no market trades and/or funding update call occur within the first ~20 minutes of the hour, the next funding update will be delayed an additional hour.

Capped Symmetric Funding

Drift Protocol aims to provide a symmetric funding rate to both sides of the market. When there is a long-short imbalance within the DAMM, the protocol's market specific Rebate Pool can be used to pay (or receive) the cost delta between the longs and the shorts.

If the pool is empty or does not have enough to provide for funding (being 2/3 of the Rebate Pool balance available at each funding interval), then the receipts for funding will be capped to the available amount.

See Rebates for funding pool sizes where the funding paid from the Rebate Pool will be capped. This ensures that the risk is spread in the system and the Insurance Fund isn't drained by funding rates.

๏ปฟOver the hour, the amount available in the Rebate Pool will increase from fees as trades occur, so any existing predicted capped rate should move closer to being balanced. Example:

For BTC-PERP you can check the recent history to get a better idea of what shorts will receive: https://app.drift.trade/funding?market=BTC (you can access this link by clicking "24h Avg Funding" at the top of the page)

Example funding calculation:

1/24 * (174.643 - 174.450)/(174.450) = 0.00460% (40.27% APR)

example data
example data

Oracle Resilience

Drift's on-chain calculation of a market's oracle TWAP is updated only on trades which incorporates the oracle's confidence interval and a few interpolations to provide the most accurate and resilient value.

Read more about protective checks in ๏ปฟ๏ปฟ๏ปฟOracles๏ปฟ.

APR calculation

Funding rates can be showcased in annual terms for easier comparison.

APR (annual percentage rate) is calculated rate x 24 x 365.25

APY would be: (1 + rate) ^ (24 x 365.25) - 1

One can approximately track APY by allocating funding receipts back into the position (excluding fees/rebates)

Updated 28 Nov 2022
Did this page help you?
Yes
No
UP NEXT
Oracles
Docs powered byย archbeeย 
TABLE OF CONTENTS
Unrealised -> Realised Funding
Capped Symmetric Funding
Oracle Resilience
APR calculation