Liquidations: DeFi on a Knife-edge
LLiquidations: DeFi on a Knife-edge
Daniel Perez , Sam M. Werner , Jiahua Xu , and Benjamin Livshits , , Imperial College London University College London, Centre for Blockchain Technologies Brave Software
Abstract.
The trustless nature of permissionless blockchains rendersovercollateralization a key safety component relied upon by decentral-ized finance (DeFi) protocols. Nonetheless, factors such as price volatil-ity may undermine this mechanism. In order to protect protocols fromsuffering losses, undercollateralized positions can be liquidated . In thispaper, we present the first in-depth empirical analysis of liquidationson protocols for loanable funds (PLFs). We examine Compound, one ofthe most widely used PLFs, for a period starting from its conceptionto September 2020. We analyze participants’ behavior and risk-appetitein particular, to elucidate recent developments in the dynamics of theprotocol. Furthermore, we assess how this has changed with a modifi-cation in Compound’s incentive structure and show that variations ofonly 3% in an asset’s price can result in over 10m USD becoming liquid-able. To further understand the implications of this, we investigate theefficiency of liquidators. We find that liquidators’ efficiency has improvedsignificantly over time, with currently over 70% of liquidable positionsbeing immediately liquidated. Lastly, we provide a discussion on howa false sense of security fostered by a misconception of the stability ofnon-custodial stablecoins, increases the overall liquidation risk faced byCompound participants.
Decentralized Finance (DeFi) refers to a peer-to-peer, permissionless blockchain-based ecosystem that utilizes the integrity of smart contracts for the advance-ment and disintermediation of traditional financial primitives. One of the mostprominent DeFi application on the Ethereum blockchain [21] are protocols forloanable funds (PLFs) [12]. On PLFs, markets for loanable funds are establishedvia smart contracts that facilitate borrowing and lending. In the absence ofstrong identities on Ethereum, creditor protection tends to be ensured throughovercollateralization, whereby a borrower must provide collateral worth morethan the value of the borrowed amount. In the case where the value of the col-lateral to debt ratio drops below some liquidation threshold, a borrower defaultson his position and the supplied collateral is sold off at a discount to cover thedebt in a process referred to as liquidation . However, little is known about thebehavior of agents towards liquidation risk on a PLF. Furthermore, despite liq-uidators playing a critical role in the DeFi ecosystem, the efficiency with whichthey liquidate positions has not yet been thoroughly analyzed. a r X i v : . [ q -f i n . GN ] O c t D. Perez, S.M. Werner, J. Xu and B. Livshits
In this paper, we first lay out a framework for quantifying the state of ageneric PLF and its markets over time. We subsequently instantiate this frame-work to all markets on Compound [16], one of the largest PLFs in terms oflocked funds. We analyze how liquidation risk has changed over time, specifi-cally after the launch of Compound’s governance token. Furthermore, we seek toquantify this liquidation risk through a price sensitivity analysis. In a discussion,we highlight the existence of how the interdependence of DeFi protocols can re-sult in agent behavior undermining the assumptions of the protocols’ incentivestructures.
Contributions.
This paper makes the following contributions: – We present an abstract framework to reason about the state of PLFs. – We provide an open-source implementation of the proposed framework forCompound, one of the largest PLFs in terms of total locked funds. – We perform an empirical analysis on the historical data for Compound, fromMay 7, 2019 to September 6, 2020 and make the following observations: i)despite increases in the number of suppliers and borrowers the total fundslocked is mostly accounted for by a small subset of participants; ii) the in-troduction of Compound’s governance token had protocol-wide implicationsas liquidation risk increased as a consequence of higher risk-seeking behaviorof participants; iii) liquidators became significantly more efficient over time,liquidating over 70% of liquidable positions instantly. – Using our findings, we demonstrate how interaction between protocols’ in-centive structures can directly result in unexpected risks to participants.
In this section we introduce preliminary concepts necessary for understandinghow liquidations function in DeFi on Ethereum.
On Ethereum, smart contracts are programs written in a Turing-complete lan-guage, typically in Solidity, that define a set of rules that may be invoked byany network participant. These programs rely on the Ethereum Virtual Machine(EVM), a low-level stack machine which executes the compiled EVM bytecodeof a smart contract [21]. Each instruction has a fee represented in a unit called“gas”, and the total gas cost of a transaction is the sum of all instructions’ gasand a fixed base fee [5,18]. The sender of a transaction must then set a gas price,which is the amount of money he is willing to pay per unit of gas to execute thetransaction. The total fee of the transaction is given by the gas price multipliedwith the gas cost [20,19]. Within a transaction, smart contracts can store datain logs, which are metadata specially indexed as part of the transaction. Thismetadata, commonly referred to as events , is typically used to allow users tomonitor the activity of a contract externally. Anonymized for blind-reviewiquidations: DeFi on a Knife-edge 3
Given the pseudonymity of agents in Ethereum, borrow positions need to beovercollateralized to reduce the default risk. Thereby, the borrower of an assetis required to supply collateral, where the total value of the supplied collateralexceeds the total value of the borrowed asset. For example, in order to borrow100 USD worth of
DAI with
ETH as collateral at a collateralization ratio of 150%,a borrower would have to lock 150 USD worth of
ETH to collateralize the borrowposition. Thus, the protocol does not face monetary risk from defaulted borrowpositions, as the underlying collateral of a defaulted position can be sold off torecover the debt.
The process of selling a borrower’s collateral to recover the debt value upon de-fault is referred to as liquidation. A borrow position can be liquidated once thevalue of the collateral falls below some fixed liquidation threshold, i.e. the mini-mum acceptable collateral to debt ratio. Any network participant may liquidatethese positions by purchasing the underlying collateral at a discount. Hence,liquidators are incentivized to actively monitor borrowers’ collateral to debt ra-tios. Note that in practice, there may exist a maximum amount of liquidablecollateral that a single liquidator can purchase.
In DeFi, asset borrowing and lending is achieved via so-called protocols for loan-able funds (PLFs), where smart contracts act as trustless intermediaries of loan-able funds between borrowers and lenders in markets of different assets. Unliketraditional peer-to-peer lending, deposits are pooled and instantly available toborrowers. On a DeFi platform, the aggregate of tokens that the PLF smart con-tracts hold, which equals the difference between supplied funds and borrowedfunds, is termed locked funds [10]. Borrowers are charged interest on the debtat a floating rate determined by a market’s underlying interest rate model. Asmall fraction of the paid interest is allocated to a pool of reserves, which is setaside in case of market illiquidity, while the remainder is paid out to suppliers ofloanable funds. Interest in a given market is generally accrued through market-specific, interest-bearing derivative tokens that appreciate against the underlyingasset over time. Hence, a supplier of funds receives derivative tokens in exchangefor supplied liquidity, representing his share in the total value of the liquiditypool for the underlying asset. The most prominent PLFs are Compound [7] andAave [4], with 749m USD and 1.39bn USD in total funds locked, respectively,at the time of writing [10]. For a more in-depth explanation of the workings ofPLFs, we direct the reader to [12].
D. Perez, S.M. Werner, J. Xu and B. Livshits
One of the major challenges smart contracts face concerns access to off-chaininformation, i.e. data that does not natively exist on-chain. Oracles are data feedsinto smart contracts and provide a mechanism for accessing off-chain informationthrough some third party. In DeFi, oracles are commonly used for price feed datato determine the real-time price of assets. For instance, via the Compound OpenPrice Feed [8], vetted third party reporters sign off on price data using a knownpublic key, where the resulting feed can be relied upon by smart contracts.
As the total liquidity in DeFi is fragmented across protocols, a constant com-petition over deposits persists, commonly referred to as liquidity mining . Apartfrom earning interest on deposited funds on PLFs or liquidity provider fees onautomated market makers, liquidity providers may also earn rewards by receiv-ing protocol-specific tokens, as seen for automated market makers [1,2], PLFs[7], and yield aggregators [3]. While these tokens are typically intended for par-ticipation in protocol governance, they are also tradable on the open market andthus provide further financial incentive to liquidity providers.
An alternative to volatile cryptoassets is given by stablecoins, which are pricedagainst a peg and can be either custodial or non-custodial. For custodial sta-blecoins (e.g.
USDC [6]), tokens represent a claim of some off-chain reserve asset,such as fiat currency, which has been entrusted to a custodian. Non-custodialstablecoins (e.g.
DAI [17]) seek to establish price stability via economic mech-anisms specified by smart contracts. For a thorough discussion on stablecoindesign, we direct the reader to [14].
In this section, we describe our methodology for the different analyses we performwith regard to leveraging on a PLF. To be able to quantify the extent of leveragedpositions over time, we first introduce a state transition framework for trackingthe borrow and supply positions across all markets on a given PLF. We thendescribe how we instantiate this framework on the Compound protocol usingon-chain events data.
Throughout the paper, we use the following definitions in the context of PLFs:
Market
A smart contract acting as the intermediary of loanable funds for aparticular cryptoasset, where users supply and borrow funds. iquidations: DeFi on a Knife-edge 5
Supply
Funds deposited to a market that can be loaned out to other users andused as collateral against depositors’ own borrow positions.
Borrow
Funds loaned out to users of a market.
Collateral
Funds available to back a user’s aggregate borrow positions.
Locked funds
Funds remaining in the PLF smart contracts, equal to the dif-ference between supplied and borrowed funds.
Supplier
A user who deposits funds to a market.
Borrower
A user who borrows funds from a market. Since a borrow positionmust be collateralized, a borrower must also be a supplier.
Liquidator
A user who purchases a borrower’s supply in a market when theborrower’s collateral to borrow ratio falls below some threshold.
In this section, we provide a formal definition of the state of a PLF. We note P t to be the global state of a PLF at time t . For brevity, in the following definitions,we assume that all the values are at a given time t . We define the global statefor the PLF as P = ( M , Γ, P , Λ )where M is the set of states of individual markets, Γ is the price the Oracleused, P is the set of states of individual participants and Λ is the close factorof the protocol, which specifies the upper bound on the amount of collateral aliquidator may purchase.We define the state of an individual market m ∈ M as m = ( I , B , S , C )where I is the market’s interest rate model, B is the total borrows, S is the totalsupply of deposits, and C is the collateralization ratio. P m is the state of all participants in market m and the positions of a partic-ipant P in this market is defined as P m = ( B m , S m )where B m and S m are respectively the total borrows positions and total supplieddeposits of a market participant in market m .For a given market m , the total deposits supplied S m is thus given by: S m = (cid:88) P m ∈P m S m (1)Similarly, the market’s total borrows B m is given by: B m = (cid:88) P m ∈P m B m (2) D. Perez, S.M. Werner, J. Xu and B. Livshits
Event Description State variables affected
Borrow
A new borrow position is created. B Mint cTokens are minted for new deposits. S RepayBorrow
A borrow position is partially/fully repaid. B LiquidateBorrow
A borrow position is liquidated. B , S Redeem cTokens are used to redeem deposits of the un-derlying asset. S NewCollateralFactor
The collateral factor for the associated market isupdated. C AccrueInterest
Interest has accrued for the associated marketand its borrow index is updated. B NewInterestRateModel
The interest rate model for the associated marketis updated. I NewInterestParams
The parameters of the interest rate model for theassociated market are updated. I NewCloseFactor
The close factor is updated. Λ Fig. 1: The events emitted by the Compound protocol smart contracts used forinitiating state transitions and the states affected by each event.The state of a participant P is liquidable if the following holds: (cid:88) m ∈M (cid:110) [ S m · C + I ( S m )] · Γ ( m ) (cid:111) − (cid:88) m ∈M (cid:110) [ B m + I ( B m )] · Γ ( m ) (cid:111) < Γ ( m ) returns the price of the underlying asset denominated in a predefinednum´eraire (e.g. USD), I ( S m ) returns the interest earned with supply S m and I ( B m ) returns the interest accrued with borrow B m .The transition from a state of a market m from time t to t + 1 is given bysome state transition σ , such that m t σ −→ m t +1 . For our analysis, we apply our state transition framework to the CompoundPLF. Therefore, we briefly present the workings of Compound in the context ofour framework.
State Transitions
We initiate state transitions via events emitted from theCompound protocol smart contracts. We provide an overview of the state vari-ables affected by Compound events in Table 1.
Funds Supplied
Every market on Compound has an associated “cToken”,a token that continuously appreciates against the underlying asset as interestaccrues. For every deposit in a market, a newly-minted amount of the market’sassociated cToken is transferred to the depositor. Therefore, rather than trackingthe total amount of the underlying asset supplied, we account the total depositsof an asset supplied by a market participant in the market’s cTokens. Likewise,we account the total supply of deposits in the market in cTokens. iquidations: DeFi on a Knife-edge 7
Funds Borrowed
A borrower on Compound must use cTokens as collateralfor his borrow position. The borrowing capacity equals the current value of thesupply multiplied by the collateral factor for the asset. For example, given anexchange rate of 1
DAI = 50 cDAI , a collateral factor of 0.75 for
DAI and a priceof 1
DAI = 1 USD, a holder of 500 cDAI (10
DAI ) would be permitted to borrowup to 7.50 USD worth of some other asset on Compound. Therefore, as fundsare borrowed, an individual’s total borrow position, as well as the respectivemarket’s total borrows are updated.
Interest
The accrual of interest is tracked per market via a borrow index, whichcorresponds to the total interest accrued in the market. The borrow index of amarket is also used to determine and update the total debt of a borrower in therespective market. When funds are borrowed, the current borrow index for themarket is stored with the borrow position. When additional funds are borrowedor repaid, the latest borrow index is used to compute the difference of accruedinterest since the last borrow and added to the total debt.
Liquidation
A borrower on Compound is eligible for liquidation should his totalsupply of collateral, i.e. the value of the sum of the borrower’s cToken holdingsper market, weighted by each market’s collateral factor, be less than the value ofthe borrower’s aggregate debt (Equation (3)). The maximum amount of debt aliquidator may pay back in exchange for collateral is specified by the close factorof a market.
In this section, we present the results of the analysis performed with the frame-work outlined in Section 3. We analyze data from the Compound protocol [16]over a period ranging from May 7, 2019—when the first Compound marketswere deployed on the Ethereum main network—to September 6, 2020. The fulllist of contracts considered for our analysis can be found in Appendix A. Whenanalyzing a single market, we choose the market for
DAI , as it is the largest byone order of magnitude.
We first examine the total number of borrowers and suppliers on Compoundby considering any Ethereum account that, at any time within the observationperiod, either exhibited a non-zero cToken balance or borrowed funds for anyCompound market. The change in the number of borrowers and suppliers overtime is displayed in Figure 2a.We see that the total number of suppliers always exceeds the total number ofborrowers. This is because on Compound, one can only borrow against funds hesupplied, which automatically makes the borrower also a supplier. Interestingly,
D. Perez, S.M. Werner, J. Xu and B. Livshits - - - - - - - - - Date02,5005,0007,50010,00012,50015,00017,500 N u m b e r o f a cc o un t s SuppliersBorrowers (a) Number of suppliers and borrowers.
Jul Oct Jan2020 Apr JulDate0.0M500.0M1,000.0M1,500.0M2,000.0M A m o un t ( U S D ) Total borrowedTotal supplyTotal locked (b) Amount of funds supplied, borrowed and locked.
Fig. 2: Number of active accounts and amount of funds on Compound over time. iquidations: DeFi on a Knife-edge 9
Number of users0187,037,896374,075,792561,113,688748,151,584935,189,480 A m o un t o f U S D P e r c e n t a g e o f U S D (a) Distribution of supplied funds. Number of users0133,134,778266,269,556399,404,334532,539,113665,673,891 A m o un t o f U S D P e r c e n t a g e o f U S D (b) Distribution of borrowed funds. Fig. 3: Cumulative distribution of funds in USD. Accounts are bucketed in binsof 10, i.e. a single bar represents the sum of 10 accounts.the number of suppliers has become increasingly bigger relative to the numberof borrowers over time. There is notable sudden jump in both the number ofsuppliers and borrowers in June 2020.In terms of total deposits, a very similar trend is observable in Figure 2b,which shows that at the same time, the total supplied deposits increased, whilethe total borrows followed shortly after. Furthermore, the total funds borrowedexceeded the total funds locked for the first time in July 2020 and have remainedso until the end of the examined period. We discuss the reasons behind this inthe next part of this section.Despite the similarly increasing trend for the number of suppliers/borrowersand amount of supplied/borrowed funds, we can see in Figure 3 that the majorityof funds are borrowed and supplied only by a small number of accounts. For in-stance, for the suppliers in Figure 3a, the top user and top 10 users supply 27.4%and 49% of total funds, respectively. For the borrowers shown in Figure 3b, thetop user accounts for 37.1%, while the top 10 users account for 59.9% of totalborrows.
COMP
Governance Token
The sudden jumps seen in Figures 2a and 2b can be explained by the launch ofCompound’s governance token,
COMP , on June 15, 2020. The
COMP governancetoken allows holders to participate in voting, create proposals, as well as delegatevoting rights. In order to empower Compound stakeholders, new
COMP is mintedevery block and distributed amongst borrowers and suppliers in each market.Initially,
COMP was allocated proportionally to the accrued interest per mar-ket. However, the
COMP distribution model was modified via a governance voteon July 2, 2020, such that the borrowing interest rate was removed as a weight-ing mechanism in favor of distributing
COMP per market on a borrowing demandbasis, i.e. per USD borrowed. The distributed
COMP per market is shared equally - - - - - - - - - Date0.0M200.0M400.0M600.0M800.0M1,000.0M1,200.0M1,400.0M S u pp l y i n U S D Collateral/borrow ratio< 100.00%< 105.00%< 110.00%< 125.00%< 150.00%< 200.00% 200.00%
Fig. 4: Collateral locked over time, showing how close the amounts are from beingliquidated. Positions can be liquidated when the ratio drops below 100%.between a market’s borrowers and suppliers, who receive
COMP proportionally totheir borrowed and supplied amounts, respectively. Hence, a Compound user isincentivized to increase his borrow position as long as the borrowing cost doesnot exceed the value of his
COMP earnings, which presumably explains why thetotal borrows surpass the total amount locked after the
COMP launch, as seen inFigure 2b.
Given the high increase in the number of total funds borrowed and supplied,as well as the decrease in liquidity relative to total borrows, we seek to identifyand quantify any changes in liquidation risk on Compound since the launch of
COMP . Figure 4 shows the total USD value of collateral on Compound and howclose collateral amounts are from liquidation. In addition to the substantial in-crease in the total value of collateral on Compound since the launch of
COMP , therisk-seeking behavior of users has also changed. This can be seen by examiningcollateral to borrow ratios, where since beginning of July, 2020, a total of ap-proximately 350m to 600m USD worth of collateral has been within a 5% pricerange of becoming liquidable. However, it should be noted that the likelihood ofthe amount of this collateral becoming liquidable highly depends on the pricevolatility of the collateral asset.In order to examine how liquidation risk differs across markets, we measurefor the largest market on Compound, namely
DAI , the sensitivity of collateralbecoming liquidable given a decrease in the price of
DAI . Figure 5 shows theamount of aggregate collateral liquidable at the historic price, as well as at a 3% iquidations: DeFi on a Knife-edge 11 J u l O c t J a n A p r J u l Date0.0M5.0M10.0M15.0M20.0M L i q u i d a b l e a m o un t ( U S D ) Actual price3% decrease5% decrease
Fig. 5: Sensitivity analysis of the liquidable collateral amount given
DAI pricemovement.
COMP launch date is marked by the dashed vertical line.and 5% decrease relative to the historic price for
DAI . We mark the date onwhich the
COMP governance token launched with a dashed line. It can be seenthat since the launch of
COMP , 3% and 5% price decreases would have resulted in asubstantially higher amount of liquidable collateral. In particular, a 3% decreasewould have turned collateral worth in excess of 10 million USD liquidable.
In order to better understand the implications of the increased liquidation risksince the launch of
COMP , we examine historical liquidations on Compound andsubsequently measure the efficiency of liquidators.
Historical Liquidations
The increased risk-seeking behavior suggested by thelow collateral to borrow ratios presented in the previous section are in accordancewith the trend of rising amount of liquidated collateral since the introduction of
COMP . The total value of collateral liquidated on Compound over time is shownin Figure 6. It can be seen that the majority of this collateral was liquidatedon a few occasions, perhaps most notably on Black Thursday (March 12, 2020),July 29, 2020 (
DAI deviating from its peg), and in early September 2020 (
ETH price drop). - - - - - - - - - Date0.0M1.0M2.0M3.0M4.0M5.0M6.0M A m o un t li q u i d a t e d ( U S D ) Amount liquidatedETH price 0100200300400500 E T H p r i c e ( U S D ) Fig. 6: Amount (in USD) of liquidated collateral from May 2019 to August 2020.
Liquidation Efficiency
We measure the efficiency of liquidators as the numberof blocks elapsed since a borrow position has become liquidable and the positionactually being liquidated. The overall historical efficiency of liquidators is shownas a cumulative distribution function in Figure 7, from which it can be seenthat approximately 60% of the total liquidated collateral (35 million USD) wasliquidated within the same block as it became liquidable, suggesting that themajority of liquidations occur via bots and are very efficient. After 2 blockshave elapsed (on average half a minute), 85% of liquidable collateral has beenliquidated, while after 16 blocks this value amounts to 95%.It is worth noting that liquidation efficiency has been skewed by the morerecent liquidation activities which were of a much larger scale than when the pro-tocol was first launched. Specifically, in 2019, only about 26% of the liquidationsoccurred in the block during which the position became liquidable, comparedto 70% in 2020. This resulted in some lost opportunities for liquidators as shownin Figure 5. The account , for in-stance, had more than 3,000,000 USD worth of
ETH as collateral exposed atblock 8,796,900 for the duration of a single block: the account was roughly 20USD shy of the collaterization threshold but eventually escaped liquidation. Ifa liquidator had captured this opportunity, he could have bought half of thiscollateral (given the close factor of 0.5), at a 10% discount, resulting in a profitof 150,000 USD for a single transaction. It is clear that with such stakes, par- iquidations: DeFi on a Knife-edge 13 A m o un t o f U S D P e r c e n t a g e o f U S D Fig. 7: Number of blocks elapsed from the time a position can be liquidated toactual liquidation, shown as a CDF.ticipants were incentivized to improve liquidation techniques, resulting in a highlevel of liquidation speed and scale.
In this section, we have analyzed the Compound protocol with a focus on liq-uidations. We have found that despite the number of suppliers and borrowershaving increased with time, the total amount of funds supplied and borrowedremain extremely concentrated among a small set of participants.We have also seen that the introduction of the
COMP governance token haschanged how users interact with the protocol and the amount of risk that theyare willing to take. Users now borrow vastly more than before, with the totalamount borrowed surpassing the total amount locked. Due to excessive borrow-ing without a sufficiently safe amount of supplied funds, borrow positions nowface a higher liquidation risk, such that a crash of 3% in the price of
DAI couldresult in an aggregate liquidation value of over 10 million USD.Finally, we have shown that the liquidators have become more efficient withtime, and are currently able to capture a majority of the liquidable funds in-stantly.
In this section, we enumerate several points that we deem important for thefuture development of PLFs and DeFi protocols. We first discuss ho governancetokens can, intentionally or not, change how users behave within a protocol.
Subsequently, we discuss the contagion effect that user behavior in a protocolcan have on another protocol.As analyzed in Section 4, the distribution of the
COMP token has vastlychanged the Compound landscape and user behavior. Until the introductionof the token, borrowing was costly due to the payable interest, which implies anegative cash flow for the borrower. Therefore, a borrower would only borrow ifhe could justify this negative cash flow with some application external to Com-pound. With the introduction of this token, borrowing started to yield a positivecash flow because of the monetary value of the governance token. This creates asituation where both suppliers and borrowers end up with a positive cash flow,inducing users to maximize both their supply and borrow. This model is, how-ever, only sustainable when the price of the
COMP token remains sufficiently highto keep this cash flow positive for borrowers. This directly results in users takingincreasingly higher risk in an attempt to gain larger monetary rewards, withliquidators making more risk-free profit from their operations.This behavior also indirectly affected other protocols, in particular
DAI . Theprice of
DAI is aimed to be pegged to 1 USD resting on an arbitrage mechanism,whereby token holders are incentivized to buy/sell
DAI as soon as the price movesbelow/above 1 USD, respectively. However, a rational user seeking to maximizeprofit will not sell his
DAI if holding it somewhere else would yield higher profits.This was precisely what was happening with Compound, whose users lockingtheir
DAI received higher yields in the form of
COMP , than from selling
DAI ata premium, thereby resulting in upward price pressure [9]. Interestingly,
DAI deviating from its peg also has a negative effect for Compound users. Indeed,as we saw in Section 4, many Compound users might have been overconfidentabout the price stability of
DAI and thus only collateralize marginally above thethreshold. This has resulted in large amounts being liquidated due to the actual,higher extent of the volatility in the
DAI price.
In this section we briefly discuss existing work related to this paper.A thorough analysis of the Compound protocol with respect to market risksfaced by participants was done by [13]. The authors employ agent-based mod-eling and simulation to perform stress tests in order to show that Compoundremains safe under high volatility scenarios and high levels of outstanding debt.Furthermore, the authors demonstrate the potential of Compound to scale toaccommodate a larger borrow market while maintaining a low default proba-bility. This differs to our work as we conduct a detailed empirical analysis onCompound, focusing on how agent behavior under different incentive structureson Compound has affected the protocol’s state with regards to liquidation risk.A first in-depth analysis on PLFs is given by [12]. The authors provide a tax-onomy on interest rate models employed by PLFs, while also discussing marketliquidity, efficiency and interconnectedness across PLFs. As part of their anal- iquidations: DeFi on a Knife-edge 15 ysis, the authors examine the cumulative percentage of locked funds solely forthe Compound markets
DAI , ETH , and
USDC .In [15], the authors show how markets for stablecoins are exposed to delever-aging feedback effects, which can cause periods of illiquidity during crisis.The authors of [11] demonstrate how various DeFi lending protocols aresubject to different attack vectors such as governance attacks and undercollater-alization. In the context of the proposed governance attack, the lending protocolthe authors focus on is Maker [17].
In this paper, we presented the first in-depth empirical analysis of liquida-tions on Compound, one of the largest PLFs in terms of total locked funds,from May 7, 2019 to September 6, 2020. We analyzed agents’ behavior andin particular how much risk they are willing to take within the protocol. Fur-thermore, we assessed how this has changed with the launch of the Compoundgovernance token
COMP , where we found that agents take notably higher risksin anticipation of higher earnings. This resulted in variations as little as 3% inan asset’s price being able to cause over 10 million USD worth of collateral be-coming liquidable. In order to better understand the potential consequences, wethen measured the efficiency of liquidators, namely how quickly new liquidationopportunities are captured. Liquidators’ efficiency was found to have improvedsignificantly over time, reaching 70% of instant liquidations. Lastly, we demon-strated how overconfidence in the price stability of
DAI , increased the overallliquidation risk faced by Compound participants. Rather ironically, many Com-pound participants wishing to make the most of the new incentive scheme endedup causing higher volatility in
DAI —a dominant asset of the platform, resultingin liquidation of their own assets. This is not Compound’s misdoing, but ratherhighlights the to date unknown dynamics of incentive structures across differentDeFi protocols.
References
1. BAL – Balancer Governance Token. https://docs.balancer.finance/protocol/bal-balancer-governance-token (2020), accessed: 20-08-2020.2. Curve.fi. (2020), accessed: 20-08-2020.3. yearn. https://yearn.finance/ (2020), accessed: 20-08-2020.4. AAVE: Aave. https://aave.com/ (2020), accessed: 17-08-2020.5. Albert, E., Correas, J., Gordillo, P., Rom´an-D´ıez, G., Rubio, A.: Gasol: Gas analy-sis and optimization for ethereum smart contracts. In: International Conference onTools and Algorithms for the Construction and Analysis of Systems. pp. 118–125.Springer (2020)6. Circle: USDC (2020),
7. Compound: Compound. https://compound.finance/ (2019), accessed: 17-08-2020.6 D. Perez, S.M. Werner, J. Xu and B. Livshits8. Compound: Open price feed. https://compound.finance/prices (2020), ac-cessed: 15-09-2020.9. Cyrus: Upcoming comp farming change could impact the dai peg. https://forum.makerdao.com/t/upcoming-comp-farming-change-could-impact-the-dai-peg/2965 (2020), accessed: 27-08-202010. DeFi Pulse: How do we calculate total value locked (TVL)? (2020), https://defipulse.com/
11. Gudgeon, L., Perez, D., Harz, D., Gervais, A., Livshits, B.: The decentralizedfinancial crisis: Attacking defi. arXiv preprint arXiv:2002.08099 (2020)12. Gudgeon, L., Werner, S.M., Perez, D., Knottenbelt, W.J.: Defi protocols for loan-able funds: Interest rates, liquidity and market efficiency (2020)13. Kao, H.T., Chitra, T., Chiang, R., Morrow, J.: An Analysis of the Market Risk toParticipants in the Compound Protocol (2020), https://scfab.github.io/2020/FAB2020_p5.pdf
14. Klages-Mundt, A., Harz, D., Gudgeon, L., Liu, J.Y., Minca, A.: Stablecoins2.0: Economic Foundations and Risk-based Models. In: 2nd ACM Confer-ence on Advances in Financial Technologies (AFT ’20). New York (2020).https://doi.org/10.1145/3419614.342326115. Klages-Mundt, A., Minca, A.: (in) stability for the blockchain: Deleveraging spiralsand stablecoin attacks. arXiv preprint arXiv:1906.02152 (2019)16. Leshner, R., Hayes, G.: Compound : The Money Market Protocol. Tech. rep. (2018)17. Maker: The maker protocol: Makerdao’s multi-collateral dai (mcd) system, https://makerdao.com/en/whitepaper/ , accessed: 08-06-202018. P´erez, D., Livshits, B.: Broken metre: Attacking resource metering inEVM. In: 27th Annual Network and Distributed System Security Sym-posium, NDSS 2020, San Diego, California, USA, February 23-26, 2020.The Internet Society (2020),
19. Pierro, G.A., Rocha, H.: The influence factors on ethereum transaction fees. In:2019 IEEE/ACM 2nd International Workshop on Emerging Trends in SoftwareEngineering for Blockchain (WETSEB). pp. 24–31. IEEE (2019)20. Werner, S.M., Pritz, P.J., Perez, D.: Step on the gas? a better approach for rec-ommending the ethereum gas price. arXiv preprint arXiv:2003.03479 (2020)21. Wood, G., et al.: Ethereum: A secure decentralised generalised transaction ledger.Ethereum project yellow paper (2014), 1–32 (2014)iquidations: DeFi on a Knife-edge 17
A Monitored contracts
In Figure 8, we provide a list of contracts we monitored in our analysis.
Name AddresscBAT cDAI cETH cREP cSAI cUSDC cUSDT cWBTC cZRX
Comptroller
Open Oracle Price Data
Uniswap Anchored View0x9b8eb8b3d6e2e0db36f41455185fef7049a35cae