How DeFi’s Liquidity Contraction Breaks Liquidation Bots

Yaron Velner
B.Protocol
Published in
7 min readJun 6, 2022

Tl;Dr

It is unclear if the recent liquidity contraction on most alt L1s and L2s is a result of the LUNA/UST crash, fears of global recession, a combination of the two, or other unknown factors. What is clear is that DEX liquidity on some networks became too thin for liquidation bots to execute liquidations on DeFi lending platforms.

As liquidation bots usually don’t hold up-front capital but rather use flashloans to wipe out risky positions from lending markets, when the DEX price impact (aka slippage) created by the flashloan is bigger than the liquidation discount given by the platform, the liquidation operation becomes un-profitable to execute. This leaves the lending platform with the risk of accruing bad debt in its system. Lending platforms can uncouple their dependency on DEX liquidity and the bots that utilize it, by integrating a backstop.

Intro

We all know by now that crypto in general, and DeFi markets in particular, live in cycles of expansion and contraction. The best measurement, or at least the easiest, to track cycles in DeFi is TVL — Total Value Locked , which shows how much liquidity is deposited in on-chain protocols.

Liquidity is King. And when the king is naked, or weak, the kingdom is unsettled. During the last two months, and more clearly since the LUNA/UST crash, we have witnessed a major “Liquidity Contraction”, with total TVL across DeFi cut in half, going from $280b on April 1st, down to $140b on May 31st. This low liquidity impacts the functionality of several “money lego pieces”, including those less talked about — liquidation bots.

DeFi Total TVL, Source: DeFi Llama

Borrowing — The Basics

Lending and borrowing activities account for 17% of the total TVL in DeFi as of the end of May 2022 — representing just above $24b. Second only to liquidity in decentralized exchanges (DEXes) which account for 25% of total TVL. Let’s make a quick dive into how this actually works.

Borrowers on over-collateralized lending platforms, such as Compound and Aave, deposit assets that are used as collateral for them to borrow against. The deposited collateral is used as an assurance for lenders that their lent tokens will be repaid by the borrowers. In cases where a borrower’s loan is crossing a safety ratio to the value of the deposited collateral (LTV — Loan to Value, sometimes referred to as CF — Collateral Factor) — a liquidation should be executed in order to prevent any losses to the lender.

Liquidations — The underground sewage system of DeFi

With bad public relations and the source for some of the best horror stories, liquidations in DeFi can be described in a way as the sewage system of DeFi. Just like the sewage system is one of the most crucial infrastructure pieces in any city, something you wouldn’t want to see broken, or even malfunction for too long, so are liquidation systems.

Liquidations make sure the risky loans and positions are being cleared from the market so others can continue to use it in a safe manner. Still, much like the sewage system, it is an unspoken infrastructure piece in DeFi.

Though all of us heard the word LIQUIDATION, many are still not familiar with what it means, and fewer actually know how it works in DeFi. So here’s a short video explaining this in 1:30 minutes.

How Do Liquidations Work in DeFi?

The Tl:Dw — “Someone” will repay your debt for you, in return for the equivalent value of the collateral you have deposited in the platform, with a bonus on top, to make the all operation worth it.

Who is this Someone you ask? Usually, these are bots, programs that scan the positions in the platform, searching for easy profits, as liquidation bonuses can be as high as 12% on some DeFi platforms, with the norm being around 5–8%.

Flashloan bots became the liquidation mechanics norm in most of DeFi’s lending platforms, but when liquidity becomes thin they can’t operate, potentially leaving the lending platform with the risk of accruing bad debt in its system.

The flashloan which is taken by the bots on DEXs creates a slippage, or a price impact, on the liquidated asset. If this slippage is greater than the liquidation bonus given by the platform, bots won’t execute the transaction as it results in a loss, and bots are programmed to make profits.

A few examples

We have made some brief scanning of a few lending platforms across different L1s and L2s networks. We found out the DEX liquidity of some of the assets listed as collateral is too thin for even small to mid-size liquidations to be executed using a flashloan, preventing bots from operating as intended.

Any slippage above 8% would be considered as high, and bots will not execute the transaction.

Binance Smart Chain (BSC) —

Venus, the leading lending platform on BSC, with ~$1b TVL, has both $MATIC, $SXP, and $BETH listed as collaterals. All of them has millions of deposits, but very low DEX liquidity.

$MATIC, $SXP, and $BETH Supply stats on Venus

DEX liquidity is so low that even $250k worth of some of these tokens won’t be able to get executed with flashloan liquidation bots, as shown on DEX aggregator 1inch -

$MATIC, $SXP, and $BETH slippage (% in brackets) on DEX aggregator 1inch

Aurora —

Aurora, Near’s EVM compatible network, has also suffered from the recent liquidity contraction, dropping from $1.4b TVL to $400m TVL. It’s a good example for what happens when DEX liquidity is much smaller than Lending TVL. Both leading lending platforms as Bastion, as well as younger competitors such as Aurigami Finance, holding hundreds of millions in TVL, have millions worth of wNEAR, WBTC, and ETH deposited as collateral.

But DEX liquidity won’t facilitate as much as $0.5m of liquidations for WBTC and ETH, and $1m of wNEAR.

$0.5-$1m worth of all 3 leading tokens on Aurora (NEAR, ETH, BTC) get 11%-33% slippage. Source Krystal Swap

Fantom —

Fantom has suffered a significant liquidity contraction in the last 2 months, going from $7.5b TVL down to $1.75B. This has affected DEX liquidity of course, making collaterals like $SPELL and $LINK on lending platforms like Geist and Sturdy practically impossible to liquidate. Setting a lower CF makes it safer to a limit, but dictates very low capital efficiency for users.

$LINK and $SPELL Supply stats on Sturdy and Geist lending platforms

Again, the liquidity on 1inch shows that liquidations that are supposed to be executed by flashloan bots won’t be executed as the slippage is far greater than the liquidation bonus given by the lending platforms —

1inch shows low DEX liquidity over Fantom for some assets used as collateral over lending platforms

And there are many other examples…

The Backstop solution

B.Protocol offers its user-based backstop protocol as a solution to facilitate liquidations that are not dependent on DEX liquidity. Users provide liquidity in advance into backstop pools, and these funds are used for liquidations whenever it’s needed on the backstopped lending platform.

The backstop funds are available also as Supply liquidity on the lending market, earning interest rates and LM rewards from the lending market, while scooping also the profits made by the backstop liquidations. A win-win for all.

A backstop is mostly beneficial for new or smaller networks, where DEX liquidity is thinner. But it is also very effective to facilitate lending of “longer tail” assets, which by definition have lower liquidity in the markets.

About B.Protocol

B.Protocol is building a Backstop DeFi primitive, unlocking higher capital efficiency in the ecosystem. By democratizing liquidation systems it shifts MEV and bot profits to the hands of the community.

Lending platforms that integrate with B.Protocol democratize their liquidation system, provide a stronger safety net to their lenders, and enable higher collateral factors for its borrowers.

With B.Protocol, anyone can participate in the lucrative business of liquidations, tapping into the $1B/Year market of DeFi liquidations, on its growth path to the $100B/Year of liquidations made in CeFi.

Website, Docs, Discord, Twitter, YouTube, Reddit, Forum, GitHub

--

--