A point of failure with margined protocol

I brought this discussion here cos margined protocol admins decided to ban me for continuing the discussion on their discord and clearly stated that will only have the discussion within the osmosis space, so osmosis affliates can serve as a secondary input. Not sure why they want a discussion related to margined to be had within osmo space, but a mod on osmo discord suggested that i post it here for higher visibility. Thus the reason for this post.
Also, since most of us are discovering margined proocol through osmosis, i figured it will be ideal if this issue is highlighted cos some users are currently not aware of what they might be exposing themselves too while using the platform.

Anyway, on december 30th 2023, I closed a short of approx 400-500usd on margined and it ended up costing me 2100usd in osmo to pull out that collateral of approx 400-500usd in osmo.

That day a user had been buying and driving up the price of sqosmo to liquidate several account. The premium for sqosmo went from approx 9% to 72% over a 7hrs period. During that period i closed several similar amount of shorts while the premium was btw 49% - 72% and it all cost me approximately 20-40usd in osmo to close the short.

However, i ended up closing another similar amount of short while premium was at 72% and the premium suddenly shot up to 3000+% and i also noticed that my wallet was missing 2100usd in osmo from what it should be.

Numerous accounts on discord was asking the team if they had pulled liquidity, and the team whom were intially active and conversating with the community on discord wasn’t responding. After awhile of not getting a response from the team, i went to osmosis discord and posted a comment that the margined team might have exit scammed, and osmosis team should investigate and if such is the case, remove the link to the app from osmosis app channel.
This lead moonz (osmo mod) to immediately join margined thread, and also immediately after i posted that comment the premium wentback down from 3000+% back to 59%, though it subsquently went back to 72% again after some time. Margined admin also finally responded on their thread and asked me to provide my wallet address in dm.

After providing my wallet, the margined admin stated that he saw no issues with my trades, and after i pressed him to explain why i have lost 2100 usd in osmo from my last trade, he said that my last short was very expensive and i should have been watching the premium. i clearly stated that i and several others had closed numerous similar related short at that same premium without that happening and it cost approx 40usd in osmo to close those shorts. He then stated that liquidity is concentrated and that’s what caused the issue.

I then took the matter to the main thread and another user on the thread posted a link to a trade and stated that some random acct had bought sqosmo directly from the lp instead of minting it and thats what caused the issue, and stated that i must have closed my short while that was happening, the team responded to this been the cause. However, i kept reaffirming that i closed my short when premium clearly showed 72% and i didn’t notice the rise to 3000% till after the short was closed. And asked team to explain why this is the case and they kept responding that i closed my short while this occurred without ever explaining that my tx was the responsible for the hike in premium.

Later, my sister who is a data scientist went thru my tx and finally explained to me that my tx was responsible for the hike in premium and it wasn’t some random acct nor had i closed my short while that was happening but rather my tx was the main cause for the premium hike. when i brought that to the team, they responded that it was caused due to concentrated liquidity.

Then over the next few days i monitored numerous similar to higher value shorts closed at similar to even slightly higher premium without this occurring again. So, i started a discussion on the discord thread asking the team to explain why numerous shorts of the same value have been closed at that premium pre and post this singular event and this hasn’t occurred again eventhough the liquidity hasn’t changed much and still concentrated, and also to explain why they didn’t have precautions in place in prevent such irregular trade from going through, and if they intend to reimburse me for this irregular occurrence. They just kept ignoring my comment. Finally he responded and said they were investigating and i should be patient and give them time to investigate.

Several mins later while this discussion was still going on, the same admin who requested that i be patient interjected that the user should have been monitoring and known not to close the short while premium was high. i responded and stated that i closed my short while premium was at 72% and i had also closed numerous similar amount shorts that day while premium was at 72% and it only cost approx 40 usd in osmo, so why did this occur with this singular event and hasn’t occurred again since then eventhough lp hasn’t changed much and still concentrated. I also asked them why their build doean’t clearly indicate how much a user will spend to close a short, cos if that was present, no user in their right mind will agree to spend $2100 in osmo to recover back approx 400-500usd in osmo collateral. team didn’t respond to the comment.

The next day i reposted the comment, and another user whom from previous interaction has shown that he is technically inclined, interjected and stated that it would be ideal if such spend value was present for users but ultimately it up to the user to understand what’s on keplr pop up before agreeing with the transaction. I indicated that keplr pop up is confusing and has numerous code which most users like me who are technically illiterate can’t understand and it was up to the team to have precautions in place to prevent irrational trades and also clearly show the spend value for closing a short. Team didn’t join the discussion.

The next day i reiterated my comments, and explained that i want concise explanation why i and another account who also lost 10 osmo during this event had been the only one affected by this eventhough numerous short of similar amount had been closed that day prior to the event and also numerous short closed at similar premium post the event, without a huge change in the concentrated lp value. team member stated that they were investigating and i should be patient and commended me for staying cordial through all this. A few moment later while the discussion was still going on with other, the same team member who keeps telling me to be patient while they investigate reiterated that user should have been watching premium and known not to close the short.

Thru the course of the discussion, this happened again where they told me to patient while they investigate and a few minutes later interjecting that user should have known better before closing the short, so i responded and asked them if they were actually investigating anything or just been diplomatic on the thread, cos it seem like they keep telling me to be patient while the investigate while also simulteanously stating a few minutes later that user should have known better thus indicating that they had reached a conclusion that this was my fault. so, rather than been wishy washy with their comment and dragging me along, they should just be clear with their response. The team started making a comment, and several minutes later, i noticed that he had stopped writing and wasn’t goin to respond. So, i intejected again and asked him if he intends to post his response or not. Then he said they decided against posting the comment, and i should have all the info i needed, that am been negative and they weren’t discussing this anymore.

So, i kept reposting the aformentioned question, asking them to explain in concise manner why i and one acct have been the only one affected by this eventhough pre and post the event numerous short has been closed at similar premium without it ever occurring again. I also kept asking why the platform doesn’t clearly show the spend amount to close a short to prevent this nor have a precaution in place to prevent such a tx from even going through and my comments were ignored.

However, today when i reposted the comment, the amrgined admin responded back that it was due to the liquidity been concentrated and that there platform always showed the spend amount before closing. I indiated that this wasn’t initially the case and if it had been updated since then its great but this wasn’t present prior to my event. The margined admin stated i was making a false accusation and warned me not to repeat that comment.

I then pinged the user who had intially stated that it would be ideal if this info was present(while also stating that it was ultimately up to the user to understand and verify keplr pop up)to verify if the spend info was cleary visible to user while closing short prior to this event occurring and also asked the margined user if they could direct to a pull request or a part of their repository that indicated this was present prior to the event, so i can show it to my sister to review and verify and i was immediately banned on discord.

Anyway, i apologize that the length of this post, but necessity required it as such, and i wanted to make sure to include as much info as possible for anyone reviewing it. cos as it stand i still don’t know why my particular tx was so special to create this issue and it hasn’t happened to anyone else. eventhough ton of users had closed related short at similar premium pre and post the event without it occurring to them eventhough the concentrated lp hasn’t changed much. And as such there is no way for any other user to prevent this from happening to them at any moment.

In response to the above.

On December 30th there was a liquidation of a large short position (vault id 2) on Margined Protocol’s sqOSMO market.

In order to liquidate a position on Margined the liquidator had to either:

  1. mint more sqOSMO
  2. buy sqOSMO directly from the pool

The liquidator took action 2 purchasing the sqOSMO directly from pool id 1267.

This caused the premium of sqOSMO to increase from 50% to at one point 3000+% as the liquidity at the fringes of the pool is indeed thin.

Why is this relevant to the above?

The user above had a short position which they attempted to close at the same time as the liquidity was being consumed for use in a liquidation by another user.

When closing a short position you must:

  1. purchase sqOSMO back
  2. burn the sqOSMO
  3. unlock your underlying collateral

For the above user when they closed their position at step 1 they received a price from pool id 1267 that was much higher than their original entry price.

However, from the perspective of Margined Protocol there are a number of ways we try to inform users about the price of sqOSMO and the cost of a trade:

  1. We display the price premium with colors where RED==BAD
  2. We display the implied price of OSMO for a given premium, meaning users will see that sqOSMO is very mispriced
  3. We display the spend of a close short transaction in the side bar
  4. We use a modal to show the cost of a transaction prior to transaction execution
  5. The funds sent in a transaction are finally shown in the users selected wallet at transaction execution

Therefore it is felt that sufficient information is displayed to inform a user.

We are glad to take additional recommendation of how this could be increased but it seems sufficient at present from our perspective.


With respect to the banning of the user from the Discord we had/have tried to repeatedly explain the above, including details of how concentrated liquidity pools work.

To which we received simply ignorant and accusative replies over the last 6 days.

It should be noted that the spend amount for closing short wasn’t initially availble on this platform, and that was pointed out to the admin by me and another user as indicated by my original post. If they added it later to help supplement new users then that’s great but such value wasn’t present when my short was closed.

It should also be noted as indicated from my original post, that when i pinged the user aforementioned in my original post to verify that spend amount wasn’t initially available for users and asked team to direct me to a pull request indicating that such was present prior to this event, so i can show it to my sister who is a data scientist to review and verify, i was immediately banned from discord.

Also, using the explorer, it can easily be verified that “pre this event” occurring and “post this event” occurrring, “numerous short of related amount” has been closed at “similar premium” all while “heavy liquidation” is occuring. All without much change to the “concentrated liquidity” and yet no one else has experienced this again.

I will reiterate it, no one else has experienced this again eventhough the concentrated liquidity hasn’t changed much. However, my tx which is the only abnormality in this scenario is deem normal.

I will also like to add that their platform is set up to automatically buy sqosmo from the pool when a short is closed. so as proposed with the response that “the liquidator took action 2” as to state the liqudator had an option btw those two options is not the reality but rather a further attempt to push responsibiltiy aware from them and onto the user.

But users do mint and liquidate how is that not reality?

See:

Again, when a regular user like me with no technical background clicks on close short on your platform. It doesn’t bring an option to mint or buy directly from pool. Rather the short is closed automatically, and this is the option every regular user will be exposed too.

Similar to your expectations that regular users should know how to read the codes on keplr pop up before signing it, that’s not a reality for most general users cos they are technically illiterate and expect the builder to have a user friendly build with precautions in place to protect/prevent irregular tx from occuring

Also, I have yet to get a reasonable excuse why my tx is the only anomaly to experienced this, even though numerous users have closed similar related shorts pre and post this event occuring.
All this while heavy liquidation is occuring and at similar premium, without no significant change in the concentrated liquidity.