RFC - Abracadabra Community-Focused Liquidation Mechanism

This is a proposal to create an anti-bot, community-focused liquidation mechanism for MIM markets. The objective is to improve the stability of the Abracadabra money market by involving you, the community, in this critical part of the ecosystem, by putting control in the hands of many more, rather than the few. Making the liquidation process more democratised ultimately reduces the risk liquidations bring to the Abracadabra Protocol.
The rest of this document lays out why this is necessary, the benefits a more decentralised liquidation queue has for all users, and how this solution improved another chain.

THE CURRENT STATE OF LIQUIDATIONS

The vast majority of liquidations happen on a first-come, first-served structure. This means when people are liquidated, a handful of bots with large capital reserves race one another to buy the liquidated collateral on offer. They usually do so at the highest premium allowed and inevitably sell these assets on the open market right away. Not only do the few benefit from the losses of many, the way in which itā€™s done extracts the maximum benefit, takes the maximum toll, and often aids in protracting the declining price. Managing the risk of liquidations going wrong for Abracadabra are in the hands of the few. This is not ā€œdemocraticā€. This is not what DeFi is about.

A PROPOSAL TO FIX LIQUIDATIONS

The proposal is to create a new queue-based liquidations contract. The new design abandons the method rewarding the few at the expense of the many and allows any user to bid on liquidated collateral, making the process truly democratic and decentralized. Most importantly, a process that does not rely on speed eliminates any advantage a bot has. Anchor Protocol on Terra recently implemented this style of liquidation queue, and itā€™s changed the game for both the network and the community.

V1 liquidation contract: $LUNA went from $15 to $4.18 in 5 days

Since the launch of ORCA, $LUNA has bounced back incredibly well after market downturns, when previously liquidated collateral was exclusively market sold and contributed to the drop in price.

*WHAT NEEDS TO BE DONE TECHNICALLY?

On a technical level, we propose to extend the ā€˜liquidateā€™ function on the ā€˜Cauldronā€™ contract. This currently automatically exchanges the MIM provided by the caller at the ā€˜LIQUIDATION_MULTIPLIERā€™ rate. The proposed updates adds functionality for the Cauldron to act as custody for biddersā€™ funds, maintain an ā€œorder bookā€ of bids and then use these funds when collateral is liquidated. When the ā€˜liquidateā€™ function is called, the queue will calculate the effective premium rate, repay the market with the according amount of MIM, and allocate the amount of collateral available for withdrawal by individual bidders.

In order to prevent front-running by bots, and create a fair system for all, bids will become ā€œactiveā€ and available for use 10 minutes after they are placed. The exception to this will be when the combined bid amount is less than some configurable value, in order to allow bids to be active instantly and prevent the pools from emptying completely.

THE BENEFITS TO ABRACADABRA

The biggest problem and risk that lies with Abracadabra is the issue of cascading liquidations. When liquidated collateral is only offered to bots that run liquidators as a ā€œjobā€, a small group of people accumulate a VERY large sum of the liquidated asset. Generating revenue in this manner requires constant capital so these solutions often involve the asset being dumped on the market, causing a further run of the price, playing into the botā€™s rinse-and-repeat tactic, to the detriment of the token and its holders. This is the so-called cascading liquidation event. Cycles like this are less likely if liquidated collateral is spread democratically. Doing so results in thousands of individuals possessing the discounted asset, each with their own strategies to hold, stake, etc. This creates a LOT less volatility during the liquidation, creating less violent movements, softer landings and shorter bottoms. Importantly, it means the community is providing the liquidity for liquidations; another stabilizing effect on the ecosystem.

BENEFITS TO PARTICIPANTS

Democratisation is paramount in Defi, and the distribution of liquidated assets on most chains fly in the face of this. Kujiraā€™s product ORCA is the first dApp on any chain allowing users to bid on liquidated collateral using an intuitive UI, with absolutely no technical know-how required. This resulted in borrowers getting liquidated at lower premiums, and thousands of users able to buy assets on discount. A textbook win-win case study.

A CURRENT EXAMPLE

To put the above into perspective, here are statistics from a liquidation event on Anchor Protocol on the 4th December 2021. These are from ORCA.

  • $15.8m in bids were filled

  • 697 bETH and 318 000 bLUNA were bought

  • Average bETH price: $3379

  • Average bLUNA price: $42

  • Min bETH price: $3261

  • Min bLUNA price: $39.99

Before ORCA and, more importantly, the new bot-proof liquidation queue, all the discounted assets would have gone to five bots at the maximum premium allowable. They were instead distributed to 7500 community members. User success stories can be seen in this thread.

HOW DOES THIS EVEN WORK?

Put simply, you - and the rest of your community - place bids to buy at-risk collateral at a discount.

Bids are placed in a queue at varying percentage discounts (premiums). When a loan crosses the safe ratio, and the collateral is sold, itā€™s bought using the bids in the queue.

These bids are pooled into groups - eg 1% buckets - and when collateral is liquidated, priority is given to the bids in the pool with the smallest discount (the lowest premium). Letā€™s use the wAVAX market as an example.

At the time of writing, wAVAX has a price of 81.4 MIM, and the safe ratio is 75%. Letā€™s say somebody deposits 20 wAVAX and borrows 1221 MIM. Tomorrow the price of wAVAX suddenly drops to 75 MIM, and this personā€™s wAVAX (the collateral) is due to be liquidated.

In our hypothetical situation, 30 individuals from the community have each placed a 30 MIM bid in the 5% pool, and 40 more have each placed a 20 MIM bid in the 10% pool. The liquidation process goes as follows:

  1. The market is selling 20 wAVAX, currently worth 1500 MIM, to the liquidation queue
  2. The 5% pool - as the smallest pool containing bids - activates first
  3. It contains a total of 900 MIM
  4. This 900 MIM purchases wAVAX at 5% less than the market price (71.25 MIM each); 12.6 wAVAX is bought and split pro-rata amongst the bidders in the pool. They all made equal bids, so every bidder receives 0.42 wAVAX for their 20 MIM bid
  5. We still have ~7.4 wAVAX to liquidate, so we go to the next pool containing bids - 10%
  6. Bidders in this pool will buy wAVAX for 67.5 MIM each. We have 800 MIM in this pool and only 7.4 wAVAX left to liquidate, so this pool will only be partially used.
  7. The remaining 7.4 wAVAX will be sold for a total of 499.5 MIM. Split equally, each bidder will buy 0.185 wAVAX for 12.49 MIM. They will each have 8.51 MIM remaining of their initial 20 MIM bid, ready for the next liquidation.

The overall result here: instead of one whale with a bot buying 20 wAVAX at a 20% discount, those 20 wAVAX have been distributed amongst 70 individual participants in the liquidation queue. The total repay amount is 1397.25 MIM; an average discount of 6.85%. Weā€™ve also saved the borrower from a painful 20% liquidation.

THE TIMELINE FOR IMPLEMENTATION

Once the new liquidation queue is built, the integration into ORCA can happen within a week or two; this is easily achievable in Q1 2022.

WHAT HAPPENS NEXT?

A change in the Abracadabra liquidation contract would mean great things for the project and more importantly, the community. Itā€™s time to take back control from the bots, and put liquidated collateral into the hands of the people. A partnership between Abracadabra and Kujira will be a key one, ensuring that we are always moving forward and growing in this Defi space.

CONCLUSION

Liquidations have been a tool abused by the few to benefit off the many. Their structure has served to undermine systemic stability, and they have added to the risk and pain of borrowing, making capital movement riskier and more expensive.
By rewriting the contract, we have an opportunity to reverse all of those things, adhere to the tenets of decentralisation and create a system where capital can flow more freely, and be shared by many. It is a crucial improvement to Abracadabra, and we urge you to not only support it, but take part in it.

46 Likes

This is a clear writeup with solid example details and makes sense to me. More power to the frogs, less to the suits, thank you. I do wonder however, is ORCA the only protocol partner we should be considering? Clearly itā€™s already working with Anchor and thatā€™s a great pedigree, but is building the functionality native to Abra an option? Or are there other benefits that come from the partnership which Abra might struggle to achieve on its ownn (for eg, depth of liquidation liquidity / diversification of liquidator population etc)?

6 Likes

This is an excellent proposal, where do I vote on it?

4 Likes

this proposal embodies the ethos of Frog Nation and an example of how diligent and forward thinking our community is, great ideas happening at the speed of light. As usual the devil will be in the detail, but I think the concept is fantastic.

5 Likes

How could you be against this as a frog. Do it NAO

3 Likes

Highest priority item, amazing. Yas.

4 Likes

Amazing yes 1000x over

3 Likes

Great write-up. But I was wondering, to improve the health of all frog nation, could we have the protocol do it with reserves and send profits to sSPELL stakers instead? current APR is kinbda low.

Or, we could have Wonderland use itā€™s treasury to do this. still keeping the money in the family kinda thing. helps the protocol grow instead of just individual wallets.

Just a thought.

4 Likes

This would be amazing! Itā€™s so much better than the liquidation bots, both for the liquidatee and the liquidator. However Iā€™m worried that Abra would have to recreate all cauldrons. Is this the case? Would it be possible to create a migrate functionality that would allow for freely (w/o borrow fee) upgrading to a non deprecated cauldron that has the same token as collateral? Iā€™m also considering this as it would be useful for future cauldron deprecations such as with the UST cauldron.

1 Like

Yes Please. I always wondered how I could buy liquidity, and it appears that I wasnā€™t able to before, but now my wish will come true.

1 Like

This means less fees for stakers? Is there a way that can be mitigated?

1 Like

Bprotocol is focussing on such issues/topics.

Further infos in the thread from last month

Also there was a snapshotvote in October here on it

https://snapshot.org/#/abracadabrabymerlinthemagician.eth/proposal/QmVtBKUF3MqNA4bhcQn1XrsPrbRtcRbDBXMNebLV5tq3dM

1 Like

Love it. This will help everyone.

2 Likes

As long as it reduces liquidation effects on the price of $TIME and helps both borrowers and holders,am all in

1 Like

Sounds like another solid solution to develop a more fair system for us all. Iā€™m in.

Not to clear on the downsides of it, if there are any.

2 Likes

:frog: nice work, could be a very nice idea! :frog:

1 Like

The only downside I can think of is slower price recovery of TIME, but the price will be more stable.

1 Like

It should be faster as people that want time are buying. Not bits that then go on to sell time as soon as possible

wow, this is big brain stuff. Buying assets during liquidation events is usually a good idea and this allows the average user to get an even better discount on assets they want to hold. Itā€™s sort of like setting an on chain discounted limit orderā€¦

I would like to see a comparison between this option and B. protocol though, as they both seem to be doing similar things in different ways.

This is a nice write up. Just want to make sure I understand your proposal properly.

You are proposing that the abra team creates this novel (for evm) liquidation queue contract, have it audited and deployed to mainnet, but leave the front end for your project? Looking at kujira, you guys take a 1% cut of liquidations?

Why on earth would abra do all the work of creating this mechanism but not just put the liquidation queue frontend on abracadabra.money where anyone can use it without paying a 1% cut to a 3rd party? I like the proposal, we can simply cut out the part where kujira takes a 1% cut of all liquidations for doing the least amount of work (frontend) and have abra host the front end with a 0% fee for using a UI.

2 Likes