Liquidations caused by unrepresentative oracle pricing of mSPY on Jan 3, 2022

This wouldn’t have happened at a tradfi broker.
I know I was taking a risky position by leaving my buffer on my positions to roughly 4%. If SPY wen’t actually up overnight by 4%, I’d have been in the same situation, but you wouldn’t have heard from me. It would have been extremely rare for it to happen in times without extreme volatility in the days before but it definetely could happen. I was taking that risk. The thing is that SPY never went up even 1% on the majority of exchanges that night. 496 was never a representative price. I’m confident mirror will make changes to this, to prevent this from happening before. What still stands is that an unrepresentative price sent by pricing oracle made me lose 300,000$. That should not have happened.

1 Like

The $496.361 did happen on 1 exchange for 1 second after which price came back down right away. That exact same time no shares were sold on other exchanges, but were for sale in the 477$ range on their orderbook. Talking to several devs this was not a ‘known shortcoming’ and they are just starting to work on fixing this issue permanently.

I know I took a risk with this much leverage, but I haven’t been liquidated for the right reason. If you look to the prices and ethically look into what would be the correct representative pricing for SPY, I should have never been liquidated.

I understand your point, that the sysyem worked as designed. Wheather it failed because of a lack of robustness in the design of mirror or a hack doesn’t change the fact that the system failed to do the right thing. In my opinion that’s where the compensation question boils down too.

1 Like

Curious, you been holding your short at 154% collateral? I know you mentioned you are taking the risk but I’m just wondering if you are trying to be hyper efficient and know for a fact that SPY won’t go up by 4%.

Is 4% large enough different? We are synthetics, there is going to be some amount of ±% off from the actual prices so where do we draw the line of what is considered significant vs insignificant? Is any liquidation above 4% difference from all mAssest considered due compensation?

Given that devs are working on the fix, it seems to me this is a cautionary tale to take the 200% collateralization seriously. Is the fact the 50% extra collateralization specifically designed to compensate for such a scenario?

I know there is some talk about not just using Band oracle but some native Terra oracle system.

Curious, you been holding your short at 154% collateral? I know you mentioned you are taking the risk but I’m just wondering if you are trying to be hyper efficient and know for a fact that SPY won’t go up by 4%.

134%-ish yes. for mSPY minimum collateral is 130% due to it’s low volatility. SPY is also way less volatile, 4% is a lot for SPY to go up overnight, it has happened before, but usually with high volatility leading up in the days before it. I adjust the collateral all the time and never let it get under that % closing the day. Getting back on your question, nothing is for sure. I needed a bit of money out and let it slide to 4%. This is not a daily thing, mSPY was trading kinda pricey and I didn’t want to buy it to close a position and pay 1.5% closing fee (if it would have went under 134% I would have done that).

Is 4% large enough different? We are synthetics, there is going to be some amount of ±% off from the actual prices so where do we draw the line of what is considered significant vs insignificant? Is any liquidation above 4% difference from all mAssest considered due compensation?

I would say so, we are not talking mSPY being 4% off SPY, these differences can be way bigger. Mirror protocol liquidated positions because by getting prices from an oracle that showed prices 4% off. I don’t see the link with mirror assets/synthetics here. The price of the mirrored SPY (mSPY) was not the determination of the liquidation. For mirror to have a bright future, we can’t accept being off anything over 0.5% on our oracle pricing (even that looks too much to me).

Given that devs are working on the fix, it seems to me this is a cautionary tale to take the 200% collateralization seriously. Is the fact the 50% extra collateralization specifically designed to compensate for such a scenario?
I know there is some talk about not just using Band oracle but some native Terra oracle system.

I think collaterization ratios are really important to be set up right. I do feel 130% is realistic for a low volateility index, it never crashed 30% overnight (from aftermarket to premarket) in the history of SPY ever. For a bunch of tech stocks being traded, 150% might be on the low side. Unlikely, but bad stuff could blow up at night/over the weekend and a single stock could be halved in value overnight. This could be an issue. Coca Cola at 110% min collateral is just ridiculous. Volatility (together with looking to the hours we get data, e.g. btc with its extreme high volatility shouldn’t need a crazy of a collateral requriement since it is traded 24/7, there will be plenty of time to liquidate the shorters between hitting the threshold and the 100%. I think this is a bit off-topic though.
Band oracle shows it’s definetely not perfect, there are so many other options (asking Band to make changes, mirror making changes to their protocol and keep working with Band (eg. time delay like has been discussed with the dev team), using another (maybe Terra) oracle system… I’m sure they are working on it and eventually changes will be implemented (if approved).

A complete list of the liquidations that happened under my account:

https://finder.terra.money/mainnet/tx/F7C0E080424D42A46BA740FA58EED36CD1FFC50B73454177AB5C53D71E0C5590
https://finder.terra.money/mainnet/tx/48FB0C5ED8D1745C7E365BD2F8F4A61A04743EBB66E09CDECE17952EDFAD8B8B
https://finder.terra.money/mainnet/tx/44D8026886A4F1C97CA1319858C859B5224D37A739D1A1DC9BAF654568BF1DE5
https://finder.terra.money/mainnet/tx/D9C4CF926BD245FED3F4AAA647C9685F5783663380C8AF80069024EBB240C6FA
https://finder.terra.money/mainnet/tx/1C6AB291E56C186F99122B677E85486BA4D588BB819F7B39D7743C7FBFE3A639
https://finder.terra.money/mainnet/tx/1967B96462BFA29FE278BBB67EE476165F7237EE875FCB2BBB6A3A79A6BC9BE8
https://finder.terra.money/mainnet/tx/AB3219DE2764FD79685F67EDD6BEBB6AC949414982B026A6925A220882C99265
https://finder.terra.money/mainnet/tx/F80715BA06CFE40F88F2DC1A97B2886B96BD1122FA541CFF07588BEFFAA24B49
https://finder.terra.money/mainnet/tx/B4E15BB98A97B8AFF8189E180EA903AE8B1C96DA8D3D2FE1DCB8E5A314A748F7
https://finder.terra.money/mainnet/tx/38A6DDED43D9B301D7671C7C1AB88ACA56108D64E283BAF4EF9A03EB07085CEF
https://finder.terra.money/mainnet/tx/DBA86C14DACBA7D8D4101F9611FA77AC95B896B4AEF8DA9AA63405F7D0A415BE
https://finder.terra.money/mainnet/tx/38E5DD3CAFAE4AF5D570BCFB978129F7FA6081BB792A16BF819CB4ADA3C888EB
https://finder.terra.money/mainnet/tx/2EA81336141B4AC66B8DEFAF69467795C3038A16FE4C3A69DDFFC7ACBE626603
https://finder.terra.money/mainnet/tx/DCBF4FAFB68F518644331ABFB9CB26A4AA2D6934A59BDAE733461E0C452AEA62
https://finder.terra.money/mainnet/tx/242AADB46AD3DE3FDB7C09A87D316101551C9CF13504595A13775C3E3DF1B331
https://finder.terra.money/mainnet/tx/B243A8823CEDA62972600BAE9D9D2739C29D4D2BD5A293CC3F19381CB1DF1512
https://finder.terra.money/mainnet/tx/D49C664CFC8247591D1874C6CE5E47141349CD65D5972C1B3923A39A4CA13929
https://finder.terra.money/mainnet/tx/F8C2E6C88DFA4196444E75B4799F7D2E6F4E424620A90CCC9CADD9E533526DA2
https://finder.terra.money/mainnet/tx/73018D25BAD56DFD8BDEA0668F8337C62E7D0F117796CE1CC3926F690276EE99
https://finder.terra.money/mainnet/tx/18017ACDDED65AB56D497637E7B5B79CB575F2B4D7E21AB3C25893FFA13F5550
https://finder.terra.money/mainnet/tx/E5F6A6A13CA72C65477542A62F28A7CC7965B0689E5D012DA423BB747CD85CED
https://finder.terra.money/mainnet/tx/C6DD8482AE389CB5FF1DEF849D40A95F14A70E5A4A69FDB17302181F566B9C46
https://finder.terra.money/mainnet/tx/BF4BC9C2E97282D13292F3E6E3B60197F73C4E95456B5D17EDB3974198C066F2
https://finder.terra.money/mainnet/tx/EA47B599811B541108FFB3C33450961EE2EE998BEE7C0790C43609EC032C8D88
https://finder.terra.money/mainnet/tx/50F30ACC3D989F4F6F1E5CED743B7454CA41276B45BE7F53B7C70C18D88A380A
https://finder.terra.money/mainnet/tx/506A07C0CACBC5BCA4A3AAA471D8EC49C5B2F6E453849F05404F701DE591A415
https://finder.terra.money/mainnet/tx/30E3435948A683065B84F43510CF0AF1BC5E5B1135A7E701CA90F258B45C41F6
https://finder.terra.money/mainnet/tx/6BBCE370E5C468AA63C4FFE0AF0D6B78BD44597C79CE66A5EF8EAE2FB3FD8605
https://finder.terra.money/mainnet/tx/C95D0F89FECE5CFE4D8BD936C697F75D1EC7F67316865DBD026767E61C85D166
https://finder.terra.money/mainnet/tx/765FC5F49A995ED7D190A07918E15CD5E09ACE82D8FF9BB50DFE7A0E9F0D084A
https://finder.terra.money/mainnet/tx/0EFBECC0F3D4A9EE5CC5E95EF48BB6320C2DCB5028458019B703BC8EDA45CDDF
https://finder.terra.money/mainnet/tx/035708D09D2A997DF9B7E6F66A66C874D05EDAA7E61B683B18427FD453E86A51
https://finder.terra.money/mainnet/tx/ED44F42BE963B18146EFD8EC074A1DB6CE6E36FF089CE6B2BE4386FFADC88750
https://finder.terra.money/mainnet/tx/4D0BCA158B968B1D2A5B465FFA7687ED0FFFB66A4269BCB088A94C8C04A91CFE
https://finder.terra.money/mainnet/tx/8E084375DCD223CFF26B728857FD404EE18539C941FE9BABC58C47DE9D350CF3
https://finder.terra.money/mainnet/tx/8DF6F8443C22BDD88F70A6FDD72658707E01DCCEF2EE34DCB6E8D9DF61ACCBF6
https://finder.terra.money/mainnet/tx/6F2196D779C289D7ACB7A0228BC1DAA649B42E625BC54A54BFC1823AE3847C30

In the attached Excel-file I calculated my losses for each transaction. Losses consist of:

collateral (aUST) sent to the liquidator * aUST-price + aUST in protocol fees * aUST-price - amount mSPY bought by liquidator to close my position * SPY-price

column A - tx hash
column B - collateral sent to liquidator (in 10^-6 aUST)
column C - protocol fees paid (in 10^-6 aUST)
column D - amount bought by liquidator to close my position (in 10^-6 mSPY)

SPY-price was set at $477.577, the SPY value right before the liquidation-cycle started.

Total losses sum up to 268928 UST.
Losses were incurred under wallet with address: terra1gcnrgrl8dzylacy95q75qw6qm7lcejevv7nvxn

Poll has been opened to request reimbursement from the community pool for these losses.
https://mirrorprotocol.app/#/gov/poll/228

268,928 UST at current MIR price of 1.74 UST comes down to 154,556 MIR, 150,000 MIR has been requested. Thanks for everyone’s support in this.

hey leen, thanks for trusting in mirror so much that you went all in with that much leverage with your whole life savings.

My thoughts:
If your liquidation was unrightful caused by an error in the mirror-protocol, you should be reimbursed, at least part wise. Not all the fault is at mirror-protocol, you have to admit that, therefore the amount of reimbursement can’t be the full amount of your positions.

A protocol has a goal, and mirrors goal is to mirror the prices of real assets. If people get unrightfully liquidated, it is our duty to reimburse.

BUT:

It’s hard to generate enough insight for an average Joe gov staker inside the time this proposal is active. Not everyone is professional enough to play detective on your transactions and the transactions on the other exchanges that are monitored by Band, in that couple of days the poll is running.

Please provide more insight like a whole report showing ONLY and COMPLETELY how the Band oracles have failed, in a way that an average gov staker can understand and validate.
I’m willing to look at transactions and to validate, but the evidence to how the Band oracles have failed is missing to me(not saying you are wrong, but i don’t know how to validate/find this).

I’m willing to vote “YES” for reimbursing you, but all in all the governance regarding to this incident so far has been handled by you in a way that will make me vote “NO”.

To mitigate this issue(and at least convince me, even though i’m not a whale with lots of voting power) please:

  • Post all the evidence in a way an average Joe can understand or get probably voted “NO” by average Joe governance stakers.
  • Before using a “community spend” proposal, make sure to have this issue covered deeply inside the forum here, best case with a statement by the mirror team, because every community spend is a instant “NO” for average Joe gov stakers if they cannot fully understand it, because we are used to people trying to scam us this way.
  • Let the amount of reimbursement be open for discussion. I’m not willing to give you a full reimbursement on your funds, as this incident is partly your fault aswell. Defi is still experimental, Smart Contracts are just what they are.

Nobody on the whole planet understanding how smart contracts work will tell you: “it’s a good idea to be fully leveraged to the last UST possible and have not more then 4% wiggle room for liquidation because everything always works as intended and if not there for sure will be an autority reimbursing you if you just post the transactions where you have lost money and an excel file where you have roughly calculated what you have lost”.
This is not a good behaviour and nothing we should incentivise.

A 20% reimbursement would be my favorite, but i think the exact number should be able to be voted on.

4 Likes

I voted yes because I’d want the same done for me in the same situation, and do sympathize – to an extent. However, people shouldn’t be cutting it that close to liquidation on their positions. This is clearly a new technology, and if you’re putting that kind of dough in you should probably have checked out potential errors that can trigger liquidation and taken some extra precautions to avoid them. Regardless, I hope you get an opportunity for a “redo” this time, as we all need one at some point or another.

1 Like

Please provide more insight like a whole report showing ONLY and COMPLETELY how the Band oracles have failed, in a way that an average gov staker can understand and validate.
I’m willing to look at transactions and to validate, but the evidence to how the Band oracles have failed is missing to me(not saying you are wrong, but i don’t know how to validate/find this).

To get back on this. The info in this forum post is all info I could get from both Band and Mirror dev support. I reached out to them again and hope to hear form them soon.
What happened is an outlier trade happened somewhere and made spy jump by 4% and back down by 4% on 1 exchange aftermarket. Spy was for sale on the orderbook for a normal price on other exchanges but trades didn’t happen. That’s the info I have been provided. The way Band and Mirror work, there is no way for them to catch this (mirror devs are working on it though). They aren’t designed 100% correct in my opinion. I hope to get more detailed information from the devs.

A 20% reimbursement would be my favorite, but i think the exact number should be able to be voted on.

Also getting back on reimbursing a smaller %. I agree it’s extremely hard to say who is responsible for this. Is it Band? Somewhat yes. Is it Mirror? Somewhat yes. Is it me? Somewhat yes. Band and Mirror should have caught this earlier and prevented it. I should have done more research myself in the way Band and Mirror work and realize the risk.

I proposed asking for a smaller part back from the dev team and they recommended going for the 100% (since it would be for the same reason). They see it as an either right/wrong, while what you are saying is more gray-ish and I do agree with that.

Also, how can we make people vote on the amount? Mirror is set up to vote only yes/abstain/no.

Would you have time for a talk on telegram? You can reach out to me there with username Leen93

Whether the positions should or should not have been liquidated and whether compensation is due for the liquidation losses, in my mind are two different but interrelated questions. Because the protocol performed as programmed, I think we should decide the first question and fix any technical issues in the protocol before we decide the second question.

In my opinion, there’s no reason to liquidate users immediately, because we use overcollateralization to protect the protocol so that the protocol can then be user-friendly. In this case, the overcollateralization requirement was 33%, but the liquidations were triggered on a 4% price spike. We can safely admit that the protocol was never in realistic danger of taking a loss.

If we are willing to let users be liquidated on small price spikes, we should reduce the overcollateralization margins for all assets. This change would make the whole system more cutthroat, less robust, and less user-friendly, and this is not my preference.

My preference is for the users’ positions to only be flagged for liquidation on multiple confirmations of adverse price data, perhaps needing both actual trade and order book data. Both past order book data and past trades are valuable predictors of likely future short-term prices, which are the real basis for liquidations anyway. The overcollateralization margins should then stay as high as they are, because they would provide time for the confirmations process to trigger.

I believe it would also be worth defining for each asset a liquidation warning threshold some amount higher than the required overcollateralization. The system should send timestamped warnings to users’ dashboards when these thresholds are crossed. In no circumstance shall the protocol compensate users for any liquidation event that occurs within a defined period after a warning is sent.

1 Like

I agree 100% with all of the above, Kalirren. Thank you.
What is your opinion on compensation? I don’t feel I should be bearing 100% of these losses. Like you simply said these positions shouldn’t have been liquidated. We know why they did, but we should have a protocol that shouldn’t have done this. Right now the mirror stakers are even making close to 14k in fees (1.5%) by this incident, which is not correct at all in my opinion. I really hope to get compensated (either fully or partially), but kinda lost my confidence in it by seeing so many people vote no without ever explaining or posting something on this forum.

Here the feed transaction nr that fed the inflated mSPY price.
ab51c71ab5d24b3ed3fb15123230994c7b3d77365194e8965d8d9f680624dbdd

My feeling on compensation is that the Mirror community needs to first come to a conclusion, through an official governance proposal, on whether Mirror protocol’s previous behavior was incorrect and what specific changes should be made to the oracle triggers for liquidation. Only if we determine the first question, should we consider whether compensation be retroactively paid out from the Community Fund for what the Community officially considers a bug. (After all, it remains possible that the community may approve changes to the oracle liquidation mechanism that would not have changed this particular outcome!)

leen, your story is nevertheless sympathetic, which is why I am trying to help chart what I see as a fair and plausible path forward.

1 Like

I’m not the expert on shorting here since it’s beyond my risk profile for reasons already mentioned in this thread, but I think another question that I haven’t seen come up is: When were the short positions opened and was there any UST unlocked?

All UST was unlocked from these positions. Don’t see why that would have mattered.

Thank you. I understand what you are saying, the hard thing is : who is the community, isn’t that all of us? It’s been over a week and don’t see too much talk about it going on anymore. It seems people are forgetting about it. What can we do?

I believe the unlocked UST comes from the sale of shorting the mAsset. So for example, if you shorted $100 worth of an mAsset and used $200 of aUST as the collateral, the locked UST would be $100 from the sale of the shorted mAsset.

If the UST was unlocked then put in Anchor for example, that UST from the sale of the shorted asset would have been used to pay for the liquidation in addition to some of your initial collateral. Or the unlocked UST from the sale of the shorted mAsset could have been used elsewhere if it was not put into Anchor.

Here are the # breakdown on a sample scenario (for simplicity, assume 1 UST = 1aUST):
User puts up $200 aUST as collateral
User shorts $100 UST of mAsset
After 2 weeks, user unlocks $100 UST from sale of shorted mAsset
User deposits $100 UST into Anchor and now has $300 aUST
mAsset value doubles to $200 UST and user is liquidated
$200 aUST is burned in Anchor to buy back mAsset
Net loss to user is 100 UST
200 UST (initial collateral) + [100 UST (sale of shorted mAsset and unlock) - 200 UST (liquidated collateral)] = 100 UST left

If I apply the same math above to your situation with 134% collateral:
User puts up $1.54 million aUST as collateral
User shorts $1.15 million UST of mAsset
After 2 weeks, user unlocks $1.15 million UST from sale of shorted mAsset and sends it elsewhere
mAsset value increases 4% to threshold level of 130% causing liquidation
$1.2 million aUST is burned in Anchor to buy back mAsset
Net loss to user is 50,000 UST
1.54 million UST (initial collateral) + [1.15 million UST (sale of shorted mAsset and unlock) - 1.2 million UST (liquidated collateral)] = 1.49 million UST left

I believe further information is needed on:

  • When UST was unlocked, total amount, and where it went. If it was deposited into Anchor for example and sat there for 2 months, it would have collected $40,000 in interest, just about offsetting the losses above; if it was there for 3 months, there would actually be a net gain in this case despite the liquidation.
  • when short positions were opened, mSPY price at the time, and total amount shorted
  • how you calculated $300,000 in losses (losses should not be compensated for the total risk that was taken on, ie if the short was opened in Sept/Oct when SPY was about $420 and it increased 20% since before liquidating at $496 - the loss here is the error claimed between $477 and $496, the 4% margin, not between $420 and $496; you would need to assume the losses you had up to that point between $420 and $477)

This is how I understand Mirror works from the documentation, but again, I am not big on shorting so I am not an expert.

1 Like

By “the community” I really mean “Voting MIR stakers”. I apologize for my poor choice of words earlier. The people who have stake in the protocol itself should make the decisions about how the protocol should behave and what to do with its Community Fund, and official gov proposals are the cleanest way to ensure that happens. We can help them decide by having clean and clear discussion on this forum, but I don’t see any reason to assume that the accounts you see on this forum are representative of the body of voting MIR stakers.

I think the questions posed by @yd19 are important to understand before voting.

You said you lost 300k, but had 1M in collateral. Did you lose the 1M collateral? Did you start with 300k, but then you were looping the unlocked UST back into your collateral? If so, that seems extraordinarily risky.

I’m not normally a risk-averse individual, but running something so close to liquidation that it needs daily monitoring seems like you are knowingly putting yourself in a very risky situation.

I also agree with @Kalirren that we should first decide what is the expected behavior of the protocol, then decide on compensation.