Skip to content

Funding

What are funding rates?

Perpetual contracts have no expiry date and therefore no final settlement or delivery. Funding payments are therefore used to incentivize the price of the perpetual to trade at the price of the underlying.

The purpose of the funding rate is to keep the price of each perpetual market trading close to its Oracle Price. When the price is too high, longs pay shorts, incentivizing more traders to sell / go short, and driving the price down. When the price is too low, shorts pay longs, incentivizing more traders to buy / go long, driving the price up.

How are funding rates calculated on dYdX ?

The main component of the funding rate is a premium that considers market activity for a perpetual. It is calculated for every market using the formula:

Premium = (Max(0, Impact Bid Price - Index Price) - Max(0, Index Price - Impact Ask Price)) / Index Price

Where the impact bid and impact ask prices are defined as:

  • Impact Bid Price = Average execution price for a market sell of the impact notional value
  • Impact Ask Price = Average execution price for a market buy of the impact notional value
  • Impact Notional Amount = 500 USDC / Initial Margin Fraction

For example, at a 10% initial margin fraction, the impact notional value is 5,000 USDC. At the end of each hour, the one-hour premium is calculated as the simple average (i.e. TWAP) of the 60 premiums calculated over the last hour.

How is the sample calculated?

At a high level, the proposer determines the premium for each block based on their local view of the order book and then proposes a FundingPremiumVote. At the end of each funding-sample period (default to 1 minute), the median FundingPremiumVote is taken as the sample for that period. Therefore, at the end of each funding-tick period (default to 1 hour), the average of the past samples is used as the final funding rate.

In addition to the premium component, each market has a fixed interest rate component that aims to account for the difference in interest rates of the base and quote currencies. The funding rate is then:

Funding Rate = (Premium Component / 8) + Interest Rate Component

As part of the default settings of the v4 open source software, the interest rate component for all markets is 0% . The funding rate is simply the one-hour premium for markets with no interest rate component.

What role do block proposers play in funding rates on dYdX?

As part of the default settings of the v4 open source software, there are two distinct epochs established with the Epochs module. Every block proposer proposes a FundingPremiumVote during each block. At the end of a funding-sample epoch, the state machine deterministically computes a funding sample from all the FundingPremiumVotes in this epoch (1 minute).

The second epoch is the "funding-tick epoch," which occurs every hour at the start of the hour and is responsible for adjusting funding rates based on the funding samples collected from the preceding epoch.

Where is the funding rate for a particular market located on dYdX?

Please see the Get Historical Funding API method.

What is a funding rate cap?

The funding rate cap refers to a predetermined maximum limit on the funding rate applied to a particular contract. It aims to limit the potential costs incurred by traders, especially during volatile market conditions. As part of the default settings of the v4 open source software, there’s a cap on each funding sample (per minute) and the funding rate (per hour).

How is the funding rate cap calculated?

The 8-hour rate cap is calculated by 600% * (Initial Margin - Maintenance Margin).

MarketInitial marginMaintenance margin
Large-Cap5%3%
Mid-Cap10%5%
Long-Tail20%10%

For example, for BTC-USD, which falls under Large-Cap, the 8-hour rate is capped by 600% * (IMF - MMF) = 600% * (5% - 3%) = 12%.

FAQ

What Funding parameters can be controlled by Governance?

Governance has the ability to adjust Funding Rate parameters:

  • Funding rate clamp factor, premium vote clamp factor, and min number of votes per premium sample. Proto
  • Epoch information, which defines the funding interval and premium sampling interval. Proto
  • Liquidity Tier, which defines the impact notional value. Proto

How does the funding rate impact P&L?

Realized P&L increases or decreases while you hold a position due to funding fees, which are paid or received every hour depending on your position and the funding rate.

When are the funding rates charged?

We charge funding rates every hour on our platform. The funding rate is calculated at the end of each hour and is based on the average of premiums collected over the last 60 minutes. This hourly funding rate helps keep the perpetual contract prices aligned with their underlying asset prices.

Where can I find the details of how much I paid for the funding rate and view my payment history?

Funding Rate Payment History feature is currently under development and will be available soon. Stay tuned for updates!