Carbon: Onchain Trading

In Human Terms

Jen Albert
CarbonDeFi
Published in
7 min readFeb 3, 2023

--

A friend recently asked me to explain Carbon “in human terms”. I couldn’t quite decide on the best approach until I remembered seeing a tweet by Danger, a well known “DeFi analyzoor” and creator of the “Today in DeFi” Substack. I had never seen someone calling for Carbon in such black and white before, in such human terms, visual and all. With his thread as my guide, I hope to provide an easily digestible explanation of what Carbon is, what problems it solves, and why I see Carbon’s innovations as quite possibly the major game changer DeFi needs.

One Sided Liquidity

One of the biggest issues DeFi users face is providing liquidity in a single token, especially for advanced trading; Danger states that it is not currently possible to provide a single token as trading liquidity. Before getting too deep into this though, a look first at the chart he provided and the process involved in creating a range using a traditional order book system.

Traditional Order Book: Range Creation

The chart shows the price of BAT experienced a significant drop of around 50%. Danger seems to be planning to sell his BAT for USDT if the price trend reverses and continues climbing upwards. He placed 19 individual sell orders to take profits on the way up, represented by the 19 red rectangles on the right side of the chart. Each rectangle represents a specific amount of BAT tokens being offered for sale by the trader, along with the corresponding USDT price. In the example above, each of the orders consist of 60.64 BAT tokens, ranging between $0.4157-$0.6787 in price, for a total of 1,152.16 BAT tokens up for sale. This illustration is perhaps typical of how traders use traditional order book systems to create their own sell ranges.

As you can see, the process of creating a range using limit orders on a traditional order book system involves several factors that traders must consider. These include the number of orders to be created, the amount of liquidity to be allocated to each order, the initial investment, and the expected return on investment. While this method is effective for scaling in or out of a position, it is also tedious and time-consuming.

Carbon: Seamless Range Order Creation

Carbon offers a more efficient alternative to traditional order book systems. What took Danger 19 limit orders to accomplish can easily be achieved in 2 steps on Carbon. Simply set the same custom price range with two fields ($0.4157 and $0.6787) and then supply the 1152.16 BAT…DONE! Remember, we’re keeping this in human terms so for those interested in the mathematics and mechanics of Carbon order execution, please visit the Carbon whitepaper.

Carbon: Disposable Strategies

If Danger’s only intention was to trade BAT for USDT within a specific price range, then the 19 limit orders was the extent of his trading these two tokens. On Carbon, this is referred to as a “disposable strategy”, meaning it is meant for one-time use only. Disposable strategies may be made up of a limit order set at a specific price or a custom price range. However, if Danger chose to continue with a “buy low, sell high” BAT/USDT range trading strategy, the process would be much more involved, at least when using a traditional order book system rather than Carbon.

Traditional Order Book Systems: “Buy Low, Sell High” Range Trading

As noted above, Danger created a range comprised of 19 limit orders. The first limit order was set to sell 60.64 BAT at a price of 0.4157 USDT per BAT, totalling about 25.21 USDT. When that order was filled, Danger’s account was credited with 25.21 USDT. If he wanted to use his newly acquired USDT to rebuy BAT at a lower price, he would first need to wait for each individual order to be filled before repeating his original process of creating 19 additional limit orders.

This outlines one of the major challenges with traditional order book systems. In order for Danger to have successfully sold in the high range and repurpose his USDT for buy at the low range, he would have had to continuously keep track of when his sell orders filled. He would then have to quickly set up the BAT buy orders before the market entered his desired buy range. A process requiring a total of 38 orders and constant monitoring. Carbon provides a unique, automated, alternative to recreating dozens of orders and competing against the market in a race of “who gets there first”.

Carbon: Linked Orders, Rotating Liquidity, and Recurring Strategies

First a quick recap:

  • In order to create a sell range between $0.4157 and $0.6787, Danger created 19 individually-funded sell orders. On Carbon, he would have created just one order with $0.4157 and $0.6787 as his custom parameters.
  • In order to create a range to begin rebuying BAT below $0.4157 on a traditional order book system, Danger must then create an additional 19 buy orders. On Carbon, this would again, only be one.
  • When a trader is using a traditional order book system, they must wait for each order to fill in order to acquire their USDT. Only then can they create a buy order using that same liquidity. On Carbon this is not the case. The buy and sell orders, limit and/or range, are linked, and therefore draw on a single source of liquidity that automatically shifts into each order as it is filled.

Let’s break this down a little further. If Danger continued with a buy low, sell high range trading strategy his 19 sell orders would not be automatically connected to his 19 hypothetical buy orders.

Traditional Order Book: Buy Low, Sell High Range Trading Strategy

  • Create and fund a sell order at 0.4157 USDT
  • Create and fund a sell order at 0.4303 USDT
  • Etc, etc 17 more times
  • Wait for the first sell order to fill
  • Create and fund a buy order at 0.3600 USDT
  • Wait for the second sell order to fill
  • Create and fund a buy order at 0.3560 USDT
  • Etc, etc 17 more times
  • Wait for the first buy order to fill
  • Create and fund a sell order at 0.4157 USDT
  • Wait for the second order to fill
  • Create and fund a sell order at 0.4303 USDT
  • Etc, etc 17 more times

In order to execute the strategy above, Danger would be required to take 57 steps, with an additional 19 steps taken each time he wishes to create a buy or sell range again. On Carbon, these two orders are automatically connected and would require only 3 steps!

Carbon: Buy Low, Sell High Range Trading Strategy

  • Create a sell range with the parameters set at 0.4157 and 0.6787 USDT
  • Create a buy range with the parameters set at 0.3600 and 0.2800 USDT
  • Fund the sell order with 1,152.16 BAT

Done! The USDT acquired from the filled sell order automatically funds the linked buy order. As orders are filled, the liquidity continues to rotate between the buy order and the sell order; hence the term “rotating liquidity”.

Carbon: Recurring Strategies

This type of automated strategy, with linked orders and rotating liquidity, will persist for as long as the creator of the strategy chooses, with no additional steps taken. Due to its continuous behavior, it is referred to as a “recurring strategy”. In this particular case, our recurring strategy is known as a “recurring fade”.

Carbon: One Sided Liquidity

Carbon simplifies the trading process by requiring only 3 or 4 steps for all strategies. With reference to Danger’s tweet, Carbon is “[…] a good way to provide one sided liquidity yet in DeFi”. As previously explained, a trader only needs their own asset(s), such as BAT, to start trading on Carbon. Additionally, the design of Carbon prevents traders from being exposed to undesirable consequences arising from the prototypical concentrated liquidity paradigm, as featured in Danger’s own commentary: “[not a range order] that only fills on toxic flow and reverts when the price goes in your favor”.

Should a trader choose to fund the buy and sell orders in a strategy, they absolutely have the ability to do so. Not only that, they have the ability to allocate their liquidity in whatever portions they choose, whatever ERC20 combination they choose. Still irreversible and MEV resistant. Carbon is an on-chain trading protocol developed to give traders exactly what they are asking for (quite literally, in Danger’s case).

Related Content

Additional Resources

--

--