How to Market Make Bitcoin Derivatives Lesson 2

In Lesson 1, I described how to calculate a two-way quote, dynamically hedge, and match the settlement for an ETC7D futures contract. In this lesson, I will discuss how to calculate Basis and Skew, and how to apply these to your two-way quotes.

Calculating Basis

To calculate the future value of any currency pair, you need to know the cost to borrow and lend the home and foreign currencies. The underlying currency of ETC7D is the ETC/XBT exchange rate. Assume that as a market maker you only own Bitcoin and not any other currency.

To buy ETC, you must sell XBT that you own. That XBT has an opportunity cost of capital. If you were to borrow this Bitcoin from another party to fund your business, how much would it cost?

To sell ETC, you must borrow it. There are two ways this is accomplished. For more well established digital currencies, spot exchanges like Poloniex will operate a borrow market. You can automatically pledge Bitcoin as collateral and borrow ETC at the market interest rate when you wish to short it.

If margin trading is not available, you need to borrow it from another trader. The other party will lend you ETC for a period of time at a rate of interest.

Using Covered Interest Rate Parity, we can calculate the Basis.

Basis = (1 + XBTr * t) / (1 + ETCr * t) – 1

XBTr = Bitcoin annualised interest rate

ETCr = Ether Classic annualised interest rate

t = Time in years

In practical terms, we ignore the opportunity cost of XBT. You can compensate for that by increasing your spread profit margin. As a market maker, you are concerned about how much you will pay to short ETC.

Assume it costs you 50% per annum to borrow ETC.

Basis for 7-day Future = 1 / (1 + 50% * 7/365) – 1 = -0.95%

If the spot price is 0.02 XBT, translate that Basis into points.

-0.95% * 0.02 XBT = -0.00019 XBT

ETC7D Quote Mid = Spot + Basis = 0.02 XBT – 0.00019 XBT = 0.01981 XBT

You have lowered your mid price. This will compensate you in the event someone sells to you. If you become long ETC7D, you will have to short ETC and pay the borrow fee.

Calculating Skew

You don’t have infinite capital. Left unchecked, you could build up a large long or short position in ETC7D. Your goal is to capture two-way flow so that you earn half of your quoted spread.

If someone continues selling into your bids, you want to progressively lower your quotes. If someone continues buying your asks, you want to progressively raise your quotes. A simple example will help illustrate the concept.

Assume you quote a two-way market of 10 / 11 for 1 contract each side. The total amount you are quoting on each side is 1 contract; I will call your Total Size Quoted. The bid / ask spread is 10%, half of that spread is 5%; I will call this your Weighted Average Half Spread.

Skew = (Change in Position / Total Size Quoted) * Weighted Average Half Spread * -1

Your position changed by +1.

Skew = (1 / 1) * 5% * -1 = -5%

You originally had a mid price of 10.5. Assume that the mid price represented the spot price.

New Mid Price = Spot + Skew = 10.5 * (1 – 5%) = 9.98

New Bid Price = 9.98 * (1 – 5%) = 9.48

New Ask Price = 9.98 * (1 + 5%) = 10.47

Combining Basis and Skew

Before you begin quoting, you will calculate the Basis. You will do this calculation based on how expensive it is for you to borrow the home currency.

Then while quoting, your trading program will adjust the Skew based on whether traders buy or sell from you.

Quote Mid Price = Spot Price + Basis + Skew

Using these two concepts, you cover your cost of funds, and manage your inventory.

In Lesson 3, I will explain how to handle Auto-Deleveraging events, and other advanced topics. To view the BitMEX sample market making bot, please visit Github.

BitMEX Hosts Bitcoin Arbitrage Webinar

Bitcoin Arbitrage Webinar

In conjunction with David Moskowitz of Coin Republic, BitMEX CEO Arthur Hayes will be hosting a webinar covering Bitcoin arbitrage trading strategies. The webinar will take place on Monday 27 October 2014 at 20:00 Eastern Standard Time.

Topics covered include:

  • Cash Exchange Arbitrage
  • Futures vs. Spot Arbitrage
  • Covered Interest Rate Parity
  • BitMEX Derivative Contracts

Arthur will explain how traders can employ these simple strategies and make Bitcoin volatility work for their portfolio.
Coin Republic has more details on the webinar.

Materials for the Webinar

If you have not already done so, please visit the BitMEX Testnet and set up an account. Arthur will demonstrate how to properly execute these strategies using BitMEX derivative contracts. 

Please download the Arbitrage Pricing Excel Spreadsheet so that you may follow along. Arthur will describe the math behind the strategies step by step.

Arbitrage Made Easy, Lesson 1

The Arbitrage Made Easy lessons will present simple yet profitable arbitrage strategies that can be employed by traders using a combination of spot Bitcoin trading and BitMEX derivatives contracts. The Bitcoin/USD exchange rate will be referred to using the symbol XBTUSD.

Lesson 1 will focus on the arbitrage of price differentials between spot XBT exchanges.

After spending some time trading XBT, traders will notice that sometimes there are large differences between exchanges. Savvy traders can capture these price differentials in a riskless manner. This lesson will assume that the trader’s home currency is USD. Therefore, the trader wants zero risk in USD terms. Traders will use a portfolio of USD and XBT to capture arbitrage opportunities risklessly.

During this lesson we will refer to the “cheap exchange” as exchange A, and the “expensive exchange” as exchange B. The goal as with any trade is to buy low on exchange A, and sell high on exchange B.

Step 1: Construct a Portfolio of Half USD and Half XBT

The arbitraging of spot exchange requires traders to buy XBT cheaply on exchange A, and sell XBT expensive on exchange B simultaneously. If a trader started with just USD the following steps would have to be taken to conduct the arbitrage:

  1. Wire USD to exchange A
  2. Sell USD buy XBT
  3. Transfer XBT to exchange B, wait for 1-6 confirmations
  4. Sell XBT for USD on exchange B
  5. Remit USD from exchange B to home bank account
  6. Repeat

There are several problems with that trade flow. Wiring USD can take upwards of 5 business days depending on the bank and country. By the time the funds reach exchange A, the arbitrage opportunity could have disappeared. In step 3, the price of XBT could move against the trader before he is able to sell on exchange B.

The optimal structure would be to have a portfolio of USD and XBT spread out across the relevant exchanges. When an opportunity presents itself, traders can act immediately and capture the arbitrage before it evaporates.

Going forward a XBT spot price of $500 will be assumed. A portfolio of $5,000 and 10 XBT has been constructed. The total portfolio value is $10,000 = $5,000 + 10 XBT * $500.

Step 2: Sell XBT Futures Contracts to Eliminate Price Risk

The home currency is USD, traders do not want to have any exposure to XBT exchange rate fluctuations. Trading BitMEX futures contracts is the best way to eliminate currency risk. BitMEX offers a futures contract that locks in the future USD value of Bitcoin, called the XBU series.

Step 2a: Selling XBUU14 Futures Contracts

Each XBUU14 (BitMEX USD / Bitcoin September 26, 2014) is worth $100 of Bitcoin. The underlying is the XBTUSD spot price. For this lesson, the current XBTUSD price is $500. The current price of the XBUU14 contract is $500. To determine the proper amount of contracts to sell, the trader should consider the USD value of XBT that he wishes to hedge. The current USD value of the 10 XBT held is $5,000 = $500 * 10 XBT. The portfolio needs to sell 50 contracts = $5,000 / $100.

Now the sample portfolio looks as follows:

$5,000 cash

10 physical Bitcoin

Short 50 XBUU14 contracts

The below table shows the USD value of the portfolio as spot XBTUSD changes:

XBTUSD USD Cash Physical XBT XBT Profit XBUU14 USD Portfolio Value
300 $5,000 10 XBT 7 XBT $10,000
400 $5,000 10 XBT 3 XBT $10,000
500 $5,000 10 XBT 0 XBT $10,000
600 $5,000 10 XBT -2 XBT $10,000
700 $5,000 10 XBT -3 XBT $10,000

Because of the XBUU14 hedge, the portfolio value stays constant at $10,000 no matter the XBTUSD price. Now the Bitcoin price volatility will not affect the returns from this arbitrage strategy.

Step 3a: Full Circle Arbitrage Between Exchanges A and B

Now that the portfolio has been constructed and hedged to eliminate currency risk, it is time to capture riskless profits. Exchange A trades at $480, while exchange B trades at $500. The below steps describe how to arbitrage the two exchanges.

  1. Deposit $5,000 onto exchange A; deposit 7 XBT onto exchange B
  2. Buy 7 XBT on exchange A for a cost of $3,360 = 7 XBT * $480
  3. Simultaneously sell 7 XBT on exchange B and receive $3,500
  4. Withdraw $3,500 from exchange B, then wire $3,500 to exchange A
  5. Transfer 7 XBT from exchange A to B
  6. Repeat

The above trade generated $140 in gross profit. USD deposit and withdrawal fees as well as exchange trading fees must be deducted. The result will be the net profit from this arbitrage trade. The amount of times the portfolio can be churned is limited by the speed of USD wire transfers and the size of price gap between exchange A and B.

Notice that only 7 XBT could be used as working capital for the arbitrage opportunity. This is because BitMEX requires margin to be posted against the short 50 XBUU14 contracts. BitMEX requires an initial margin of 30%, given short 50 XBUU14 contracts are worth 10 XBT (1/$500 * $100 * 50 Contracts), 3 XBT must be deposited as margin with BitMEX leaving 7 XBT for arbitrage purposes.

Step 3b: Exchange A and B Spread Trading

Instead of withdrawing USD from exchange B and transferring again back to exchange A, a trader can play the spread between the two exchanges. Exchange A trades at $480, while exchange B trades at $500. The below steps describe how to spread trade.

  1. Deposit $5,000 onto exchange A; deposit 7 XBT onto exchange B
  2. Buy 7 XBT on exchange A for a cost of $3,360 = 7 XBT * $480
  3. Simultaneously sell 7 XBT on exchange B and receive $3,500
  4. Prices on exchange A and B equalise at $500
  5. Buy 7 XBT on exchange B for a cost of $3,500
  6. Simultaneously sell 7 XBT on exchange A and receive $3,500
  7. Exchange A now contains $5,140
  8. Exchange B now contains 7 XBT
  9. Wait for the spread between A and B to widen again and repeat

The above trade has generated $140 in gross profit. USD deposit and exchange trading fees must be deducted. The result will be the net profit from this arbitrage trade. Spread trading does not require the withdrawal of USD from exchange B and subsequent deposit onto exchange A which reduces fees paid. However, traders must wait for the spread to collapse before the portfolio can be rebalanced.

The BitMEX Trading Challenge Results

Thank you to all the traders who participated in the first BitMEX Trading Challenge. There were over 350 participants but there can only be one winner.

A trader with the username JMG decidedly won the first challenge. His account balance was an impressive 553.3853 XBT, for a return on equity of over 1,000%. BitMEX has sent 5 XBT to JMG’s personal Bitcoin address. BitMEX will also donate 5 XBT to The Water Project. The Water Project helps provide clean, safe water in developing countries.

The second 0.5 XBT prize was given to a trader with the username EZK27. He finished in the top 10, and was chosen at random to receive the prize.

The BitMEX Trading Challenge II is now live. All traders have been given a fresh start with 50 fake XBT. The real launch of BitMEX is weeks away. Keep learning and trading so you can start making real Bitcoin by the end of this month.

Below are the final results of the top 50 traders:

Username Margin Balance
JMG 553.3853 XBT
Fokchi123 237.2251 XBT
ppw22 172.5015 XBT
EZK27 142.9241 XBT
faeynheart 117.4818 XBT
joshlim 110.1306 XBT
NaskiaUtamu 106.9839 XBT
Username 106.3250 XBT
floopfloop 88.7515 XBT
binaryfin 74.5933 XBT
fisher 72.3535 XBT
MelonaD 69.6251 XBT
Bountoh 69.3479 XBT
medimatrix 67.5764 XBT
TrevinHofmann 65.3933 XBT
panislepickova 64.4395 XBT
apg 64.4217 XBT
facetedsubset 63.6886 XBT
antony 62.7164 XBT
shuckc 62.5893 XBT
mavoik 61.6366 XBT
alex1337 60.7224 XBT
MrSegfault 60.4425 XBT
Indeed 60.4272 XBT
Eff 60.0172 XBT
Yolos 58.1880 XBT
dashwoo 58.0261 XBT
mystisking 57.3277 XBT
darandull 57.1099 XBT
Davidjnamdar 56.2313 XBT
bos 55.5255 XBT
Merchant 55.2945 XBT
lordsonkit 54.1511 XBT
gigi 53.9036 XBT
Rizky 53.5595 XBT
fruitdealer 53.5230 XBT
ccrock 53.1972 XBT
Bkcoins 52.5674 XBT
rhk 52.4286 XBT
frederich 52.2450 XBT
mandi 51.7320 XBT
thegreatscott 51.4665 XBT
vnct 51.4356 XBT
sinedolo 51.2265 XBT
jm12 50.8369 XBT
BitInvest 50.7542 XBT
TheGlobe 50.7385 XBT
sixthsense 50.6588 XBT
pipor 50.6442 XBT
coffeens 50.6216 XBT