[Proposal] Introducing the New Anchor Liquidation Queue

Dear Anchor community,

We’re pleased to present the new liquidation queue mechanism for Anchor, which has successfully completed its audit and produces multiple benefits for Anchor.


Background

Anchor’s liquidation mechanism is deployed to sell undercollateralized borrower positions on the protocol where the LTV of a user’s outstanding debt position passes a certain threshold, and their collateral (e.g., bLUNA, bETH) is sold off to prevent borrower default and maintain parity of the larger money market’s solvency. The liquidation contract converts collateral of at-risk positions below a certain threshold into Terra stablecoins (e.g., UST), which are used to repay the loan.

For example, if Alice has a position of 100 bLUNA used as collateral at an LTV of 50% where the bLUNA price is $50, she can borrow up to 2500 UST. Should the price of bLUNA drop to ~$35, Alice’s position pushes into an LTV of 60%, triggering partial or full liquidation of her 100 bLUNA collateral – sold off for UST and used to repay the loan.

At-risk borrow positions are liquidated by bidders, who submit bids to the liquidation contract to win the borrower’s collateral at a discount.

The current liquidation mechanism on Anchor functions on a first-come-first-serve basis. Although bidders can set a premium rate (i.e., the signaled discount exchange for UST for the at-risk collateral in the liquidation contract), it does not currently affect the order of bids being executed.

The consequence is that liquidations are primarily based on the speed of bid execution rather than what the bidder’s premium rate is – precluding many users from participating in liquidations. With the new liquidation queue, liquidations will not be prioritized by speed and rather will be prioritized based on the premium rate.

The lower the premium rate, the higher the chance a bidder’s submission to the liquidation contract will be executed.

For some context, the premium rate is the discount bid for the at-risk collateral to be liquidated. For example, if Bob submits a liquidation bid at a premium rate of 10%, he’s signaling a willingness to exchange UST for Alice’s 100 bLUNA at a 10% discount. Previously, the size of the premium bid was irrelevant to whether Bob won the execution and could exchange his bid UST for Alice’s bLUNA.

With the liquidation queue, since bid orders are a function of the premium rate, it will encourage liquidators to reduce the premium rate for their bids in a more competitive market for liquidations.

We expect the delivery of this new mechanism to create an equilibrium premium rate that will benefit both the borrowers and liquidators.



The Effects for the Average User

The new liquidation unlocks a new door for the average user to participate in liquidations in a more egalitarian manner. Previously, only bots were able to execute bids competitively due to the fierce speed race for capturing at-risk collateral. With the liquidation queue, all participants can have a fair opportunity for bidding on liquidations.

All that users need to do to become bidders in the liquidation queue is to submit their bids with a corresponding premium rate. Bidders wait for the waiting_period to pass (~10 mins) and activate their bids, making the bids eligible for liquidations when they occur.

The liquidation queue subsequently awards bidders with liquidations in an order-book style format, with lower premiums higher up the book ladder and more likely to capture at-risk collateral (e.g., bLUNA). Speed of bid submission is swapped for strategic placement of liquidations bids and their corresponding premium rates.



Need for Current Bidders of The Liquidation Contract to Move Bids

Current liquidation contract bidders on Anchor that have placed bids on previous contracts should retract bids and move them to new liquidation contracts at the new mainnet liquidation contract address, which will be released publicly should this proposal pass.

Not retracting their bids will make their bids useless should the governance proposal pass to use the new liquidation queue. Bidders will be able to place bids before the governance proposal is executed, and once the proposal is executed, the bids will go live.

Notably, Kujira, a third-party team we’ve been collaborating with, has released a front-end for the new liquidation queue will offer regular Anchor users an intuitive interface to participate in the new bid process. You can find the interface from the Kujira team in the link below:

NOTE – A 1% fee is charged when withdrawing liquidated collaterals through their Web App.



Moving Forward

We want to encourage more open collaboration, discourse, and engagement on Anchor’s governance. The liquidation queue is the latest opportunity to discuss relevant items pertaining to Anchor and its community governance. Please allow for open discussion in the comments below.

A formal governance proposal for Anchor’s migration to the new liquidation queue will be initiated at 10/26 11 AM UTC (8:00 PM KST)

14 Likes

Great idea. What about also creating an “overdraft” mechanism? If a user has staked Terra assets the system could pull those assets into the borrow to cover. For example if I have staked anchor, Luna, or mirror, and I’m close to liquidation the system would either sell those assets for UST to pay down loan or flip those assets into bLUNA to cover. It could also put the user in a delayed liquidation process that provides a set time to cover and pay off loan. Volatility or flash crashes often happen at odd times when least expected or near phone/computer. Needs to be worked out but that’s my starting point.

3 Likes

I believe that wont be easy as most staked terra assets, have an unstaking lock up period, which makes them not readily available.

3 Likes

Anything that levels the playing field for regular users, and offers novel and intuitive products to profit from whilst supporting ANC, should really be encouraged. Nice UI, super helpful team and great branding make this seem like a no brainer to me. Congrats to all concerned.

2 Likes

Hi @ryanology045,
I believe it’s a great idea for the fair liquidation process and another step towards full decentralisation of the Terra ecosystem (from the liquidation side) which allows anyone to participate.
Сould you please clarify the following points:

  1. Do you know what is going to be with TFL Liquidator? It has quite a lot of bids right now (5m UST for bEth and 59m UST for bLuna).
    1.1. Will it participate in the new Anchor Liquidation Queue?
    1.2. What is going to be with that assets if TFL Liquidator will not participate in the new queue?

  2. According to the Kujira UI, the max premium rate (discount) is 30%. The current max premium value is 15%, as it was changed in the Anchor Gov Poll #3.
    2.1. Will the value be changed to 30% after the proposal pass?
    2.2. If so, why is it not done in the same way as before - by voting?

  3. If a borrower, that is going to be liquidated, has MIXED collaterals (bLuna + bEth), should the bid be submitted for both collaterals, or only one would be enough?
    UPD. found from the loan-liquidation doc that the answer is YES, two bids are necessary. :slightly_smiling_face:

  4. What is going to be, if the amount of collateral needed to be liquidated is higher than the total amount of bids submitted for the particular premium rate section (which is the next in a queue)? Will it be passed to the next premium rate section in a queue, the one that has the necessary amount of UST?

Thank you in advance!

1 Like

Overdraft mechanism is a great idea. The unlock period would make this difficult for LUNA, but perhaps something with other Terra ecosystem assets, such as ANC, MIR, or MINE would work.

1 Like

Interesting mechanism, especially within Anchor itself (perhaps with a priority system (Earn UST > ANC LP/Gov), but there would need to be a way to opt-in or out of the mechanism (perhaps some wouldn’t want their X token liquidated, and knowledge of the mechanism should be ensured).

I’ll vote favourably to the new liquidation queue. Thank you for your work.

Interesting new queue! I’ve been digging through the smart contract, and I see that bids are eligible for instant activation as well. What constitutes that property?

1 Like

So A synthetic asset should be created in this instance to make it liquid, just like bLUNA

1 Like

Well thought out.

Liquidation protection is a great idea. Nexus protocol is building just that and much more.

Also wondering what @HarpoonProtocol (now lighthouse protocol) thinks about building in user liqudation protection into their defi liquidation tools.

How do I change the settlement contract direction in the bLuna custody, bEth custody, and supervision contracts to route settlements to the new settlement queue contract?
and how can i vote?

checkout the raw execute messages in the poll; you can see those contracts updating their configs to the new liquidation queue contract.

you can vote on the anchor web app, or send the vote message to the govt contract.

Here are the points:

Q1. That liquidator is operated by TFL and not the Anchor team, so I don’t really know how that’ll be handled after the liquidation queue goes live. But the big difference is that bots don’t have any advantages in the new system - it’s no longer first-come-first-serve.

Q2. 2.1. Yes the value will be changed to 30%.
2.2. It’s quite difficult to create proposals that determines the initial launch parameters of a contract. Doable, but the steps will be highly inefficient. Do agree this is the way to go though. Anchor governance probably requires a mechanism improvement.
As for the reason for reverting back to 30%, it’s better to be conservative as this is a new mechanism that never existed before. However, I don’t think this value would matter too much as before. Bidders now have an incentive to compete for lower premiums - liquidations with 30% a premium will be rare imo.

Q3. Yep bids for both collaterals will be required

Q4. Yes

Wouldn’t adding those assets as collateral (in the form of bAssets) achieve the same goal?

1 Like

The activation period (initially 10mins) is to disallow bots from front-running the system (preventing bots from retracting & resubmitting bids with higher premiums when market volatility is high).

There’s one case where the activation period can hurt the system though: when there’s not enough bids in the queue due to mass liquidations. When the bid amount per collateral is below a certain threshold (5M UST for bLuna, 1M for bETH) new bids are instantly activated so that they can immediately be a part of liquidations.

3 Likes

@Joe_UST this is an interesting idea.

Definitely needs a bit more iteration but it is a mechanism I have yet to see in crypto.

Would it be possible to expand this idea across protocols? Instead of using only staked assets a mechanism could create a hierarchy (decided by the user) and liquidate or swap positions to maintain a liquidation threshold which they deem most important.

Many users in the Terra ecosystem have spread their investments across different protocols and revenue streams. By ranking them and being able to manage them in one place it would incentivize increased use of protocols such as Anchor and return confidence to users.

This idea could be carried across chain once further developed as well. I am not entirely sure about the technical feasibility so if you are a Rust dev please jump in!

I believe what you are referring to is what is being called cross margin collateral. It’s being developed by several protocols on SOL now running of SRM. It is an idea that gets the crypto space closer to mature capital markets where your whole portfolio can be used as collateral on signal position (Drift & Jef and Defi Swap protocols are doing this among many other amazing things).

Some things to think about when moving towards this is the following:

  1. On top of needing to write a contract that would auto sell and bond these assets ahead of liquation (complexity?), there are other things needed to be worked out.
  2. While it would be amazing if you could somehow liquidate assets from other protocols, I’m not sure how to whitelist these users’ assets to do that. If whitelisted for margin calls, I don’t think these assets would be able to be locked up in staking or in LP pools etc . Perhaps it could start with idle UST in wallets? Maybe someone else can weigh in on this point?

Next to get this closer to what Drift and other protocols are doing on SOL here are some thoughts and questions of building a cross-margin pool option in Anchor:

  1. Multi-token b-asset pool: Will a user be able to deposit multiple b-assets at once, in one batched transaction?
  2. As b-assets expand I foresee different collateral types having different risk profiles. Each collateral type would need an assigned risk profile based on probably both subjective data such as the reputable team behind the project and some algo based risk ratio based on data such as market cap, TLV, number of unique wallet addresses, historical volatility (ideally implied).
  3. Does a cross margin b-asset collateral pool require cross b-asset token as a liquid representation of users pool ratio? and would this have utility, say in mars, levana etc?
  4. can the risk of a multi-pool be properly mitigated with point 2?

@PFC @ryanology045 interested to hear your thoughts.

1 Like

The idea of a overdraft is ok, but I think it breaks the mechanism a bit. ANC uses collateral to power the earn side. If people start using overdraft, how will the earn side get their interest. so while it might be good for one side, it strains the other… unless we charge some other kind of interest on the ‘potential’ overdraft size… but by the, your just better off sticking it in as collateral no?

Now if we start using other things it introduces a lot of risks, and different kind of risks.

  1. The obvious ones are liquidity & volatility. how liquid is that PEEP coin? can we actually exit it if need too

  2. The other kind is secondary risks… what happens if PEEP uses anchor behind the scenes. are we creating feedback loops when we liquidate?

Another approach I like is time based margin call protection

What if Anchor charged a bit of a higher rate, but it stopped liquidations from occurring for say X minutes/hours? say 1% for 10-minutes, and 5% for 1-hour, and 15% for 6-hours (making the numbers up obviously. I’m not a quant).

This would give the end-user a chance to liquidate other holdings, and fix their LTV, as well as reduce some of the bumpiness (like the $9 drop that happened, which quickly recovered a bit).

Agree. It’s why we would need to start looking at metrics like I laid up above if we do introduce new b-assets.

I’ve been thinking this over. One black swan risk comes to mind. Markets can move fast in a matter of seconds and compound in mins. If someone hits liquidation threshold and markets continue to free-fall, even more, say another 40% we risk the protocol losing money and facing solvency issues if enough big wallet balances did this. While rare, something to consider. There would have to be a further buffer ratio that over-rides the freeze here.

1 Like

Most but not all… I got liquidated nearly 100 luna on the 4th by 5cents. The real painful thing is when you look on the history - I got liquidated seconds before I unstaked from one of my many loop pools and provided ample collateral to have avoided liquidation… I mean the transaction times of being liquidated and adding liquidity are the same hour and minute, literally a few seconds between… I don’t care what anyone says- bare bloody minimum I should of got a warning notification or something… really really unfair and I can’t help but feeling robbed by a family member :pensive:

1 Like