Venus liquidations on May 18 2021

DefiDuck
5 min readMay 20, 2021

Venus is a Compound fork on BSCscan. Venus currently has 18 money markets listed. It has close to 5 Billion USD in TVL.

On May 18 2021 the Venus protocol experienced a number of large liquidations, causing one borrower to incur significant losses.

Not much information can be found online, but here’s what I could find:

According to Venus founder @Joselito (in the first tweet above), the problem was “cascading liquidations”. From what I see, this is not what happened. In this post I’ll explain what actually happened, providing strong evidence to support my claims (more data can help strengthen my claims even further if anyone wants to help). My main goal, however, is to describe a vulnerability in Compound-like lending networks that must be dealt with carefully, especially when illiquid tokens are being lent and borrowed.

First, let’s examine the facts.

A heavy Venus farmer (0xef044206db68e40520bfa82d45419d498b4bc7bf) was liquidated 23 times within the span of around 4 hours, sometimes only a couple of minutes pass between liquidations.

All in all, the borrower was liquidated for 331805.99 XVS which by current prices is worth over $19M. This means that the borrower lost over $1.9M (as the liquidation incentive stands at 10%). There were 3 liquidators:

  • 0x8555B50256d9838201A01005d579f3A743252073
  • 0x86845683612FEB6230cf46E58F0A1bDFD0e914c2 (using two different contracts: 0x7A55f34598A027abdc339514e71BDe7fC4442537 and 0x2d9299546E681b29A3cC5B61FeD911019adbF6bf)
  • 0xea9Ed9420bD676B353eF906c4857D300D519839b (using the contract: 0x842c9e55697c6790aCD9300cf7592f80278CF6F5)

Interestingly, at the exact time that these liquidations took place, an untypical positive price spike can be seen in the XVS/USD chart. The price goes from 76–79$ to 140$ as can be seen both on CoinGecko and on The Block (showing prices from the Chainlink oracle contract that Venus uses).

Here are a few example transactions that show the liquidations that took place:

Let’s take a closer look at the last liquidation’s “liquidateBorrow” event:

This liquidation took place at 18:01 UTC. Over 105K XVS tokens (worth over $10M at the time) were repaid by the liquidator for collateral in vXVS. This implies that the victim has both deposited and borrowed from the vXVS market.

Before we head to the interesting part, let’s recall how liquidations in Compound-like lending networks work. When a liquidation occurs, the liquidator repays a loan on behalf of the victim (that originally borrowed the tokens) and seizes some of his collateral. The liquidator must choose 2 markets — one from which the borrower has borrowed tokens (denote this market as bMarket) and one in which he deposited tokens as collateral (denote this market as cMarket). Then, he can repay up to half of the amount that the victim borrowed from bMarket and he seizes 110% of the value that he paid from cMarket (in Venus the close factor is set to 50% and the liquidation incentive is set to 110%)

This process is healthy for the protocol (as long as it happens quickly enough after the victim is eligible for liquidation, see OpenZepplin’s audit and specifically the “Counterproductive Incentives” section to see when this is not the case) in the sense that it distances the victim and hence also the system as a whole from having bad debt (ie. debt that is not backed by collateral). Hence, after a liquidation one would expect that a second liquidation is not going to happen.

There are 2 plausible cases where we might see multiple liquidations happen in proximity:

  1. If the amount borrowed from bMarket is very small relative to amounts that the victim has borrowed from other markets. In this case, repaying half of the amount borrowed from bMarket, doesn’t change by much the overall health of the position. In this case however, we would expect to see multiple liquidations come at the same time, or at most within seconds apart, as there is no reason to wait. This is not what happened in our case.
  2. If prices move aggressively and quickly, against the victim, then the extra buffer provided by a liquidation might not suffice. This is what happened in our case.

But the most interesting question remains: was the anomalous price spike coincidental, or was it an intended manipulation by a sophisticated liquidator that monitors the state of the lending network and that was able to push the price in the right direction to force the poor victim into liquidation. To answer this question in confidence, more data is needed (some of which might not be accessible to the public as XVS is traded on many centralized venues). Additionally, it would help knowing how Chainlink’s oracle provides price data for XVS/USD (I’m not sure how to retrieve this information).

Anyway, by looking at the 90 day chart for XVS/USD it seems that yesterday’s spike is quite anomalous, especially when the general direction of the crypto market is downhill.

Finally, I’ll touch on my main point and the conclusion of this incident — not all tokens can be part of a Compound-like lending network, at least not naively.

This is exactly our goal in Ola.finance. We are trying to enhance Compound-like lending networks so that they can securely accommodate less liquid tokens. We added a few clever restrictions and caps to the protocol. These can dramatically make the life of a potential “oracle manipulator” more difficult. Additionally, we introduce a new type of player, that alongside liquidators, monitors the state of a lending network, and helps it stay healthy. This player makes a profit at the expense of an attacker that attempts to move the price of an asset in order to force liquidations. We strive to reach a state where the risk of manipulating the price is not worth the reward that awaits in case of a successful attack.

--

--