Improving Liquidation

Problem

The Comptroller contract stores a Liquidation Incentive parameter, which is currently 8%. This incentive is used to entice liquidators to perform liquidations.

Lately, “predatory” liquidators have begun burning the liquidation incentive in gas fees, earning no profit for themselves, and transferring all profit to miners (MEV).

While this is effective at de-risking the protocol (in the short-term), it is driving community liquidators out of business. The quantity, and diversification of liquidators is what provides safety for the Compound protocol. If the predatory liquidators are successful at discouraging community liquidators, the health of the protocol will be jeopardized.

Improvements to the liquidation process are needed.

Possible Solution

The liquidation incentive can be split between the liquidator (5%), and the protocol reserves (3%). This brings multiple advantages:

  • Regardless of whether the liquidator is friendly or predatory, the liquidation increases reserves, which benefits the users (safety), and COMP token-holders
  • Cascading liquidations pose less of a risk to the protocol; each liquidation increases the cushion for the next liquidation
  • The threshold at which the protocol suffers insolvency from a single address improves by 3%. This is because the “break-even” health of a user is ~ (Collateral Factor + Liquidation Incentive); the larger the liquidation incentive, the less collateral available to protect the protocol

Second, the gas costs of liquidations can be optimized; reducing the gas required to liquidate, and limiting gas battles – which will benefit community liquidators.

Trade-offs / Risks

Decreasing the liquidator incentive to 5% may reduce willingness to liquidate.

Counter-argument: prior to the cascading liquidation / sell-off in March 2020, the Liquidation Incentive parameter was set to 5%; this was sufficient to always incentivize liquidation on a first-come first served basis. It was raised to 8% out of precaution (during an extremely volatile week).

Potential Improvements

cToken

[core] In seizeInternal(), transfer 97% of the seizetokens to the liquidator, and 3% of the seizetokens to the Comptroller

  1. Store a third balance in memory for ComptrollerTokensNew
  2. Emit event for second transfer (to Comptroller)
  3. Note: this math would actually be 3.24% incentive going to the protocol, 4.76% to the liquidator (based on math!), which is OK - you could also calculate the right ratio

[optional] Liquidation gas optimizations
The cToken and Comptroller have myriad opportunities for small iterative improvements to gas cost, including graceful failure info, duplicated checks (e.g. for freshness, borrower=liquidator), etc. There may or may not be low-hanging fruit.

Comptroller

[optional] In liquidateBorrowAllowed(), require that tx.gasprice is below an arbitrarily (yet reasonable) threshold, e.g. 2,000 gwei; this would limit gas-racing to MEV

[optional] In liquidateBorrowAllowed(), only check the closeFactor for borrow balances over $100,000; this would allow fully closing small borrowing positions, which is more gas optimal

Deployment / Rollout

The core incentive changes would be at a cToken level, and would only apply to upgradable (2nd generation) cTokens, including DAI, USDT, UNI, and COMP, which would be upgraded through a governance proposal.

The major collateral markets, ETH & WBTC, would have to migrate to upgradable cTokens - which is a long-standing goal - for which these liquidation improvements are a good catalyst.

Future Improvements

  • Dynamically weight the incentive between liquidator and protocol; accounts that are deeply unprofitable could carry a larger weighting towards the liquidator (e.g. 8%), incentivizing the closure of the most at-risk accounts first.
  • Adjust the incentive based on a function of time (similar to an auction model)
5 Likes

I think the major disadvantage to this policy is that at minimum it creates the perception of misaligned incentives and may indeed created misaligned incentives.

Think about all of the complaints about BitMEX profiteering from MEX liquidations. Even if there is no concrete evidence of bad behavior, at the very least, it creates the perception that the protocol might care a little less about liquidated borrowers, and might do a little less to ensure that liquidations are handled “above board”. I’d fear that the Compound brand would suffer as a result.

2 Likes

By my understanding the issue with bitmex was the platform itself (supposedly) using proprietary information to hunt for liquidations and stops and then profit through the insurance fund, but this shouldn’t apply for on chain lending where positions are visible to everyone on an equal basis.

Liquidation fees are a simple and coherent way to charge riskier users more than safe users.

3 Likes

Percentage

Reserving a portion of the liquidation fees into the contract makes sense to me. Cascading liquidations are indeed a concern.

However, I don’t see how changing these percentages alters the balance between MEV liquidators and non-MEV liquidators. In either case there is a fixed amount of profit to be had for the liquidator, and some portion of that potential profit must be spent for gas. Simply reducing the maximum profit available will not make it any less favorable to MEV liquidate. Right?

Gas Limits

I’m strongly opposed to a gas limit however. If my understanding is correct, Compound’s liquidations only function correctly inside a band of prices. If the securing asset price has gone too low, or the borrowed asset price has gone too high, then it no longer makes financial sense to liquidate. It is essential that liquidation happen quickly when inside the band. In a case when Compound would be in most danger, with insane price moves on major assets, it is almost certain that gas prices would rise to astronomical levels as every trader franticly attempts to avoid losses, or to profit from the changes. This would be the worst possible time to lock out liquidations.

The current issue comes from the ability to be able post price by anyone, liquidators include the prices in the transactions where they liquidate and the gas price race is unlimited to the edge where there is no profit.

Explaining the situation on the previous oracle when Compound Labs was posting the prices to the oracle:
in this case the liquidator wanted to be in the same block where the oracle update tx was and the liquiadtion tx was limited by the gas price of the posted price tx gas price, so there was no gas price race in this case, and the winner was “random” accordig to how the transactions was indexed in the block cause they was all at the same gas price.

I could see a potential fix of burning the profit in gas by disallowing calling the oracle update function from contracts meaning it would be forced to be a seperate transaction, and the liquidations could be limited again by the oracle update transaction gas price.
The incentive for the liquidator to update the oracle in this case is till there.

4 Likes

Absolutely fascinating issue.
The problem with a gas limit is that in a liquidity crunch like in march, gas prices could go through the roof.

Maybe having maximum gas as a function of a moving average of gas prices. i.e. 5x current gas prices?

Front running in Ethereum is a noted issue.
Not sure if it will ever go away, maybe community liquidators are gone forever.

This article is well written and explains this better than I will ever be able to.

Few points:
Talk to the the ones running the bots.
Academic/high level research is needed for this.
Grants committee?

3 Likes

It’s obvious, that this problem is caused by the chosen oracle design as liquidators can post the new prices themselves. Instead of trying to cure the symptoms, I think it’s a better idea to cure the problem at the root. This means by replacing the current oracle by a better solution. This can easily be done by using an existing, proven solution like Chainlink.

The oracle solution, which is discussed here, won’t solve this problem as it can be read in the protocol of the last developer call: “Getty mentioned that posting is somewhat subsidized by liquidators because it is in their best interest to post prices on chain in order to perform liquidations. In the early form of the Medianizer there will not be any new considerations to gas costs.”.

1 Like

its worth to mention that this is also not a perfect solution, what i did explained above, if none of the liquidator manages to be included in the same block where the oracle update would be, then it would be open again for an unlimited gas price race in the next block, so this is just a slightly better case.

3 Likes

Please don’t use quotes if you aren’t quoting the exact words I wrote or said.

This is not true. I have written and said that gas efficiency is important in the design of the medianizer.

Well, perhaps you should have clicked on the link to the protocol I included in my message. I quoted the exact text of the protocol. If you think this is not correct, you should blame the person who wrote the protocol and not me.

1 Like

Please keep the conversation respectful and polite, and focused on the topic of the thread; namely the behavior of certain liquidation bots to deliberately spend the 8% liquidation incentive on gas.

1 Like

Well if there is collusion between miner and liquidators, then are they really “spending” gas or wash trading? I think we need to dig deeper into individual front runners.

1 Like

this will not necessarily decrease the MEV, as it will give rise to spam txs, namely, instead of broadcasting a single tx with high gas price, bots will send many txs with lower gas price.
Such behavior was observed when dydx price feed was back running friendly (as opposed to front running).

Imo here it is very important to define what is it Compound is trying to solve.
For example I think this would help a lot towards mitigating black thursday like events, where liquidations completely failed, as it will allow the COMP dao to use the accumulated fees are an insurance fund.
But will be less efficient if the future is to increase the collateral factor over time, and reducing the liquidation incentives will inevitably lead to less efficient liquidation process. And the community will probably be reluctant to use the insurance funds on a day to day basis.

Imo the first come first serve approach (and in general, giving liquidation incentives without any commitment from the liquidators) is the problem of all DeFi liquidation approaches.
And B.Protocol, the project I am working on, is trying to solve it.

2 Likes

Just wanted to add a +1 to this post and suggestion. I too believe that liquidators should not have the option to update oracle prices in the liquidation transaction.

4 Likes

I just wanted to pointed out that this gave rise to back running which results both in MEV and Ethereum spam.
So solutions like price kicks in only one block after its update, are imperative to prevent the spam (but of course give rise again to front running => high gas price).

1 Like

Coinbase price feed is irreparable, simply that product is not valid (it is not the only one that is weak from their product suit).

How come now “very important” liquidators will be disincentivize? To protect protocols and protocol users, it is necessary to eliminate MEV players and sophisticated bot liquidators completely.
By eliminating them, they would remain on rational liquidators, preferably the liquidators from the compound community.
As a user of the protocol, I am always in favor of increasing reserves, but the proposed solution is still a danger for lenders since we got stuck with the Coinbase product (changes mean nothing if DAI pump to 1.5$).
A reasonable solution would be a combination of Bprotocol and Defi Saver (or equivalent in the Compound implementation)
Bprotocol offers a solution to keep asset value within the protocol using “jar rewards” and offer liquidators predictable profits without gas fee wars. On the other side, Defi Saver allows setup automatic liquidation without the cost of premiums, i.e. (users alone set-up repay or leverage threshold).

3 Likes

Large mining farms and pools are against EIIP 1559 because predictable gas cost and better UX for users. I don’t think they protest because burning base fee. Large profits for miners are made through liquidations with gas fee wars.
it is necessary to remove these parasites as soon as possible so that they do not have the ability to influence the protocol in this way.
I will rather pay 10% premium to community liquidator then 1% to well designed manipulation scheme.
Is that possible in technical sense?
I think asset management project that i mention (bprotocol and defi saver) are already work on that so that it is feasible.
My business depend on this protocol and I don’t play farming games for quick profit.
Question is which users Compound want on protocol? Clear speculators and arbitrage bots or real users with clear usecase?

I also read that article (and all others about that topic),
and I think situation is not good

Clear speculators and arbitrage bots are a clear use case. We are all capitalists and are looking to maximize our wealth.
We are all wallet addresses on the blockchain, how could you differentiate?

I respect your statement, it’s okay to have a different opinion. However as far as the adoption of DeFi technology is concerned I think the ultimate goal is to fix the shortcomings of the traditional financial system, not to create a gambling place.
We are not wallet addreses, we own many wallet addreses and for differentiate that we try to build protocol which serves humans rather than bots.
I have nothing against speculators and liquidation bots I just think there is a better way to solve account insolvency problem, protect user funds and protocol stability.
The protocol must attract real businesses and create real value, currently this is a leveraged farming bubble in which speculators with 50$ harm users.

3 Likes

As the percentage earned by the liquidator decreases, it becomes unprofitable to liquidate smaller (“dusty” in makerdao parlance :slight_smile: ) debt positions.

Would reducing the liquidator incentive from 8% to 5% create issues for Compound with dusty borrowing positions?