Decentralized Derivatives Clearing Part 1

Autonity Protocol
11 min readSep 20, 2024

--

Note: (This is the first in a 3 part series exploring Autonity’s Decentralized Derivatives Clearing model. Autonity is a public, EVM based, proof-of-stake blockchain for decentralized clearing of smart derivatives contracts. Find out more)

Introduction

Vertical integration of derivatives trading and clearing logically centralises (see Vitalik’s post The Meaning of Decentralization) the trading of a contract in a single trading venue, turning the contract into a venue-exclusive financial product. In TradFi this typically results in a market structure where for any given underlying, there is a single contract that everyone trades through a monopoly venue-cum-clearing silo. But in DeFi, vertical integration leads to a market structure where multiple incompatible contracts on the same underlying exist across competing, vertically integrated silos. This fragments market liquidity, to the detriment of DeFi market participants.

We propose a model of decentralized clearing where trading protocols are decoupled from clearing, enabling market participants to trade a single contract (for each underlying) across multiple trading venues that permissionlessly interface with the Decentralized Clearing System (“DCS”) for that derivative product on the Autonity blockchain.

For derivatives on crypto assets, both the off-chain and on-chain DeFi varieties have embraced a market structure that combines trading and clearing in a vertically integrated stack. The consequence has been a market that is highly fragmented and far more centralised than it can be.

Key Concepts

Markets are where people trade things. Typically the “things” are assets (money, stocks, bonds, commodities, tokens, etc.) and trade execution is the stage in the trade lifecycle where buyer and seller agree on a price and a quantity. Trade settlement comes after trade execution, and this is the event where the things traded are actually exchanged between buyers and sellers. The key point here is:

Trade and settlement are distinct steps.

When the thing traded is an asset, settlement is the final step in the trade lifecycle. Upon settlement, buyer is in possession of the thing bought, seller is in possession of the quote asset, and the deal is “done”.

But assets are not the only thing that is traded. A derivative contract is an agreement between two parties to exchange some future payoff(s) derived (hence the name “derivative”) from some other underlying value. Here the thing that’s traded is a contract rather than an asset.

The settlement of derivatives contracts is a more involved process compared to the settlement of an exchange of assets. In fact, a derivatives contract involves multiple settlements (posting initial margin, paying variation margin, etc) over the contract’s lifespan. So the first settlement after a derivatives trade marks the beginning of a lifecycle rather than the conclusion of one. This post-trade stage of the derivatives lifecycle is referred to as clearing.

For derivatives on crypto assets, both the off-chain and on-chain DeFi varieties have embraced a market structure that combines trading and clearing in a vertically integrated stack. The consequence has been a market that is highly fragmented and far more centralised than it can be.

To understand why this is the case and how we can do better, we need to review the key concepts of derivatives clearing.

Contract duration

Derivatives have a duration or lifespan. In TradFi, most derivatives contracts have a expiration date (which can be up to many years into the future), by which date the contract terminates. Some contracts can even be perpetual and never terminate. Perpetual (aka “infinite”) contracts are the dominant paradigm in DeFi derivatives. ¹

Derivatives positions

When two parties trade derivatives contract, there is still a buyer and a seller, but the meaning of buying or selling a derivative is different from buying or selling an asset. When you buy a derivative you are either increasing a net long position or you are decreasing a net short position. When you sell a derivative you are either increasing a net short position or you are reducing a net long position. So from the perspective of either of the sides to a derivative trade, there are four possibilities, depending on whether the trader already has a net position.

Effect of a trade on an account’s position.

The positional dimension to buying and selling is typically unknown to the other side. If Alice buys and Bob sells a contract, Alice does not know and does not care if Bob is increasing a short position or reducing a long position; and Bob does not know and does not care if Alice is increasing a long position or reducing a short position.

The trade has a quantity as well as a price. This quantity is sometimes referred to as the notional amount, sometimes as a number of contracts. We will just refer to it in this note as “quantity” and stipulate that buy quantities have a positive sign and sell quantities have a negative sign. The net total of all the trade quantities for a trader is the trader’s net position. Positive means “long net position”, negative means “short net position”, 0 means “no net position”.

If offsetting long and short positions do not terminate, a trader may still have a gross position even though the trader has no net position. As we will see below, the mechanisms by which gross positions are terminated/compressed to match net positions is a key problem that different derivatives market structures aim to solve in different ways.

Open Interest

At any point in time, the sum of all participants’ long positions and the sum of all participant’s short position equals the same number. This number is called the market’s open interest. How does this number evolve over time? Consider two polar scenarios:

  • Gross positions are never terminated to match net positions. In this case the open interest of a contract increases upon every trade and only decreases (to zero) when the contract expires.
  • Gross positions are always terminated early to match net positions. In this scenario, upon every trade, open interest will either increase by the trade’s quantity, decrease by the trade’s quantity, or remain unchanged.

This second scenario describes how open interest works with exchange traded derivatives (“XTDs”). Somewhere in between the two scenarios describes most OTC derivatives, as we will explore in more detail below.

Linear and Non-linear derivatives

We mentioned above that a derivative contract is “an agreement between two parties to exchange some future payoff(s)”. The payoff function can be either linear or non-linear with respect to the underlying, and this distinction is very important.

  • Examples of linear derivatives: futures, forwards and CFD’s
  • Examples of non-linear derivatives: options and most swaps

In the interest of fixing intuitions on key concepts, we are assuming linear derivatives throughout this note. It is easier to explain how smart linear derivatives work, and linear smart derivatives will be the product types that will probably first exist on the Autonity blockchain.

Note that linear derivatives are sometimes referred to as “delta-one” contracts in both TradFi and DeFi. In quantitative finance, delta is the sensitivity of the derivatives value to changes in the value of its underlying. So “delta-one” refers to the fact that these contracts are designed such that changes in the market value of these contracts are approximately equal to changes in the market value of the underlying.

Who is your counterparty?

Contracts are by definition agreements between two or more parties. So if the thing that is traded is a contract (rather than an asset), it is natural to ask: who is your counterparty?

For example, assume Alice has opened a long position in some contract by trading with Bob, who opened a short position. What if Alice later sells the contract? Does she need to trade with Bob again to “cancel” the original contract? And if she trades with Claire instead, does Claire now have the contract with Bob or does Alice now have two agreements, one with Bob and another with Claire, that offset each other economically (no net position) but are still in force until both contracts expire? As you can see, there is a lot to unpack in this concept of trading a contract compared to trading an asset.

In TradFi, the answers to these questions depend on what type of derivative it is. We can partition TradFi derivatives into two separate categories:

  • Exchange Traded Derivatives (“XTD”)
  • Over-the-Counter Derivatives (“OTC”)

With an XTD derivative like a futures contract the answer is pretty simple. When Alice bought this contract on the exchange, there was a Bob on the offer side of the market. But the contract they traded was immediately novated ² to the exchange, so Alice ends up with a contract with the exchange and Bob ends up with a contract with the exchange.

Position Netting via CCP

This is a significant, additional function being played here by the exchange. In addition to being the trading venue where Alice and Bob can discover each other and trade, the exchange is also acting as a Central Counterparty (“CCP”). A CCP is buyer to every seller and seller to every buyer. The CCP is not participating in the trading, it always has a net flat position, with shorts perfectly offset by longs. So even though the CCP is the counterpart to everyone, the CCP is not assuming any market risk. ³

And the benefits of this arrangement are significant. When Alice later sells the contract, she ends up with both a long position and a short position with the same counterparty (the exchange), even though Bob was on the other side of her buy trade and Claire was on the other side of her sell trade. Having all the contracts that are traded immediately novate to the CCP means that Alice’s long position contract and her subsequent short position contract net to zero and are immediately terminated.

With a CCP gross positions are netted automatically, which means that the open interest has the following tidy relationship that we referred to above:

OTC derivatives do not work like this. When Alice goes long via a trade with Bob in the OTC derivatives market, Alice and Bob have a contract between themselves. When Alice later trades a short position with Claire, she has a second contract with Claire. Her long position is not “reduced” by her short position with Claire, as was the case in the XTD example. Instead, Alice merely has two offsetting contracts that together leave her with no market risk, but her contracts with Bob and Claire still persist. The open interest has actually increased rather than reduced.

When the contract’s value goes up by X, Bob is paying Alice X and Alice is paying Claire X, and vice versa when the contract’s value goes down. Alice is now basically a cash flow conduit between Bob and Claire. It would be better if Alice could somehow step out of the equation and let Bob and Claire face each other directly. There are basically two ways to turn offsetting OTC derivatives positions into positions that net to zero and disappear.

Multilateral Position Compression

position balances under hypothetical derivatives compression cycle

The first is a post-trade compression service. Traders like Alice who have offsetting positions submit them to a service that finds cycles of positions. For example, Bob eventually trades a long position with Dave to offset and exit his short position. When this happens, the compression service will find a cycle of contracts where every counterparty has a zero net position. And through some legal magic, all contracts in the cycle get terminated and the counterparts in the cycle have their respective offsetting positions netted to zero. It might take some time for this to happen though.

The other solution is for OTC derivatives to novate to a CCP like XTD derivatives do. Alice and Bob trade with each other wherever and however they want, but part of the contract they trade stipulates that both must immediately novate their contract to the same CCP. As with the post-trade compression service, there is a centralised third party that is a constitutive part of the market structure. But the point of entry with this third party is immediately after trade execution in the case of the CCP, whereas you only interact with a trade compression service once you have a portfolio of offsetting positions in the same contract.

Netting vs Compression

On first appearance, it might seem like this discussion of netting vs compression is a TradFi complication that can be ignored in DeFi, given that derivatives in DeFi rely on smart contracts rather than legal contracts. But that view is mistaken, as the essence of the distinction between netting and compression does not actually exist in the law or institutional make up of TradFi derivatives markets. The essence of the distinction exists in how a derivatives market handles counterparty risk, and counterparty risk exists in cypherpunk anarchy every bit as much as much as it exists in TradFi.

When the losing side of a derivatives trade fails to settle its variation margin call, the mechanisms available to the winning side are basically:

  • auction off the losing side’s position to another party ⁴ and fund any losses out of the defaulting side’s collateral;
  • cancel the contract and use the defaulting party’s collateral to compensate the winning side for the replacement cost.

The initial margin posted by the losing side is used as a capital buffer to fund either of those mechanisms. But if that collateral is insufficient, we call the position bankrupt and it is a mathematical fact that there is a loss that has to be absorbed by someone.

Without netting, the loss is born by the other side to the bankrupt side’s contract. If Alice and Bob did the deal, and Bob is the one who fails, Alice is the one who will absorb any losses not funded by Bob’s collateral. This situation still holds when multilateral position compression is used, as the counterparts still bear their respective counterparty risks until the cycle is found. ⁵

But with CCP-based position netting, the loss must be mutualised somehow. The same mathematics that makes CCP netting quick and efficient is also the mathematics that erases the bilateral trading graph that internalises counterparty risk between the parties that traded with each other and avoids mutualisation. With CCP netting everyone with an open position on the winning side of the market is potentially exposed to the losses of the bankrupt position.

So there’s a tradeoff here between the efficiency benefits of netting versus the downsides of risk mutualisation. Also, it is not a tradeoff that can be considered in the abstract, as there are many different ways to mutualise counterparty risk, which presents a tradeoff space on its own ⁶

Whilst to our knowledge never explicitly acknowledging it, DeFi derivatives protocols to-date have followed a “peer-to-pool” model of counterparty risk that is functionally equivalent to CCP netting, except that the function performed by a CCP is replaced by a smart contract. Autonity’s approach to decentralized derivatives clearing will also use a netting mechanism.

(This is the end of Part 1, to read part 2)

Footnotes:

¹ — There may also be early termination clauses in the derivative contract, like early exercise options, path-dependent knock-out conditions, underlying default events, etc.

² — Novation in contract law is the principle where one party to a contract is replaced by a third party, while the other original party remains in place.

³ — But it is assuming counterparty risk with the entire market. More on this later.

⁴ — This is basically the various “auto-liquidation” mechanisms used in DeFi derivatives protocols

⁵— But once a cycle is found, all the deals are terminated and there’s nobody to default on, by definition.

⁶ — For example, every open position on the winning side of the market could have its position forcibly reduced pro-rata, to close out the bankrupt’s position; or you could rank position by their age, or the amount of clearing fees paid by the counterpart, or some other variable and apply a loss absorption waterfall; or any number of other mechanisms.

--

--

Autonity Protocol

Autonity is an EVM based public blockchain for decentralized derivatives clearing.