Hedging a Quanto Perpetual Swap

Hedging a quanto perpetual swap is not straightforward. The added component of correlation risk between two crypto assets complicates things. I will take things from first principles, then provide a more general formula.

Symbol: ETHUSD
Multiplier: 0.000001 XBT
ETHUSD Price: $500
.BETH (ETH/USD Spot Index): $500
.BXBT (XBT/USD Spot Index): $10,000

Scenario 1 – Short ETHUSD and Hedge

You are lifted for 100,000 contracts of ETHUSD.

First let’s compute your currency exposures:

XBT Value = $500 * 0.000001 XBT * -100,000 = -50 XBT
ETH Value = XBT Value / [ .BETH / .BXBT ] = -1,000 ETH

Next you hedge your ETH/USD exposure by purchasing 1,000 ETH at the spot price. Assume you can match the current .BETH Index price on your purchase.

You have hedged your underlying currency exposure. At this point your exposure is perfectly hedged. However, as the price of ETHUSD changes, your PNL on ETHUSD will be in XBT, while the PNL on your ETH hedge will be in USD.

Let’s look at two extreme examples.

Example 1: .BETH Rises and .BXBT Falls

.BETH and ETHUSD rises to $750
.BXBT falls to $5,000

ETHUSD PNL = (ETHUSD Exit Price - ETHUSD Entry Price) * Multiplier * # Contracts = -25 XBT, USD Value -$125,000

ETH Spot USD PNL = (.BETH Exit Price - .BETH Entry Price) * # ETH = $250,000

Net USD PNL = ETHUSD XBT PNL in USD + ETH Spot USD PNL = +$125,000

In this example the correlation between the USD value of XBT and ETH is -1. They moved in a perfectly negatively correlated fashion, and you made money.

Example 2: .BETH Rises and .BXBT Rises

.BETH and ETHUSD rises to $750
.BXBT rises to $15,000

ETHUSD PNL = -25 XBT, USD Value -$375,000
ETH Spot USD PNL = $250,000
Net USD PNL = -$125,000

In this example the correlation between the USD value of XBT and ETH is +1. They moved in a perfectly positively correlated fashion, and you lost money.

The short ETHUSD position + Hedge profited when correlation fell, and lost when the correlation rose. Due to the flat ETHUSD vs. .BETH basis, the entry price assumed a correlation of zero between the two cryptos.

Scenario 2: Long ETHUSD and Hedge

You are lifted for 100,000 contracts ofETHUSD.

First let’s compute your currency exposures:

XBT Value = $500 * 0.000001 XBT * 100,000 = 50 XBT
ETH Value = XBT Value / [ .BETH / .BXBT ] = 1,000 ETH

Next you hedge your ETH/USD exposure by shorting 1,000 ETH at the spot price. Assume you can match the current .BETH Index price on your purchase, and there is no cost to borrow ETH for this short sell.

You have hedged your underlying currency exposure. At this point your exposure is perfectly hedged. However, as the price of ETHUSD changes, your PNL on ETHUSD will be in XBT, while the PNL on your ETH hedge will be in USD.

Let’s look at two extreme examples.

Example 1: .BETH Rises and .BXBT Falls

.BETH and ETHUSD rises to $750
.BXBT falls to $5,000

ETHUSD PNL  = 25 XBT, USD Value $125,000
ETH Spot USD PNL = -$250,000
Net USD PNL = -$125,000

In this example the correlation between the USD value of XBT and ETH is -1. They moved in a perfectly negatively correlated fashion, and you lost money.

Example 2: .BETH Rises and .BXBT Rises

.BETH and ETHUSD rises to $750
.BXBT rises to $15,000

ETHUSD PNL = 25 XBT, USD Value $375,000
ETH Spot USD PNL = -$250,000
Net USD PNL = $125,000

In this example the correlation between the USD value of XBT and ETH is +1. They moved in a perfectly positively correlated fashion, and you made money.

The short ETHUSD position + Hedge profited when correlation rose, and lost when the correlation fell. Due to the flat ETHUSD vs. .BETH basis, the entry price assumed a correlation of zero between the two cryptos.

The below table summaries the two scenarios:

Time Horizon

The correlation between XBT and ETH is not static. The longer you hold a hedged swap position, the more chance that the correlation regime you expect based on the recent past, will change.

Unlike a futures contract, the ETHUSD swap has no expiration date. Therefore your quanto risk is specific to your time horizon. For market makers who are in and out quickly, the quanto effect is negligible. For cash and carry market makers who hold a position for an extended period of time to capture funding, the quanto effect can destroy one’s PNL.


Many market makers will not be satisfied leaving their correlation risk unhedged. They will constantly hedge their PNL on the BitMEX and spot leg of their portfolio. Depending on the XBT and ETH volatility, and their correlation, the covariance will determine whether the hedging of PNL positively or negatively impacts your overall profits. If both assets are highly volatile and the correlation is moving in or out of your favour, your gains or losses from hedging the PNL are amplified.

We are in uncharted territory. In a few month’s time, I will observe the past data and attempt to calculate what portion of the funding is attributed to market makers pricing in a quanto risk, and what portion is due to the interest rate differentials between ETH and USD.

Quanto for Speculators

Speculators care about obtaining exposure to risk. How they get that exposure if they can get in and out cheaply is secondary. If BitMEX is able to create a liquid market for Bitcoin quanto’ed derivatives, speculators will flock to them.

As I previously explained in “Why Quanto?”, in order for BitMEX to offer ETH/USD risk, we had to quanto into Bitcoin. This post will explore the concepts speculators care about.

For all the below examples we will use the following assumptions:

Contract: ETHUSD
Multiplier: 0.000001 XBT per 1 USD
Contracts: 10,000

Contract Value

The most important aspect to a speculator is the contract’s payoff function. Since we are speculating on the ETH/USD price, ideally the contract’s Bitcoin value should increase and decrease in a linear fashion with respect to the ETH/USD price.

I assume the speculator denominates their profit in Bitcoin (XBT) terms. Therefore the value of Bitcoin in USD terms at a particular ETH/USD price is irrelevant. Put simply, the speculator wants to use Bitcoin as a margin to earn more Bitcoin.

The above chart illustrates that at different ETHUSD values, the XBT value of the position changes linearly. That is exactly what the speculator desires.

XBT Value = ETHUSD Price * Multiplier * # Contracts

Calculating Margin

How is the amount of Bitcoin margin calculated? The initial margin for the ETHUSD contract is 2%, or 50x leverage.

Initial Margin (IM) = 2% * XBT Value

If you enter the trade at an ETHUSD Price of $500, this is your initial margin requirement:

IM = 2% * $500 * 0.000001 XBT * 10,000 = 0.10 XBT

The next important consideration is what is your liquidation price. That is determined by the maintenance margin. The maintenance margin for the ETHUSD contract is 1%. If the underlying ETH/USD spot price declines by 1%, you will be liquidated.

Calculating Profit and Loss (PNL)

The PNL is denominated in Bitcoin. In Bitcoin terms, the PNL changes linearly with the ETHUSD price. If the contract goes up 1%, your Bitcoin PNL also goes up 1%. The chart above illustrates that.

XBT PNL = (ETHUSD Exit Price - ETHUSD Entry Price) * Multiplier * # Contracts

In the above example, if the ETHUSD price moves from $500 to $600, this is the XBT PNL:

XBT PNL = ($600 - $500) * 0.000001 XBT * 10,000 = 1 XBT

Number of Contracts

To get a certain amount of Bitcoin exposure requires a little math.

The following describes how to calculate how many contracts it takes to equal a desired Bitcoin notional.

Contracts = XBT Notional / [ ETHUSD Price * Multiplier ]

If you want 100 XBT of risk, how many contracts of ETHUSD must you trade:

Contracts = 100 XBT / [ $500 * 0.000001 XBT ] = 200,000 Contracts

The quanto structure satisfies the desires of a Bitcoin-based speculator. The major components that speculators care about all vary linearly with respect to the ETH/USD price. The relative rich or cheapness of the contract vs. the underlying is not a major concern if the contract is liquid.

The factors that govern whether the contract will be at a premium or discount will be explored in the subsequent piece. These considerations heavily depend on how to hedge a quanto derivative from first principles. The hedging of the contract is where the non-linear effects matter.

Why Quanto?

The USD is the biggest shitcoin out there. However, all assets are priced against it. Crypto is not immune. The Bitcoin / USD price is the most important cross in the crypto asset universe.

Moving into the altcoin space, the most active crosses are against the USD as well. To replicate our inverse style derivatives on an altcoin / USD cross requires us to accept the altcoin in question as collateral. The next natural altcoin BitMEX could accept is Ether. However, to fit into our multi-sig security process, it requires us to use/code an Ethereum multi-sig smart contract.

Unfortunately, due to various exploits of popular Ethereum multi-sig smart contracts, we never felt comfortable custodying Ether. Rule 1, to infinity minus 1, of operating a crypto trading platform, is don’t lose the crypto. Anything we can do to limit our risk surface area we must do. Therefore, taking Ether as collateral given the current state of the protocol is a non-starter.

Given these constraints, we cannot launch an Ether margined inverse ETHUSD contract. An inverse style contract is one where the margin and PNL currency is denominated in the home currency (ETH), the quote currency is denominated in the foreign currency (USD), and the contract value is a nominal amount of the foreign currency (USD).

Inverse Contract Example: XBTUSD Swap

Margin Currency: XBT (Bitcoin)
Quote Currency: USD
Contract Value: $1

In order to offer risk on ETH/USD where Bitcoin is used as the margin and PNL currency, the quanto derivative type is necessary.

From Wikipedia:

quanto is a type of derivative in which the underlying is denominated in one currency, but the instrument itself is settled in another currency at some rate. Such products are attractive for speculators and investors who wish to have exposure to a foreign asset, but without the corresponding exchange rate risk.

Quantos are exotic derivatives that can move non-linearly with respect to the underlying. However, they are very beneficial for speculators and hedgers in search of liquidity, where they can post margin in a currency in which they feel comfortable. In my time as a delta one trader, we routinely traded USD quanto derivatives to get exposure to local currency futures contracts in countries that restricted the trading ability of foreigners (e.g. India and Taiwan).

The recently launched BitMEX ETHUSD Perpetual Swap is a quanto derivative. The contract pays out 0.000001 XBT per 1 USD. This means that the Bitcoin multiplier is constant regardless of the nominal USD price of ETH. This is great for speculators, the Bitcoin return varies linearly with respect to the ETHUSD price. For those using this contract to hedge the ETH/USD cross or market makers, it gets a bit trickier. I will get into the mechanics of hedging and market-making later in this newsletter.

Quanto Worked Example Spreadsheet
We have created a spreadsheet for users to download and work through some of the below use cases that can be accessed here.

Downtime Aug 4, 2018

From 14:29 to 15:26 UTC today, August 4, 2018, access to BitMEX.com and the BitMEX API was severely impaired.

A large spike in load caused an overload in a critical internal system used for rate limiting and sessions, creating a feedback loop in that system where data was recalculated more often then usual, exacerbating the load.

The feedback loop has been fixed and systems have returned back to normal. BitMEX engineers are working to separate these systems entirely, so that these particular non-critical operations cannot affect processing time of critical trade requests and logins.

We apologize for the disruption. BitMEX engineers have disabled the cause of the feedback loop and are working the weekend to separate these critical systems so that such an event cannot occur again.

Calling the Curve

The BitMEX Bitcoin / USD 28 December 2018 futures contract, XBTZ18, recently began trading. The following trade ideas assume that spot in the short term will continue to fall and bottom in 3Q2018, and then aggressively rebound into 4Q2018. This scenario also assumes that trader sentiment will not fall out and enter a protracted bear market.

However, if you have very high conviction in that scenario, the riskiest and potentially most profitable strategy would be to:

  1. Go short XBTU18 from now until you believe Bitcoin has bottomed.
  2. Cover the short XBTU18, and then go long XBTZ18.

The reason to go short the 3m initially is that it should be more responsive to spot movements due to its lower time value. It is also more liquid so panicked speculators and hedgers will use that futures contract. Its annualised basis should trade at a steeper discount than XBTZ18.

You go long XBTZ18 on the rebound because it has more time value. If the market does perform as you expect, speculators will bid up the backend of the curve. A lot of things can happen by the end of December. Given that Bitcoin is a call option, the future implied volatility has a greater probability of causing the price to rise rather than fall. The more time value housed in the instrument you are trading, the better change the long convexity can work in your favour.

If you believe this a credible sequence of events, but want to reduce risk, a spread trade is advisable. The reduced risk comes at a the cost of reduced profit potential.

  1. Go short XBTU18 vs. long XBTZ18 from now until you believe Bitcoin has bottomed.
  2. Replace the above short XBTU18 with a short on XBTUSD

Because you expect the sell pressure to happen at the short-end of the curve, the term structure will steepen causing the profit made on the short XBTU18 position to offset losses on the long XBTZ18 position. The term structure chart shown above shows the current curvature of the BitMEX Bitcoin / USD futures markets. It is relatively flat, which indicates now is the time to enter into this spread trade.

This is a price neutral trade; however, be aware that each position is margined separately. Unrealised profit from the short XBTU18 position cannot be used to offset unrealised losses from the long XBTZ18 position.
The second trade is a funding plus long 6m basis trade. As the market rebounds, the swap will be pushed into a premium which means shorts will receive funding. The long end of the curve will also get bid up in annualised basis terms due to the greater time value. You earn money from the swap funding, and futures basis appreciation. Again this trade is price neutral, and you must be cognizant of each positions’ margin.
The reason why I prefer the use of spread trades to express directional moves is that if my prediction is wrong, it does not destroy my capital base. The more conviction around the prediction, the more leverage I employ on each leg to juice up my return on equity.

The Volatility Blues

The anguish experienced by traders worldwide during the $20,000 to $6,000 slide further proves that recently experienced losses matter more than gains. The financial media and many traders forget that 18 months ago the price was $1,000 and then in the fall of 2015 the price was $200.

Jonny-come-lately traders / investors were eviscerated by the recent moves. To make matters worse, the volatility collapsed alongside the price. For crypto, this is deadlier than white wine and painkillers.

But what about adoption? One of the major facets of Bitcoin preventing further adoption is its high volatility. In a pure Bitcoin economy, how can people trade Bitcoin against real goods if its value violently fluctuates? The underwater trader laments that the market just doesn’t get the “fundamental” value of this new transaction network. Well, what transaction network’s monetary token do you know increased 20x in value in under one year? None. Therefore, the driving force is not about current utility but intense speculation on future utility.

Changing the way in which humans use money is an extremely long and difficult process. This process by its nature must be chaotic. Money and the means by which it is handled is personal and sometimes religious. If you tell a society that tomorrow things will be done differently than how they were done over the past 200 years, there will be an intense reticence to change. A violent upheaval is necessary. Therefore, if Bitcoin is to be used in any productive manner, the period leading up to this new epoch must be extremely volatile.

Bitcoin is a call option on a new monetary system. The most important option pricing input is the underlying asset’s implied volatility. As the above chart illustrates, the realised 30-day annualised volatility crashed alongside the price. When volatility returns, the price will go higher.

We Have Been Here Before

The nuclear bear market of 2015 started in January when the price broke $300. For the next 10 months, the price traded between $200 and $300. While that is a 50% range, the daily movements were very slight.

Without volatility, many traders, investors, and market commentators wrote off Bitcoin. Why should one care about an asset that has crashed over 80% from its recent all-time high, and has barely moved since?

Traders returned to the market because the volatility re-emerged. If Bitcoin can gyrate 100% in annualised volatility terms in a 30-day period, then quick gains can be made. The FOMO “investors” who believe they can change their lot in life with little effort and in little time took us from $200 to $20,000. There were not many things that fundamentally changed about the adoption of Bitcoin in real commerce from 2015 to 2017.

Return to $20,000

The path to parity will not begin in earnest until volatility rises materially. People need to be excited again. 10% pump & dumps in one day will bring back the good times. The real questions are what catalyst will start the party again, and how long will it take.

During the 2017 bull market, the effect of global macro events on Bitcoin was forgotten. For 2H2018, a global macro event will have to prove that Bitcoin is a safe-haven asset. In 2015 Greece almost told Frau Merkel to do one, but chickened out at the crossroads. Bitcoin responded positively when the market believed Greece could actually liberate itself. If a similar type scare happened later this year, would Bitcoin regain its safe haven status?

With the Fed, ECB, and BOJ effectively flatlining or outright reducing their balance sheets, cracks in the financial markets will show later this year. Money printing has never led to prosperity in the long run, and when you shut off the tap the ghosts and ghouls of the financial markets will play.

The MSM Still Loves Bitcoin

Thankfully the mainstream financial press loves talking about crypto. The personalities of the leading figures are larger than life. Even at Bitcoin $6,000 and Ether $400 a whole cadre of individuals are generationally wealthy, and are making interesting life choices the media can’t stop covering. In 2015 no one was watching, in 2018 everyone is.

In order to prove their prescience, MSM outlets will fall over themselves attempting to call the bottom in Bitcoin.  The foolish many who believe these pundits actually can divine the future will attempt to knife catch. Many will fail, but if enough try, some will succeed. These successful retail punters will be paraded on the airwaves as trading gods. This will further increase the FOMO, volatility, and price appreciation.

Nothing goes up or down in a straight line. I still haven’t seen enough pain and anguish to believe we are done bloodletting. In true Bitcoin fashion, the price will go to the level no one thinks is possible and rebound faster than traders can work up the nerve to BTFD.

BitMEX Downtime, May 17 2018

Today, May 17, 2018, the BitMEX trading engine encountered several separate and heretofore unpredictable problems, causing feed latency and downtime in spurts throughout the day.

Disks mounted to the main trading engine hardware degraded sharply in performance at roughly 10:00 UTC. This degradation caused feed latency during scheduled archive and reindex jobs, which caused significant backpressure. Disk I/O operations were running at roughly 1/20 of their expected rate.

BitMEX runs redundant drives, but in this case, both drives were simultaneously exhibiting this degraded behavior. We had no choice but to schedule a maintenance downtime to replace them. Unfortunately, backpressure reached critical levels faster than we expected and we moved up our timetable.

At no point was data integrity compromised by this problem, but restoring the machine to a functional state with nominal disk performance took longer than expected to execute and verify.

After this action was complete, we restarted trading. Unfortunately, another problem was uncovered during the next archive, where a reindex job combined with a previously rare request pattern led to unexpected index regeneration and symbol revalidation on specific tables. This led to another backpressure scenario, with similar symptoms.

We have identified and fixed multiple contributing factors to the above behavior. The trading engine team will be closely monitoring engine performance throughout the day while continuing root cause analysis for the slowdowns.

Why UPs?

BitMEX is proud to launch its first optionality products: UPs and DOWNs. This marks a very significant milestone in the product development history of the platform. With futures, swaps, and now options, BitMEX is inching closer to the goal of offering all manner of derivative products for the crypto-coin industry.

Why UPs and DOWNs?

UPs or Upside Profit Contracts, and DOWNs or Downside Profit Contracts are similar to call and put options. One of our biggest strengths at BitMEX is in engaging with the community and listening to our customers, and we have heard the roar for such products as the level of sophistication grows in this industry.

Why Now?

The liquidity profile of Bitcoin derivatives trading has changed dramatically over the past 12 months. The BitMEX XBTUSD Perpetual Swap is now the most heavily traded instrument in the entire crypto trading industry. Average daily trading volumes are in the billions of USD notional.

Before non-linear products like options are viable, linear products (Perpetual Swaps and Futures) must be sufficiently liquid. Given the liquidity profile of XBTUSD and the quarterly Bitcoin / USD futures contracts, we now believe there is sufficient liquidity in order to launch a successful options product.

What’s the Use Case?

Imagine Bitcoin is currently trading at $10,000 and you believe that by the end of the week, it will move 10% higher to $11,000. However, you don’t want any exposure to the price unless it hits your target. Also, you do not want your position to be liquidated before your target is reached, irregardless of the intra-week spot movements. For example, if the price drops to $5,000 but recovers to $12,000 by the settlement date, you will still profit and will not be liquidated.

Hence, you want the ability to participate above your target of $11,000 on the long side. The UPs product allows you to express this view, however this “optionality” comes at a cost which is the premium you pay to the seller of the option.

Why Can You Only Buy?

Selling naked (i.e. unhedged) options is one of the fastest and easiest ways to financial ruin given the potential for unlimited losses. On BitMEX, traders are limited to the margin they deposit on the platform, hence if the seller of the option cannot make good on potential losses, then socialised loss systems will need to be put in place which we want to avoid. As a result, we require sellers of the options to post the full notional value of the UP or DOWN contract.

Because no leverage is offered to sellers, it is very expensive from a capital perspective to make a market. In order to guarantee tight spreads at sufficient size, the BitMEX affiliated anchor market maker will be the only entity allowed to sell options initially.

Many of you may have concerns that the BitMEX affiliated entity is the sole market maker, however here are some points to consider:

  1. As further discussed below, one cause of the engine overload issue is that we have many market makers constantly updating quotes on currently listed products. This consumes a vast amount of precious engine capacity. Until our engine performance is fixed, we refrain from listing any new product that exacerbates the issue. (E.g. this is one of the reasons why we delisted a number of our quarterly altcoin futures contracts, since the volumes they generated did not justify the engine resources consumed.) Hence, if only one market maker quotes on the UPs and DOWNs product, then the impact will not be meaningful on the engine.
  2. The UPs and DOWNs products need to be fully margined. That is, buyers must pay the premium in full and sellers must post the full notional of the option in margin. That means that irregardless of where the price settles, neither buyers nor sellers will ever be liquidated. If the contract settles in the money, buyers are assured they will always receive their profit. Furthermore, this means that the anchor market maker cannot manipulate the UP or DOWN market in any way to liquidate any customer. 
  3. The anchor market maker is tasked with keeping a tight market so that buyers can enter and exit trades as they wish throughout the contract’s length. We want to increase liquidity, having wide markets or an empty order book is not in BitMEX’s interest.
  4. As we respond to customers’ feedback about the products, changes will be made to the UPs and DOWNs contracts. The anchor market maker will be able to adjust to the new product structure faster than any third party. That means that we can fail fast, and relaunch the product quickly with guaranteed liquidity.

What Are We Doing About Engine Performance?

At BitMEX, our top priority is improving the performance of our engine. In a detailed blog post, BitMEX Technology Scaling: Part 1, our CTO Samuel Reed explains in detail the issues we face and what we are doing to resolve these issues. However I will reiterate some points here.

The solution is not as simple as adding more servers or more engineers. The engine has a maximum throughput that is constrained by risk checks and calculations which are performed on each order, position, trade or price change so that we can maintain mathematical consistency on a platform that allows for 100x leverage. We have a two-pronged strategy to solve for this unique problem that BitMEX experiences:

  1. Optimise as many existing functions as possible to obtain efficiency gains. We have been rolling out improvements weekly; however, that extra capacity is consumed very quickly as the demand increases to match engine performance improvements.
  2. Re-architect the engine from the ground up so that the aforementioned issues can be scaled horizontally which will allow for more products and more users without overload issues. This work is ongoing, it won’t be solved overnight, but we are working towards this goal.

I want to emphasise that we will not list any products that worsen engine performance until we increase capacity sufficiently.

Additionally, we are scrutinizing which API users cost us the most in resources. Further API rate limits on traders with non-optimal Quote / Trade ratios are forthcoming. I remember how hard I fought as a CEO to convince traders to provide liquidity on our platform. This action pains me deeply and further sharpens my focus on finding a solution to this problem so that anyone who desires to provide liquidity may do so.

Launching the UPs and DOWNs products does not mean that BitMEX has forgotten or ignored the overload issue. Rather, we must continue to launch and test new products within reason so that in a year’s time we have another wildly successful product like XBTUSD.

If you are a talented engineer who believes he or she has a solution to this problem, we want to hear from you / hire you. Please reach out to us via the careers page or email, and a senior member of staff will review your qualifications or suggestions.

– Arthur Hayes, CEO and co-founder

BitMEX Market Making Desk

We have recently updated our Terms of Service to explicitly clarify the relationship between BitMEX the trading platform, and an affiliated entity that engages in market making.

ToS Update

BitMEX has a for-profit trading business that, among other things, transacts in products traded on the BitMEX platform.  The trading business primarily trades as a market maker. The trading business is organised to be separate and distinct from the platform business. Specifically, no front office personnel are shared between the trading business and the platform, the trading business operates from a separate physical location, and the trading business does not have access to any platform order flow, execution, customer or other information on terms that are not otherwise available to any other platform user. In addition, unless otherwise set forth in the terms of a specific BitMEX product, the trading business receives access and trading privileges only on the same terms as are available to any other user.

Why Market Make?

Early on we discovered that market makers are very fickle. They only want to invest the time connecting to a trading platform that already has flow. What they don’t want to do is try out a new exchange where they must expend resources connecting only to have no takers. Given trades must be collateralised, this reduces their returns.

In order to entice others to provide liquidity, we funded an entity that would quote as soon as a new product listed. As the product became more liquid, this entity would scale back it’s quotes and focus on another product with lower liquidity on the BitMEX platform.

Right now the activity of this affiliated entity is concentrated on the altcoin contracts. XBTUSD and the quarterly Bitcoin / USD futures contracts have plenty of liquidity, and new market makers join every day to beef up those orderbooks. Mission accomplished … for now.

Being able to immediately support a new and illiquid product allows us to experiment with products that other platforms without an anchor market maker cannot. It also speeds up the process to obtaining other 3rd party liquidity providers.

How Do We Align Incentives?

The trading entity is a for-profit operation. However, their earnings are comprised of a service fee paid by the business, that is the BitMEX trading platform. In terms of trading PNL, the market making desk’s goal is to be breakeven.

If the desk is making too much trading PNL, the business will instruct them to tighten spreads and increase size. As a franchise, BitMEX succeeds because of greater trading volumes, not because of the market making desk’s trading PNL.

The market making desk earns the most if the exchange earns the most. That also means that dishonest and manipulative behaviour on the part of the market making desk is not tolerated. As you saw mentioned, the desk sits in a separate physical location. They also have no better information or access than any other trader on BitMEX. If traders feel that the platform is not fair, they will leave, and no one will get paid.

Our lead outside counsel is fully aware of the operation and advises us on best practices to ensure that we place the interests of BitMEX customers first.

What Activities Does The Desk Engage In?

The primary trading activity is providing two-sided liquidity on selected BitMEX products. The desk’s current focus is on increasing the liquidity on the altcoin contracts. The desk will also be the anchor market maker for the UPs and DOWNs products.

The desk also trades OTC with various counterparties globally.

As mentioned earlier, the desk does not engage in manipulative behaviour. The desk does not front-run customers. The desk does not manipulate either the market on BitMEX or the underlying exchanges for the purposes of stop loss hunting, or causing cascading margin calls.

None of this behaviour has occurred in the past, and if such behaviour is discovered, those responsible will be terminated immediately for cause.

Who Runs The Desk?

The head trader is Nick Andrianov. He is a former Deutsche Bank equity flow and exotics options trader. Nick and I have known each other for over ten years. His integrity is unquestionable.

Nick receives the business objectives from various senior members of BitMEX. The business and the market making desk work closely with the express goal to make every single BitMEX product as liquid as possible.

Financial Risks

Trading losses incurred by the market making desk will not affect the solvency of the BitMEX trading platform.

As stated above, the market making desk sits within a separate entity. Their goal is to provide liquidity to BitMEX and the wider crypto capital markets.

– Arthur Hayes, CEO and co-founder

BitMEX Technology Scaling: Part 1

Hi there – I’m Samuel Reed, CTO of BitMEX.

It’s been an incredible journey over the last four years building BitMEX. When we started, I don’t think any of us could have imagined the success this platform would achieve or how it would come to dominate Bitcoin/USD trading in 2018.

From 2014 to today, the BitMEX platform has grown from zero to an average of $3B of trading volume per day. Our flagship product, XBTUSD, trades more than any crypto product in the world. We serve customers all over the world, in five languages, and have become the premier platform for Bitcoin price discovery and liquidity.

The BitMEX team has been hard at work improving capacity, building a solid mobile offering, and creating a tech team that is truly best-in-class. We are not resting on our laurels, enjoying this success for the sake of it. Quite the opposite: we’ve been busier than ever.

We’d like to let the community in on how we formed and how we’re moving forward. As was wisely said: “In order to defeat the bug, we must understand the bug.”1


I’ll begin with a true story.

Source: russellfreeman.com

In 2014, I was speaking at a web development panel in Hong Kong for General Assembly, a coding bootcamp. They wanted to give their soon-to-graduate students a taste of what it was like to work professionally. I took the opportunity to talk about my history: a career made of positions in several small businesses, startups, and government – with an emphasis on how incredibly in-demand software engineers are.

A rather loud personality in the back asked a question: “How do cash-poor startups looking for a CTO make a case? How do you attract great talent in such a competitive atmosphere?”

“Well, that’s a good question, and a tough answer,” I said. “Without funding, you have the challenge of a serious risk versus a sure thing. Why should any experienced developer forgo $200,000 or more at a large tech company, in a comfortable, resource-rich environment, to work 80 or more hours a week? You essentially have to find some bozo” – I really said this – “who believes in your idea so much he’s willing to take the risk despite so many better options.” I wished him good luck and we continued the panel.

He came up to me after the panel and told me he wanted to do a Bitcoin derivatives exchange. I knew then: I was that bozo, and Arthur Hayes and I were to become business partners.

Without any major funding, we brought an alpha online within six months and started with the BitMEX Trading Challenge, an no-rules trading competition where we put the exchange through its paces. And it really was no-rules (aside from multiple accounts) – hacking the site would win you the prize. We paid out a few Bitcoin in bug bounties in those days but we didn’t have any major failures.

Much to the annoyance of my wife, we launched BitMEX on during our honeymoon in Croatia, on November 24, 2014. Ben and Arthur celebrated separately, in Hong Kong. Notice the original trading interface in both photos. You can still read the original Trollbox messages from that day.

November 24, 2014, Dubrovnik, Croatia.
November 24, 2014, Hong Kong.


Building BitMEX, 2014

All projects are a product of the time in which they are built. In early 2014, the crypto ecosystem was reeling from the vacuum Mt.Gox left behind. The focus at the time was not “proof of work” vs. “proof of stake”, as it is today, but a forgotten term called “proof of reserves” – just Google it and look at the timestamps of all the popular posts. In fact, a question about this was the top-voted comment on our Reddit launch announcement.

The first rule of running a Bitcoin exchange is, and always has been, “Don’t lose the Bitcoin.”

This rule pervades everything we do at BitMEX. It permeates our policy, even today: we still use a 100% cold wallet where every transaction is multisig. Look up a 3BMEX transaction on the blockchain, and you’ll see it. For 1,250 straight days (!), at least two out of the three of us have gotten up, read the day’s withdrawals, done our risk checks, and signed, to be passed onto the next partner for signing and eventual broadcast.

At the time, I thought users would resist this. Yes, Bitcoin is better in so many ways than any monetary system that has come before it. But it is weaker too. Custodianship is an unsolved problem that requires constant vigilance. I think our customers know this and appreciate it. In our early days, we received a large number of complaints about withdrawal times. Today, where we are the largest exchange by volume in the world, we receive barely any. People get it – caring for your deposits this way is not easy. We do it not because it is convenient, but because it is safe.

BitMEX in 2014.

The atmosphere in 2014 influenced how we built BitMEX. My frontend experience lead me to adopt ReactJS for the frontend. BitMEX was the first exchange to launch with it, a choice that has paid dividends well into 2018.

We were also the first – and likely still the only – exchange to build our matching and margining engine on kdb+/q, a technology traditionally used for querying of large-scale time-series data. It’s a natural fit. It’s fast (bear with me), using SIMD instructions to greatly boost throughput, it’s flexible, and it’s accurate. Kdb+’s flexibility and speed allowed us to pivot our product offerings twice: from low-leverage inverse and quanto futures to high-leverage ones, and from high-leverage futures to our flagship product, the XBTUSD Perpetual. We also pivoted loss-recovery mechanisms twice, from guaranteed settlement, to Dynamic Profit Equalization, to ADL.

BitMEX is a company known for listening to its customers and adapting. This required flexibility, innovation, and a lot of sweat equity from everyone on the team, and we’re so proud of how far it’s come.

Now, it wouldn’t be fair to come this far without addressing the title of this post. BitMEX now trades as much as US$6.5 billion per day. Our most recent 1-minute record was US$35 million, a number that is higher than the entire month of April 2016.

The highlighted month, March 2016, had 16M of volume on XBTUSD. XBTUSD now peaks at double that in just one minute.

The following charts show monthly turnover in increasingly large timescales, to highlight detail completely lost in the overall view:

To understand why BitMEX is experiencing slowdowns, despite using a solid technology like kdb+, it’s important to understand what BitMEX does differently than other exchanges.

100x is a number that elicits a large number of reactions, ranging from “are you crazy?” to “how is this possible?” It is only possible due to incredible financial engineering from our co-founder and CSO Ben Delo. Ben is a diligent and brilliant mathematician. He built a perfect mathematical model for trading, a constantly-coherent system that continuously audits all trades and always sums to zero. Transactions don’t get lost in the BitMEX engine. A user’s balance never goes negative. There are entire classes of bugs that are common on other platforms that never occur on BitMEX, and it is that attention to detail that makes all the difference. Mark/Fair Pricing, the weighted ADL system, perpetual contract funding rates, and live isolated/cross remargining are all new, novel concepts that did not exist before BitMEX.

This consistent coherency inside the BitMEX engine makes 100x possible. Kdb+ has historically been fast enough that we can continuously remargin all positions upon each and every price change. This provides the safety and speed necessary to not only survive within the razor-thin requirements of 0.5% maintenance margin, but thrive. The BitMEX Insurance Fund, a fund that guarantees settlement of BitMEX contracts, contains (at the time of writing) an incredible 6,149 XBT, over US$50M. Competing firms have insurance funds in the single digits of Bitcoin, despite offering as low as only 20x leverage.

BitMEX won’t sacrifice safety for speed. The security of our users’ funds and confidence in their trades is paramount. But we hear all of you: you want to trade faster, you want freedom from “System Overload” messages, and we will give that to you.

Since late 2017, the BitMEX team has refocused on engine performance as our highest priority. We have built, and are continuing to build, a team full of the top professionals in the space. This team works hard, building capacity for the next 100x increase in trading volume.

In the second part of this series, I’ll explain in-depth:

  • How the BitMEX engine processes orders and remargining
  • How real-time messages flow through our system to your browser
  • How BitMEX uses API-first design to provide the most powerful API in the business
  • Performance charts showing hot-spots, peak versus baseline load, and corner-cases
  • A breakdown of the dreaded “System Overload” message, and how it is generated

In the third part, I’ll also explain:

  • Performance numbers showing how capacity has increased since 2017
    • We have made large strides in the past months – but demand has increased to match
  • Roadmaps and pending work for Q2
  • BitMEX’s vision for the future of online derivatives trading

Thank you to all of you for being a part of BitMEX’s success. Ben, Arthur and I feel fortunate than to be a part of such a great company: our customers, team, and market opportunity are simply best-in-class.

Reach out to me directly on Twitter at @STRML_ and on Telegram at STRML. I also occasionally talk with traders on the Whalepool TeamSpeak, a fun community of traders that have given great feedback and encouragement to BitMEX for years.

A common sight from the window of the Dubrovnik apartment where BitMEX was launched.

1 – Starship Troopers was ahead of its time with its views on software development.

A Note on Recent ETH Liquidations

At 02:22 UTC on April 15, 2018, the ETHBTC on Poloniex crashed approximately 18% from 0.063 to 0.052. The Poloniex price is used as 100% of the index price (.ETHXBT30M) for the ETHM18 contract.

Crypto trading is very risky and underlying prices are highly volatile. While this type of movement is unexpected and undesirable, the price on BitMEX accurately reflected the price on the underlying spot market throughout this crash and recovery. Due to BitMEX systems functioning as expected and according to specification, there will be no refunds of losses sustained due to liquidations.

Index stability is important to us. BitMEX will continue to evaluate if adjustments are needed to existing index compositions. The liquidity of crypto spot markets is constantly in flux and can change significantly over the lifetime of a quarterly contract. Poloniex hosts one of the most liquid ETHBTC markets (note, not ETHUSD) in the world, but this unexpected action has triggered an internal re-review.

The Index Price is used as the central calculation for marking BitMEX futures. This Mark Price is used for margin calculations, which trigger liquidations. More information is available here.