The curious case of the Bitcoin Lightning Network and the algorithmic trader

5 min readDec 14, 2021
It’s Pepe, the algorithmic trader.

As the Lightning Network steadily moves towards web 3.0 with support for smart contracts and tokenised coins, one of its core strengths will still be its speed. This is one of the reasons exchanges like Bitfinex and Okex were quick to adopt it.

In the ‘Are You Using Your Capital Efficiently?’ article, I highlight that by using the Lightning Network, all types of traders are able to manage capital more efficiently and execute trades faster. But what does that look like in practice? In this article, I explain what the Lightning Network’s speed means for algorithmic traders.

What Affects the Typical Algorithmic Trader?

The most foundational algorithmic traders are arguably the market makers, also called liquidity providers, who quote buy and sell prices for marketable assets. While there are many that do this strategy, including reputable companies like Jump Trading, Cumberland, B2C2, there are few large market makers using Lightning. But just like Okex and Bitfinex, some growing trading firms see the benefits the network provides and are starting to integrate with it.

Instead of speaking anecdotally, I decided it would be better to sit down with Peter Opara of Orcabay, a market maker actively experimenting with Lightning.

Like many algorithmic traders, Orcabay’s market-making strategies require them to open and maintain futures positions, often with bitcoin. But during periods of volatility, they need to either lower their positions, or to increase the amount of bitcoin held as collateral in a position (margin). In an ideal world, the trader would not leave a single satoshi in excess on the exchange unless it is absolutely necessary. However, it isn’t an ideal world, and this isn’t the case for many cryptocurrency market makers.

Extra bitcoin is frequently left on exchanges to facilitate a quick margin top up in the event of a large price movement, which can leave positions vulnerable to liquidation. Typically, excess margin may need to be sent intra-exchange in order to add more margin to another open position. With blockchains normally extremely busy at these times, it’s typically impossible to update the margin balance of a position faster than the market can move against it. Peter puts this simply as: “When we’re using on-chain transactions, if blocks are not mined quickly enough or the market moves too quickly, then we could end up needing to wind down a position or get liquidated”.

Reducing their positions in order to avoid liquidation will lower their already-thin profit margins. When faced with such a scenario, according to Peter, they would simply stop quoting whenever they can’t quickly transfer bitcoin to an exchange fast enough. However, thanks to the Lightning Network’s speed, this is avoidable.

The Lightning Network for the Algorithmic Trader

The Lighting Network is capable of sending bitcoin at a speed of 500 transactions per second right now. This speed only increases with each update, with some estimating that 40,000,000 transactions per second is theoretically possible. Because of this, Orcabay suggests they can completely rethink bitcoin-settled trading strategies that require more than one exchange. To illustrate this, Peter walked me through one of their testing scenarios.

Orcabay wants to open $1M BTCUSD futures positions spread across two exchanges at a bitcoin price of $60,000, but they do not have $1M worth (i.e., about 16 bitcoins). Therefore, they will need to use leverage.

But Orcabay has a low risk tolerance for some trades, requiring them to maintain a margin buffer of 30% on the exchange if a position is open. Meaning, they hold more bitcoin than is needed on the exchange to cover scenarios such as the price of bitcoin swinging 30% in the opposite direction of their trade (resulting in their position being liquidated). In order to maintain the 30% buffer in this example, it would necessitate them to deploy a minimum of 5 bitcoin (30%) to both exchanges.

But by using the Lightning Network, Orcabay found they could reduce their risk buffer, or the amount of bitcoin they held on the exchange in this scenario, to 5%. This is because they were able to move from their own Lightning-enabled wallet to that of the exchange without having to worry about transaction delays.

On-chain, Orcabay required 5 bitcoins (30%).

With Lightning, they only needed 0.83 (5%).

Intrigued, I asked Peter if they could go even lower than 5%? Isn’t the lighting network’s speed sufficient to allow them to leave almost nothing on the exchange?

While they believe and expect to be able to leave only a minimum amount or no bitcoin on exchanges in the future and “expect fewer liquidations across venues where Lightning is integrated” as a result. Today, they want to mitigate any small chance of not being able to update their margin balances fast enough. If, for instance, a market event were likely to reduce their or the exchange’s Lightning node’s inbound or outbound capacity below their requirements. Or in other words, they’re scared that a black swan event may cause many traders to deplete the Lightning channel capacity of the venue they’re trading on faster than the venue can rebalance. Right now, leaving a small buffer on the exchange is a risk management measure.

Beyond Updating Account Balances

Rebalancing instantly has its benefits, especially when you consider the examples above, which revolve around margin management. Right now, the two most popular forms of margin management across exchanges are isolated and cross.

Right now, we’re taking isolated margin a step further on Kollider. We allow a user to update their isolated margin balance in real-time without needing to transfer bitcoin to a holding wallet prior to opening a position. This means that for rebalancing margin on positions, we allow the margin of the position to be added or removed directly and instantly. In practice, this means that a trader can transfer or remove margin directly on a position 500 times per second, even by the single SAT, if they wish.

Even though the Lightning Network is currently in infant stages, it is still enabling algorithmic traders to improve their efficiency now. To judge it purely based on what it does today is not the right approach. Exchanges like Okex, Bitfinex, Nicehash and Kollider are experimenting with Lightning not only because we believe Lightning will enhance the experience for all traders, but because we also believe Lightning can enable a web 3.0 to be built on top of Bitcoin.

Looking for more articles like this? Follow Kollider on Twitter

Want to connect to Kollider’s Lightning Node? Open a channel




Building new ways to access cryptocurrency markets.