The Economic Theory of Liquidators
Original source: Gauntlet
Original compilation: 0x26
Liquidators often get "bad reviews" in DEFI. Those anonymous bots sitting in the background are ready to pounce on your account and, in the event of a liquidation due to insufficient mortgages, steal the tokens you've mined with your own sweat and blood. However, while every user feels the pain of losing tokens as a result of clearing, liquidators play an important role in keeping Defi's ecosystem safe, and they have to make a major economic decision every time they choose to clear your hard-earned money.

"To the liquidators: Whoever you are, you are to be liquidated!"
Defi protocols have been around for a long time, such as Compound, Makerdao, Dydx, Aave, Notional and others have allowed untrusted mortgages. Through these agreements, borrowers can deposit collateral and use it to withdraw separate assets and pay interest for the function.
This is the most primitive form of lending, which does not require trust between the lender and the borrower. If the borrower is in bad faith, the lender can sell the borrower's collateral in the open market and repurchase the borrowed assets, allowing the lender to break even.This is similar to how a home mortgage works in traditional finance, where the bank is comfortable lending you money to buy a house, because they know that if you stop paying, the bank can take the house back at any time and get their investment back.
Similarly to how a home mortgage works, a DEFI loan agreement requires the collateral to exceed the value of the loan, similar to an advance on a home mortgage.If the value of the borrowed assets falls, lenders have some extra collateral buffers, which means lenders are still able to retain their initial principal.If the lender allowed the value of the collateral to fall below the value of the borrowed asset before being "foreclosed," the anonymous borrower would simply walk away with their borrowed money, leaving the lender with a loss.To prevent a lender from losing money in such a situation, most cooperatives hold a reserve fund (the DEFI field is usually presented as a fee) to repay the lender.If the loss is greater than the reserve held by the loan agreement, the system will be completely insolvent and the lender will only receive a fraction of its funds.Therefore, for the safety of the agreements and the lenders, these agreements must ensure that bankruptcy does not occur.
The ratio of the required collateral to the amount borrowed is known as the mortgage/guarantee coverage ratio (CCR) and is calculated as:

Let's say weThere is a loan agreement with a guarantee coverage ratio of 1.5, which means that $1.50 of collateral is put up for every $1 borrowed. If you want to borrow $100 worth of DAI against ETH, you need to deposit at least $150 worth of ETH.Suppose now that the price of ETH has dropped by 10%, but DAI has stayed the same. The value of your borrowed DAI is the same as before, $100, but now your ETH collateral is only worth $135. In that case, the agreement itself is still solvent because the value of your collateral exceeds the value of the loan. However, CCR 1.5 of the agreement is now in breach because the ratio of your collateral to the borrowed funds is now only 1.35. There must be a mechanism to restore your account to proper proportions and restore the protective layer of the agreement to prevent further price falls in the future during the loan process.
That's what a liquidator is for. These lending agreements allow third parties to step in and reverse deposit the loan, depositing the borrower's loan assets (in DAI's case) in exchange for a portion of the collateral (ETH). As a reward for performing this important function, the agreement will use a parameter called the liquidator discount (LD) to provide the liquidator with price impetus.
Let's imagine that in our previous scenario, the loan agreement had set their LD at 5%, which meant that the liquidator could repurchase the collateral at a 5% discount. Seeing that your account is short of collateral, the liquidator can step in and buy your collateral at a discount, replenish some of the borrowed money and adjust your account CCR parameter to the desired level (greater than 1.5). This practice is known as clearing, and the liquidator can protect the agreement and earn himself a nice discounted trade (carry trade).
On the face of it, this looks like a fat deal for the liquidators. Just write some code that automatically clears when there is a clearing and immediately reverse clears on the open market to make money at the expense of innocent borrowers! To be sure, however, the competition for liquidators in the current situation is fierce and lucrative (see Tom Schmidt on the competition for liquidators)The article). Yet the economic decision on whether to liquidate is no small one.
It may be naive to think that the net profit a liquidator makes from a liquidation, the so-called profit and loss (PNL), is entirely determined by the liquidation Size (SIZE) and LD, and can be calculated as follows:

But this ignores the fact that liquidators end up in a different position than they started. They start with DAI and end up with ETH. Since the liquidators are only doing this trade to take advantage of the clearing discount and to do some arbitrage on the open trading platform, we expect the liquidators to adjust their positions in the open market, sell their newly acquired ETH and re-buy DAI, closing the position and pockering the profits. Such trading in the open market is not free and requires the clearing house to pay a slippage point, which can be the difference between the strike price and the quoted price, as well as the fixed fee charged by the exchange for trading. The slippage of decentralized trading platforms (DEXs), such as Uniswap, can be calculated in advance by looking at the size of the liquidity pool. Centralized trading platforms (CEXs) such as Coinbase have a more complex slippage, but can also be assumed as a function of size, where liquidity refers to the depth of the order book rather than the amount of liquidity in the pool. In either case, the liquidators face some slippage losses when hedging their positions on the exchange.
The approximate value of the realized profit and loss (RPNL) of the liquidator after exiting the trading platform and taking into account the slip point can be calculated as:

Where Slippage is a function that aggregates the Slippage costs of exit via a centralized or decentralized trading platform, depending on the size of the transaction.
Some interesting results emerge from this. useGauntletThe slip-point model and simulated liquidators trained on historical slip-point data can intuitively observe the RPNL of the volume of liquidators of different sizes relative to Uniswap in January 2021 at various liquidation discounts.

Various clearing discounts and sizes of RPNL
As the size increases relative to the volume of trading on the platform, we can see that RPNL increases initially. Eventually, as the slippage will increase faster than the profit, the cost of the slippage will begin to exceed the benefit of LD, and the liquidator's PNL will begin to tilt downward and even become negative when the scale is large enough, that is, the cost of exiting the acquired position exceeds the benefit of participating in the clearing chain.
As expected, higher clearing discounts can support larger clearing sizes. An agreement that is smaller relative to the overall market size may be able to maintain its settlement dynamics with a lower settlement discount and save some money for the borrower, but as the agreement grows relative to the market size, a higher settlement discount is needed to compensate the liquidator to enable it to intervene adequately.
Further, we can calculate the optimal clearing size of the volume that a liquidator is willing to clear at any given time. By approximating the derivatives of RPNL samples of different sizes, we can calculate the marginal RPNL, which shows the rate of change in RPNL when the liquidator chooses to liquidate more or fewer positions.


RPNL and marginal RPNL
Setting the marginal PNL to 0(B), we find that the scale (A) at which the liquidator will maximize the RPNL is significantly smaller than the scale (C) at which the liquidator will break even. In practice, the liquidator does not immediately sell the liquidated assets of the entire account in the open market, but slowly liquidates the accounts with insufficient collateral in order to avoid the one-time payment slip point. This would allow them to offset the protocol risk of holding these assets, rather than bear it themselves.
This assumption that the liquidator will sell immediately, in general, is exploited by the liquidatorLightning is borrowedThis is true for clearing a single transaction and selling a very large number of clearances, but may not be true for smaller transactions. In a small liquidation, all it takes is a liquidator with a lot of assets to step in and temporarily hold the mortgage assets while slowly selling them, rather than making a big trade and selling them all at once.
These larger liquidators will have more advanced execution strategies, such as time-weighted average price (TWAP) or volume weighted average price (VWAP), where the liquidator can choose to sell the position gradually over a period of time to reduce slippage costs. This type of liquidator will be able to increase their profits by paying fewer slip-point costs, rather than simply clearing.
While this strategy allows liquidators to minimize slippage, it exposes liquidators to the risk of losing the value of their newly acquired positions before they can exit (i.e., a sustained decline in ETH prices). This is a particularly dangerous proposition because liquidation can only happen if the price of the collateral has already fallen, which means that for a liquidation to happen, we first have to talk about a volatile asset that has just lost some value.
We can illustrate this risk by calculating the expected PNL (EPNL) instead of RPNL, which represents the expected value of liquidation after taking into account the time-weighted risk of holding a long position in collateral assets.

We've introduced some new elements here. We added a time variable that represents the time it takes the liquidator to close the position. Modify our slippage function to include time. Slippage decreases inversely with time because the market has more time to absorb selling positions. We also add a risk function that increases relative to size and time as the liquidator spends more time holding a volatile asset whose price is likely to continue to fall.
The definition of the Slippage() and Risk() functions depends largely on the complexity of the liquidator. Skilled liquidators will be able to adopt trading strategies that allow them to exit positions quickly while creating the same slippage points as less sophisticated liquidators (such as using automated trading strategies or over-the-counter trading). A sufficiently advanced liquidator might also take statistical hedging positions prior to liquidation, enabling them to completely change the form of the Risk() function.
So far we have only considered a world in which there is one liquidator. If liquidators choose not to liquidate an account, they can leave the account to be liquidated at a later date.In reality, however, there is competition for clearing, with many liquidators fighting for the same settlement.
Loan Agreements There are two main ways to select which liquidator gets a liquidation account.
Some DEFI protocols, such as Maker and DyDX, have an auction mechanism where a liquidator can bid for the clearing capacity of an undersecured account, dynamically setting a clearing discount. In this way, clearing discounts depend on market dynamics and can rise during periods of increased market risk/slippage and fall when risk/slippage is not apparent. If done properly, clearing auctions can be very effective, but add a great deal of complexity to the system. In a crash event, an unforeseen bug in the clearing mechanism, as Maker saw in the Black Thursday (March 12, 2020) price crash, can be catastrophic.
With a few tweaks, we can calculate the competitive PNL (CPNL) of our liquidators' auctions, which includes other liquidators' competition for liquidation discounts.

Here, we add the liquidator discount as a parameter to the PNL, where LD is the net effective liquidating amount of the liquidator winning the auction. The LD calculation will depend on how the auction works, but will include any fees /Gas paid to win the auction.
Other agreements, such as AVE, Compound and Notional, provide for uniform clearing discounts and allow liquidators to clear ona first come, first served basis. The first liquidator to call the liquidate() function in the protocol wins the liquidation, and the other liquidators lose the Gas they paid for the liquidation.
We are all familiar with the fact that the main way to speed up transactions is to pay more Gas, and that is true for liquidators as well.

The percentile of the price of Gas in the Ethereum block, in dollars per Gas
Here we see the decentile dollar /Gas trading price in December. The lowest percentage will fluctuate, but remain in the range of $0.00- $0.0002 (for convenience, Uniswap's one-trade Gas price is about 100,000, so for $0.0002 Gas price, Uniswap's one-trade Gas price is $20.00).
In extreme cases, we have seen the highest percentages spike at certain times on certain days, orders of magnitude higher than the price paid by the average Defi user. These outliers are where the liquidators (or other DEFI participants with high-priority trades) have allocated a large amount of Gas to their trades to maximize the chance that their clearing trades will pass. To some extent, we can simulate a first-come, first-served clearing with a simulated clearing auction, where agents bid using GAS instead of an auction mechanism. The big difference here is that first-come, first-served auctions have an upper limit on their liquidation discounts, as liquidators are forced to bid more Gas to win the auction, driving down the true yield.
Since there is no guarantee that you will win the clearing even if you pay the highest Gas in a first-come, first-served clearing, the liquidator must modify the PNL calculation to Competitive PNL (CPNL), which can be obtained as follows:

And here we've added a Gas term. Gas is the amount of Gas that a liquidator bids to ensure that a liquidated item is traded in the next block. Here we look at it as a deterministic process, with the highest bidder getting the liquidation right, although in reality this will come down to the expected chance that your trade will be broadcast and other Mempool means. For the sake of simplicity, here we can assume that GAS is using GAS or bribing miners to get your liquidation going smoothly.
3. Consolidate the model
In both the clearing auction model and the first-come, first-served clearing model, the PNL depends on market dynamics by winning the required GAS for clearing or the LD set by the auction. We can now think of LD as a function of the entire market, rather than as a constant value.

This equation is the same as the original EPNL function, but now it adopts the parameter Market which represents the overall Market situation, such as price change and volatility. As mentioned above, Market is a parameter to LD, which is now a protocol dependent function that can use either an auction model or a first-come, first-served clearing model. Slippage and Risk are also affected by the market and must be updated. For example, in a market crash, liquidity can dry up and lead to increased slippage due to exiting large positions and increased risk due to higher volatility in the market
Over time, we should expect market forces to push all agreements to end up with the same effective clearing discount. In the long run, the liquidator's choice of time/place for liquidation will balance out the liquidation discount across agreements. Ultimately, we can expect the effective clearing ratio for auctions or variable Gas prices to be the same.
Using the model outlined above, we can consider how the market will choose this clearing discount. Here we consider a theoretical market in which all agreements can be instantly cleared at the same size and with the same assets. Since the size and assets of all agreements are the same, we can model the clearing supply simply as CPNL (LD) and the clearing demand as the maximum amount the agreement is willing to pay for the clearing. We also assume that 50% of the agreements use a clearing auction and 50% of the agreements use a first-come-first-served clearing model.
Using these assumptions, we can plot the supply and demand dynamics of this market:

The part of the clearing demand curve (AB) that represents the demand of auction liquidators is vertical because these agreements will accept any clearing discount to sell their size.
The part of the clearing demand curve (BD), which represents the demand for first come, first served clearing agreements, is downward sloping. This is because while all of these agreements may pay a low effective settlement discount due to the Gas price, they have a maximum discount set by the agreement governance layer, meaning that they will not allow clearing at any discount. We assume that there are a variety of these agreements and that they all set the settlement discount at different levels, which results in a downward sloping nature of the line, i.e. the agreement with the highest settlement discount will settle before the agreement with the lower settlement discount.
Where the demand for clearing intersects with the supply of clearing represents market equilibrium (C) and is where clearing discounts are set for all clearing houses. This is significantly lower than the amount many of these agreements are willing to pay through the auction mechanism (100%) or the maximum amount (BC) set by the governance layer in the FCFS mechanism. This equilibrium results in a large producer surplus for auction-based clearing agreements and, in the worst case, they will be forced to pay all the collateral to the monopoly liquidator ((0,1), F, E, (50,1)). Since the FCFS agreement will still pay the liquidator discount set by its governance, but the liquidators will lose their PNL through competition on Gas prices, which means that the producer surplus of the FCFS settlement agreement will be lost to the miners, so the balance will also result in a heavy loss (BCE) through Gas charges. The liquidator will also receive the producer surplus in the form of profit (FCG), and this surplus will be attributed primarily to the most advanced liquidators as they can minimize slippage and risk.
Agreements with a maximum liquidation discount below this number (CD) will not be liquidated because they are unwilling to give the liquidator adequate compensation. If the price of their collateral continues to fall, these agreements are at risk of going bust. In the medium term, these agreements will become insolvent and exit the market. In the longer term, we expect these agreements to modify their clearing discounts through governance until they align with the market, eventually allowing 100% of the agreements to remain solvent through clearing.
The market clearing discount will vary according to the efficiency of the liquidator and the number of liquidations that take place in the market, which depends on the price of the lent asset. An agreement that does not use an auction mechanism must continuously monitor this market and reassess its clearing discount to ensure that collateral is not discarded if the market rate falls below its clearing discount and that it does not face the risk of bankruptcy if the market rate falls above its clearing discount.
Liquidation is complicated! There is no true "one size fits all" framework, and there is fierce competition among liquidators to improve efficiency. Competition also extends to the agreements themselves, which need to be competitive in this economic environment, both to ensure that they don't overpay liquidators but also to ensure that they don't run the risk of bankruptcy. Staying profitable in this world requires innovation and a deep understanding of the market.
The original link
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia