Skip to content

Instantly share code, notes, and snippets.

@pyggie
Created October 19, 2019 09:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pyggie/091b4632857146556cc9528e5af75a21 to your computer and use it in GitHub Desktop.
Save pyggie/091b4632857146556cc9528e5af75a21 to your computer and use it in GitHub Desktop.
Critique of Compound v2's liquidation system

Currently, Compound (v2) handles liquidations by enabling anybody to liquidate an at-risk account by repaying some of the account's debt and receiving collateral in return worth 105% of the amount repaid. The fixed 5% "liquidation incentive" has a few weaknesses. Most of these arise from the liquidator's need to rebalance their portfolio by converting the seized asset gained back into the repaid asset lost. If the liquidator does not rebalance, they are now exposed to market movements in both assets and possibly run out of inventory to perform additional liquidations. Some weaknesses with this system:

(1) The incentive does not vary by asset. For very liquid collateral types (say ETH or DAI), the liquidator can easily convert the seized collateral back to the asset used to repay the borrower's debt, losing little to slippage. In this case, 5% may be too generous. For illiquid collateral types (say REP or WBTC), the liquidator may struggle to unload the collateral. In this case, 5% may be too little.

(2) The incentive does not vary with the total liquidation size. Larger amounts of seized collateral are more difficult to recycle back to the repaid asset. For a small liquidation, 5% may be too much; for a large liquidation, too little.

(3) The incentive does not vary with changing market conditions. Liquidations tend to happen during periods of high market volatility, but not always. More volatile conditions are riskier for liquidators, because their temporary unbalanced position after a liquidation may quickly change in market value.

(4) The incentive varies unintentionally due to oracle price feeds. The amount of collateral seized in the liquidation is a function of prevailing oracle prices for the repaid and seized assets. The oracle prices always deviate to some degree from the prevailing market prices. This deviation changes the target incentive of 5% to some other value, possibly even negative in a highly volatile market.

(5) When the incentive is too generous (due to any of the reasons above), then competing liquidators vie for the right to collect the incentive. This leads to gas price auctions whose equilibrium result is to send nearly all the excess incentive to Ethereum miners. This is a tax on the borrowers who suffer by paying a 5% penalty when, say, 3% would have been sufficient. To make matters worse, the tax exits the Compound system entirely by enriching miners instead of the liquidators supporting the system.

(6) When the incentive is too stingy, nobody will try to collect it, and the account may go so far underwater that the collateral value drops below the debt, the borrower chooses to default, and lenders suffer a loss of capital. This hasn't happened yet but is the natural outcome of a trading liquidity crunch that might occur during a market panic.

All of this argues for a liquidation incentive that responds to market forces. One way to achieve this is with an auction of the collateral. For example, an auction might begin with a 0% incentive that grows each block until it attracts enough liquidators to bring the account back above water. This system would benefit both borrowers, who pay the least penalty possible, and liquidators, who keep all the incentive instead of sending it to miners.

@TennisBowling
Copy link

makes sense.

@pyggie
Copy link
Author

pyggie commented Jan 28, 2021

Here is another reason we should want to avoid a gas race ecosystem. The natural equilibrium in such an ecosystem is a single (gas efficient) predator with a scorched earth strategy. The predator posts signs everywhere saying it will outbid any other liquidator without regard for its own profit, guaranteeing that anybody else who tries to participate will lose money on every attempt. Then, once everyone else gives up, the predator can enjoy dining in peace. This is bad for the protocol because it is now at the mercy of a single actor who may find other uses for its capital just when you need it most.

@pyggie
Copy link
Author

pyggie commented Jan 28, 2021

In the original post I suggested a dutch auction across multiple blocks of increasing incentives. Although it has its own problems, that may yet be a good alternative. Another possibility is a fixed high incentive combined with a sealed-bid auction for the right to liquidate, say by using a commit-reveal scheme every 10-block epoch. Every 10th block the winners could perform the liquidations and would pay their bid amount into the protocol itself (or to the borrower), rather than to the miners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment