Time to analyse a mechanism used typically by Bitcoin Futures: the funding mechanism. The idea of this post came to me reading a post from Joe, an infamous whale in the bitcoin market:
The easiest arb play the last few days: sell 1 BTCUSD perp on FTX/Deribit/Kraken/Binance, buy 1 BTCUSDt perp on Bitfinex, pocket .05-.06% in funding every 8 hours. With yields like this, who the hell needs DeFi?
Why aren't more people doing this, I wonder?
https://twitter.com/J0E007/status/1288567031399428097?s=20This definitely caught my attention, as I wanted to explain futures funding in detail in my thread, but I hadn't done so far.
I am trying to explain in this post what is future funding, and what is the arbitrage Joe is referring to.
I am going to describe funding mechanism using the exchange examples. There is a very little variation from the various exchanges. I will quote the relevant part, with minimal edit from me, as those explications can be found almost with the same wording on every exchange providing perpetual futures. So I don't wan to to be accused of plagiarism for something that is already been cloned over and over the internet.
A perpetual future is a type of Futures Contract that doesn’t have an expiration date or settlement. These are quite uncommon in traditional markets, and, as long as I know, are used only in bitcoin trading. A Perpetual Contract is similar to a traditional futures contract in terms of trading, yet as it will not expire so that you can hold a position for as long as you wish. Given the fact it cannot hold close to the underlying price with the classical “no arbitrage-condition on expiry dates”, Perpetual Contracts track the underlying Index Price via the funding system.
Funding is the periodic interest payments between traders which aim to keep the Last Traded Price as close to the Index Price as possible. If the rate is positive, then Longs will pay and Shorts will receive the rate, and in the opposite way if the rate is negative. On many exchange funding occurs multiple times a day, the most common case is thrice a day, every 8 hours. At these times the exchange regulates the funding between every open contract at those times.
Please note that this is a transaction directly between the two sides on the open interest, there is no commission from the exchange, as the ultimate reason for this is to avoid the opening of arbitrage windows between the perpetual futures and the underlying index. If a trader closes his position before the snapshot no payment is expected against the exchange.
In the following example, I will try to explain the calculation of the funding. The computation is really similar for many of the exchanges, bar some negligible details.
What is Funding?
The Funding Rate is comprised of two main parts: the Interest Rate and the Premium/Discount. This rate aims to keep the Last Traded Price of the Perpetual Contract in line with the underlying market price of Bitcoin.
This way, the contract mimics the margin trade market, as buyers and sellers exchange interest payments periodically.
Every Perpetual Contract consists of Base currency (BTC) and Quote currency (USD).
The Interest Rate is calculated as:
Interest Rate (I) = (Interest Quote Index - Interest Base Index) / Funding Interval
where
Interest Base Index = The Interest Rate for borrowing the Base currency;
Interest Quote Index = The Interest Rate for borrowing the Quote currency;
Funding Interval = 3 (Funding occurs every 8 hours).
Perpetual Contract may trade on the exchange at a significant premium or discount to the Mark Price. In both cases, a Premium Index will be used to raise or lower the next Funding Rate to levels consistent with where the contract is trading.
Each contract’s Premium Index is calculated as following:
Premium Index (P) = (Max (0, Impact Bid Price - Mark Price) - Max (0, Mark Price - Impact Ask Price)) / Index Price + Fair Basis used in Mark Price
where
Impact Bid Price = The average fill price to execute the Impact Margin Notional on the Bid side
Impact Ask Price = The average fill price to execute the Impact Margin Notional on the Ask side
Funding Basis = Funding Rate * (Time Until Funding / Funding Interval)
Fair Price = Index Price * (1 + Funding Basis)
Impact price, bid or offer is the average price at which a certain amount of BTC can be executed. This is done to take into account the depth of the market, rather than the nominal bid-offer price, that can be irrelevant in thin markets. Usually, for the perpetual futures, the impact price is calculated on a size of 10 BTC.
Fair basis is instead used to "drag" the future price toward the Fair price at around the timing of Funding Timestamp. Funding Basis is computed every Minute.
The funding you pay or receive is calculated as below:
Funding = Position Value * Funding Rate
When the Funding Rate is positive, longs pay shorts, the opposite when the rate is negative where the shorts pay the longs.
Bear in mind that Position Value is not impacted by the future leverage. For example, if you hold 10 BTCUSD contracts with 100x leverage funding is charged/received on the notional value of those contracts (10 BTC) , and is not computed on how much margin you have assigned to the position (that is determined computing the total exposure of 10000.
Funding Rate Calculations
The Funding Rate is composed of two parts: the Interest Rate and the Premium/Discount.
The Funding Rate aims to keep the traded price of your Perpetual Contract in line with the underlying reference price. Therefore, the contract mimics how margin-trading markets work, as the longs and shorts of the contract exchange interest payments periodically.
Interest Rate
Every perpetual future contract consists of two parts: a Base currency and a Quote currency. If we analyse the BTCUSD Perpetual Contract, the Base currency is Bitcoin, while the Quote currency is USD. The Interest Rate is a function of interest rates between the two currencies.
Interest Rate (I) = (Interest Quote Index - Interest Base Index) / Funding Interval
where
Interest Base Index = The Interest Rate for borrowing the Base currency
Interest Quote Index = The Interest Rate for borrowing the Quote currency
Funding Interval = 24/8 = 3 (The funding occurs every 8 hours over a 24 hours cycle)
Premium / Discount Component
The perpetual contract is a totally separated market from the underlying. Also, as it never expires, there is no arbitrage condition pulling the price to the underlying market. To avoid the dislocation of the future, something that could hinder his effectiveness as an hedging and speculative tool, a mechanism is put in effect to induce market participants to rationally adjust the price toward the expected value: this mechanism is the funding system.
If the perpetual future trades at a Mark Price that is away from the Index Price, the price of the underlying, a Premium Index will be used to raise or lower the next Funding Rate to levels consistent with which the contract is being traded.
Premium Index (P) = (Max(0, Impact Bid Price - Mark Price) - Max(0, Mark Price - Impact Ask Price)) / Spot Price + Fair Basis used in Mark Price
Please check Fair Price Marking for more information on the Impact Bid Price and the Impact Ask Price.
FAIR PRICE MARKING
Final Funding Rate Calculation
The exchange calculates the Premium Index (P) and Interest Rate (I) every minute and then performs an 8-hour Time-Weighted-Average-Price (TWAP) over the series of minute rates.
The funding rate is calculated with the 8-Hour Interest Rate Component and the 8-Hour Premium / Discount Component. A +/- 0.05% dampener is added.
Funding Rate (F) = Premium Index (P) + clamp(Interest Rate (I) - Premium Index (P), 0.05%, -0.05%)
The 'clamp' function limits a value between an upper and lower bound, where the preferred value is the first parameter, the upper bound is the second parameter, and the lower bound is the third parameter. In other words, the function 'clamp' selects the middle value among the three. Therefore, if (I - P) is within +/- 0.05%, then we take (I - P) and F = P + (I - P). This means the Funding Rate is equal to the Interest Rate.
This calculated Funding Rate is then applied to the BTC Position Value of each trader to determine the Funding Amount to be paid or received at the Funding Timestamp.
Funding Rate Caps
The exchanges usually set maximum levels, caps, on the Funding Rate to ensure that the maximum leverage can still be used.
Usually there are two separate caps levels:
The absolute Funding Rate is capped at 75% of the Initial Margin - Maintenance Margin. If the Initial Margin is 1% and the Maintenance Margin is 0.5%, then the maximum Funding Rate will be 75% * (1% - 0.5%) = 0.375%.
The Funding Rate shall not be changed by more than 75% of the Maintenance Margin between Funding intervals.
Funding Fees
The exchanges don’t charge any fees on funding. The funding is exchanged directly between the long and short position holders. This gives the maximum liquidity to the funding system, avoiding arbitrage possibility and ensuring the most accurate pricing of the future itself, which is ultimately in exchange interest.
To help you familiarise with all the above computation I readied up a
Back to Joe's tweet.
I don't know it it looks so great after all.
According do his calculations, with a 10 BTC position spreading FTX vs Bitfinex (20 BT locked) you could potentially yield a little bit less than 0.015 BTC per day.
In my humble opinion he misread a rate and my computation lead me to an even lower outcome of 0.004 BTC per day when computing the correct rates.