New liquidation: over 50% of collateral?

The liquidation to my wallet today saw a sell off of over 52% of my collateral. Seem unnecessary to reach down to 80% LTV.

Say I had 1,000 bLUNA collateral, that resulted in selling off of 520 bLUNA in order to bring the LTV to 80%. But that basically paid off over 60% of my loan? Previous liquidation sold off some 20%-30% of my collateral. Nowhere in the documentation does it say that we’d lose over 50% of our collateral upon liquidation.

Could repeated liquidations have been triggered by the smart contract? The math does not add up.

In the above example, the borrowed amount with today’s prices would have been about $65k, then the liquidation sold off about $41k worth of bLUNA so that the new balance with 480 bLUNA has about $29k borrowed of about 80% LTV. Well, 80% LTV could have been reached without selling 520 bLUNA.

To understand the impact of the actual account, imagine multiplying all of these numbers by several magnitudes.

How does the contract work and why was the liquidator so excessive?

3 Likes

Can you share the transaction where the liquiditation happened?

1 Like

on p2 the transaction is: Terrascope

There was some confusion with the transactions so here is the breakdown. at the time of liquidation, the collateral was exactly 10,000 $bLUNA, and the borrow was approx. $656,000 with liquidation price at $82.27.

LUNA price dipped to about $81 this morning (I did not hear my alerts).

The liquidator sold 5,194 bLUNA and I found I was left with 4,805 bLUNA and about $290,000 of borrow which indeed was at 80%LTV.

How can a liquidator indiscriminately sell my collateral to cover a loan that is barely 1% over the liquidation limit?

Is everyone’s collateral potentially at risk to get a greater than 50% liquidation? This is a very different perspective than the “safe” 80% LTV that is in the documentation.

I’m having trouble understanding the issue. So are you asking why didn’t the protocol auction off the say 1 or 2% you needed to restore balance versus the 52%?

My best guess is the auction has to be profitable for the liquidator as well to take place. Protocol would favor the liquidator to reduce it’s risk. In this case it happened to be that the 520 bluna was the minimum required to be liquidated for the arbitration to be profitable.

I guess your right it “could” have sold less bluna at more risk to the protocol. Nobody is going to carry that risk though. The losses your talking about are virtual since they only apply if the luna was not sold off and the value went up. Luna could keep going down to 0 in any instance and would you still have the same complaint about the oversold collateral?

2 Likes

No, I mean, liquidation does not mean that the excess over 100% is sold only. I had one other liquidation in the past, and the liquidator sold off some 25% of my collateral. that seemed reasonable. I can dig up the numbers. The instance here was that the LUNA price did not continue dipping os the liquidator had no reason to play it safe and over-liquidate to such an extent. Think about it: 10,000 bLUNA with Borrow of 8,000 bLUNA triggers liquidation. It is a simple mathematical problem: what is a lower value that can be reached with an LTV of 80%?

Ex1: Sell off 2000 bLUNA, then end up with 6,000 bLUNA worth of Borrow and 8,000 bLUNA collateral which is 75% LTV (but say we want higher than 5% premium)

Ex2: Sell off 4,000 bLUNA and end up with 4,000 bLUNA worth of Borrow and 6,000 bLUNA collateral which is 67% LTV (so some 13% premium at least)

Ex3: Sell off 5,200 bLUNA and end up with 2,800 bLUNA worth of Borrow and 4,800 bLUNA collateral (my case) which is 58% LTV (so 22% premium at least)

Ex4. Sell off 6,000 bLUNA and end up with 2,000 bLUNA worth of Borrow and 4,000 bLUNA collateral which is 50% LTV and (30% collateral)

My complaint/question is: Can any of these cases realistically happen? Are liquidators free to liquidate as much as they need and “feel” is appropriate? That means people’s collaterals can be liquidated as far as 75%??? Might as well leverage trade then and risk all 100%. This makes no sense but if it is the case, can we explicitly state this because people’s risk management approach would be very different in this case? This would be a negative for Anchor and I am a huge Anchor bull and fan and want to help Anchor find more borrowers. But need to understand exactly why and how the liquidator determined that they should liquidate 52% of my collateral given the price action and arbitrage opportunity. And if this can happen to anyone any time, borrowers need to be made aware there is no limit to how much of their collateral is sold off in a liquidation.

I think it is a reasonable inquiry, and one of interest to all borrowers.

1 Like

I read through the code and the new liquidation queue contract is slightly harder to understand than the legacy one, my best bet right now would be that you got liquidated at an higher premium than you expected, if there was a large number of liquidations at the same time you have been liquidated at >10% premium, but doing some quick math on your liquidation you seem to have been liquidated at $78 which would make it 3-4% premium.

So technically you were around 6% above your LTV due to the premium and liquidation fees (1% fee for the protocol and 1% for the liquidator).

I tried doing a simulation of what the optimal selloff would be at 6% premium and assuming I made no mistakes, 2000 bLuna sell should have been enough, but I feel I may be missing something.

Luna $ 81 Luna Premium $
Premium 6% 76.14
Loan Value 656000
Collateral 10000
LTV 81%
bLuna left Proceeds Borrow Amount New LTV
10000 0 656000 81%
9000 76140 579860 80%
8000 152280 503720 78%
7000 228420 427580 75%
6000 304560 351440 72%
5000 380700 275300 68%
4000 456840 199160 61%
3000 532980 123020 51%
2000 609120 46880 29%

One part of the contract I’m trying to wrap my head around is that the liquidator sets an “amount” to liquidate, but I’m not sure yet that’s what dictates what is liquidated.

4 Likes

Should add, my cost basis was much lower than the sold off price so my loss is not significant on paper but this hard-earned asset is of huge importance so it is important to know if when I borrow I am exposing my entire collateral amount to a liquidation risk. The risk reward equation would change drastically.

Thank you! This is very helpful. That is the bizarre point! The liquidator does not seem to have made much gains (the premium is in the range 4%-6% you estimated, that was my estimate too). So that’s why I cannot comprehend the need to sell off such a large amount of collateral when they did not even charge a higher premium!

The liquidator no longer sets the premium, that is given by the available bids… what I am trying to understand is if the liquidator does indeed control how much is liquidated, from what I can understand the liquidator fee is derived from the repay amount so they do indeed gain from liquidating higher amounts.

5 Likes

Understood. This makes sense. Thank you for looking into this. Very helpful and educational.

1 Like

@paletas We’ll be going over these details in our YouTube discussion today. Welcome to anonymously chime in if you’d like, we’d love your input, really need to understand the liquidation process and where the premium and liquidation amounts are derived from. Twitter handle is ttlg_crew.

2 Likes

I’m assuming so, as long as the amount is less than the entire loan value? I would assume the option for paying off the entire loan for the excess collateral is available? Not just the option to bring it back into balance. This would make the auction process more liquid.

That was my original assumption but from what you guys say it shouldn’t be able to auction enough to pay off the whole loan? If the option is there and the capital available I would assume total liquidation.

i dont think this was ever true; where do you see the executemsg allowing the liquidator (in either legacy or queue) to set the amount?

off top of my head, im believe the collateral amount is internally calculated in either the overseer or custody contracts.

Appreciate the invite but I’m more of a behind the scenes kind of guy.

1 Like

On the contract code, it takes the amount from whatever the liquidator send into the contract, so they can send any amount as long as it won’t exceed the borrow amount (like @atebites mentioned).

2 Likes

You may be right on the reason but this poses a risk to anyone borrowing, my expectation is that your liquidation will be only up to the amount necessary to make your loan fit inside the LTV (I do expect that a minimum liquidation amount was to be set, to make sure liquidators get paid enough to cover costs), but in his case it seems to be far in excess of that.

2 Likes

Totally respect that! Cheers

Uff that’s right, amount is not capped or bounded in any way here, except for the total collateral amount of course, I am sure that an error would be produced in that case.

I suggest we get a proposal that puts some hard or functional limits here in order to protect Borrowers. Nothing drastic, liquidators should still earn the premium but the excessive sell that happened in my case raises capital risk concerns.

ah yea, if you continue tracing thru that message, you’ll see the contract eventually checks if the caller is the custody contract here: money-market-contracts/bid.rs at c85c0b8e4f7fd192504f15d7741e19da6a850f71 · Anchor-Protocol/money-market-contracts · GitHub

in other words, the message you posted is not directly callable by the liquidator

my suggestion is start at the liquidator entrypoint (note collateral amount is not a param), and follow the logic; i am certain the collateral amount is calculated along the way: money-market-contracts/contract.rs at c85c0b8e4f7fd192504f15d7741e19da6a850f71 · Anchor-Protocol/money-market-contracts · GitHub

hope this helps you and the OP.

1 Like