Refund dYdX user funds lost from high price impact out of ProtoRev profits

Summary

A user has lost $248,016.39 swapping $626,980.63 USDC.axl to USDC on Osmosis via the concentrated liquidity AMM pool 1223, due to insufficient liquidity in the pool. This swap was part of a migration from dYdX V3 on Ethereum to dYdX V4. The user was shown a route generated by Squid V1 which showed an expected exchange rate of 0.604 Ethereum USDC to dYdX USDC on the dYdX front end. The user did not notice this poor exchange rate before signing and submitting their transaction.

The ProtoRev module made a profit of 147,541.89 OSMO. This proposal requests that this OSMO, minus a whitehat bounty of 20%, be sent to the user, for them to do as they see fit. This OSMO will otherwise be burned in early January via a governance proposal.

What happened

On December 22, a user depositing funds to dYdX from Ethereum swapped $626,980.63 axlUSDC through pool 1223 axlUSDC/USDC. They received $378,964.24 USDC, which was then transferred to their account on dYdX via IBC transfers.

Initiation transaction on Ethereum

Transaction through Axelar

Transaction on Osmosis

The user lost $248,016.39 from this transaction due to price impact in pool 1223.

The Osmosis ProtoRev module took arbitrage profits from an unbalanced pool 1223. Profits totalled 147,541.89 OSMO.

What was the user’s journey?

  1. The user initiated a deposit on the dYdX V4 front end, which has routes provided by Squid. They requested to deposit 620k USDC from Ethereum to dYdX V4.
  2. Squid’s V1 API returned a route via pool 1223, with a price impact of 39.5% and expected minimum to receive of 378,857 USDC.
  3. The exchange rate of 0.604 was displayed to the user. No explicit warnings were shown, and the expected amount to receive of 378,857 USDC was not shown.
  4. The user, being a regular user of dYdX V3, did not check the exchange rate and proceeded with the deposit, signing a transaction on Ethereum and initiating the route.
  5. Later, they received 378,959.24 USDC in their account on dYdX.

Proposed reimbursement of the user

  • 118,033.51 OSMO is returned out of the ProtoRev pool to user osmo1029tnvnrfrymg22qltlm2k8nc6lw2wh4vlh0f0

What dYdX is doing to prevent the issue happening again

  • Add a check on the dYdX V4 front end where if a deposit will incur >2.5% price impact, the user will be recommended to reduce their amount via the UI.
  • Show the user the quoted toAmount before they are asked to sign a deposit or withdrawal transaction.
  • Choose to route through Squid V2 (CCTP enabled) when Squid V1 returns a quote with high price impact.

What Squid is doing to prevent the issue happening again

  • Return a failed route if price impact is larger than 2.5% for a deposit or withdrawals for any dYdX routes.
  • Return a failed route on high price impact or USD value difference between fromAmount and toAmount on all swap quotes.
  • Add an option on the Squid V1 and V2 API to bypass guardrails, for users or developers who would like to trade regardless of price impact.

Why wasn’t CCTP used?

  • Squid V2 supports CCTP, and dYdX have integrated Squid V2 for deposits and withdrawals. This was still in testing phase while the incident occurred and has since been released on the dYdX front end.

We appreciate the community’s involvement in this case and are looking forward to any questions or further discussion.

4 Likes

The 118,033 OSMO requested is 80% of the 147,541 OSMO that ProtoRev caught.

Asking for 118,033 OSMO at $1.75 is $206,558
While asking for 118,033 OSMO at the swap price of $1.50 is $177,050

With volatility and the price of OSMO quite possibly jumping higher or dropping lower, I think it’s worth clarifying, does this proposal specifically want 118,033 OSMO regardless of the price of OSMO? Or does this proposal seek to get 80% back in USDC value ($177,050) at the time of the swap?

^ My comment is only seeking clarification on the request and is not a stance on either side.

2 Likes

A lot of users sadly make this mistake on their part. I don’t think Osmosis should set a precedent of refunding clear user error.

Strongly oppose this.

9 Likes

While agreeing with the precedent issue, seems like the Squid front end was deficient.

No explicit warnings were shown, and the expected amount to receive of 378,857 USDC was not shown.

Is this accepted by Squid team?

If so, since the arbitrage was captured by ProtoRev, it’s not like Squid or Osmosis is paying out of pocket.

Also agree with @aaronxkong’s point about OSMO or USDC - as the user is out of pocket in terms of USDC, any potential refund should be denominated in USDC.

If it were me who had made the trade, I’d have to accept some responsibility for messing up. At the same time, if the UI doesn’t show expected amount or price impact, there is clearly an issue with the dapp, imo.

A 20% haircut (~$50K) seems a reasonable price to pay for making a mistake on a UI that didn’t provide enough clarity.

3 Likes

I’m so confused, why should Osmosis cover this? It’s our responsibility as traders to take note of the exchange rates that we trade at?

Reimbursing this user would be enabling a lack of accountability which would not set a good precedent imo.

(Whether this is reimbursed or not doesn’t matter to me, just sharing my thoughts on the situation)

4 Likes

Isn’t the Squid page will show the expected amount on the summary section?

Hi folks,

Barry from Skip here. I don’t have a perspective on how the community should vote, but I just wanted to provide a few notes since we developed protorev

  1. This was a result of bad routing (provided it seems by Squid via the dYdX frontend) and poor user understanding of what they were signing. The router generated a route with a low amount out, the frontend shared it with the user, the user signed it, and received more than that amount.

  2. The only reason there’s any money available for any kind of pay out is that ProtoRev did what it’s supposed to and captured atomic arbitrage on behalf of the community. If protorev didn’t exist, all of this would have just been captured out of band by searchers. As a result, I think it’s wrong to frame this as a refund.

  3. There is a broader question around whether protorev should be reconfigured to pay out available profits to the users trading, rather than the community. The original decision to pay out the community was driven by the facts that 1) earnings are not in the swapped token and 2) the validators bare the cost of protorev running because the user gets the extra gas cost refunded. I think that’s a really good discussion to have.

What this proposal essential does is establish a special case of paying the user instead of the community against policy. So If the community does decide to pay out this user (which could be reasonable), it should probably make that decision first at the global level to pay out all swappers whose transactions enable protorev generate revenue on a go forward basis as a matter of policy, rather than just making a special exception for this one person.

Once that broader policy question is settled, the community can decide whether it wants to “backport” this policy to the affected user in question and compensate them.

5 Likes

These are two completely separate questions and imo they should not be addressed together.

2 Likes

No from us if this proposal goes to the chain. Osmosis has no business refunding the losses caused by users’s mistakes.

The only case we can see for refunds are for of errors in the osmosis frontend or smart contracts itself, this just seems like an over-reliance on the 1:1 swap route and a hasty action by the user.

Any discussion around Protorev allocation should not be held here in our opinion. Unless the policy changes protorev should go to the community as agreed upon earlier.

Best,
Ertemann
Lavender.Five Nodes

4 Likes

From what I’ve read on the refund proposal, Osmosis had nothing much to do with it.

If we are going to use the protorev revenue to refund the user, I think Squid and dYdX should have contributed as well.

Hello,

I am the user who lost funds.

I accept part of the responsibility, as I should have been extra careful. I used the official dydx v4 UI and I did not know what Squid was. I confirm no explicit warnings were shown and that I do not remember (but I could be mistaken) a lower amount being shown as output - a very helpful engineer explained to me that I should have looked at a text field named “Equity”. I also did not see an exchange rate (USDC / USDC) being shown.

So, it was a bad surprise to me to see a lower amount. It’s a lot of money for me, but I have been in the field and I do accept responsibility for not looking twice and then click.

I do not blame dydx. I do believe Squid should not have made the swap with those conditions.

That said, I would gladly accept any material amount to be returned if the community so decides. I have participated to DAOs in the past and I am confident everybody wants to do the right thing.

Thank you.

7 Likes

for major stable coin swaps, hardly we look on to the swap rate. But clearly user having to swap more than 100K should have exercised caution. he should be given 20% as bounty rather than compensating the loss.

1 Like

I believe since you were using dydx front end you should talk with them, I believe they have a recently funded insurance fund of 1MM. Have you posted on their governance forum?

5 Likes

The insurance fund is made to cover things like protocol hacks on dYdX side, not to cover bad trades on Osmosis

2 Likes

Osmosis is not responsible for the malfunctioning of the squid front end and while I do feel for the user, I am likely to veto the eventual governance proposal.

3 Likes

I think this could be used as a good faith kind of proposal which could be beneficial for Osmosis. For instance, create a gov proposal which has to be approved in order to, since protorev went live, establish following cutoffs:

  • You’ve lost 0-10k: refund 40%
  • You’ve lost 10-50k: refund 30%
  • You’ve lost 50-100k: refund 20%
  • You’ve lost 100k+: refund 10%

Then create a tool displaying how much you could recover and claim, during 30 days. After that, funds are not claimable anymore.

And of course, establish that after this proposal, no further losses of the same sort will be refunded. The total amount shouldn’t be so high and we’d make users whole at least partially, those users will use that money to interact with the protocol, and the wheel keeps turning.

Nonetheless, users should always be responsible for this kind of errors, that’s why I would only use it as a one-shot proposal with a narrow window.

2 Likes

So sorry to hear the losses. But, rationally it is not osmosis Job to refund. We are talking about setting a wrong precedent here.

5 Likes

So essentially:

  1. You made some mistakes while using dYdX… in the sense that you did not double check, which you should have, to confirm the amount you would be receiving. This happened on dYdX, not Osmosis.

  2. According to the text below, you do not even remember whether an amount was or wasn’t shown.

  1. Osmosis had no role at all in any of this as you were not interacting with Osmosis. You also made a large transaction without familiarizing yourself with your trade environment.

Imo, the right thing here is that you assume full, not partial, responsibility for your mistake. Some lessons are expensive, but they are worth learning. Everyone in crypto, myself included, has learnt an expensive lesson without getting refunded. It’s unfortunate yours was at a $250K price tag, but this really has nothing to do with Osmosis.

Also, the fact that someone else drafted the initial proposal for you to get refunded suggests that you really do need to work on your accountability.

Really sorry if this comes off as harsh, I just have never, in my 10 years of being in crypto, heard of someone asking for a refund due to a bad trade that didnt’t even happen on the platform that they expect the refund from.

3 Likes

With the proposal coming up next week to propose Burning the OSMO part of ProtoRev

I think this debate should be a key part of it (maybe in that thread rather than this one though). By naming these funds “Protocol Revenue” the implication was that these funds go to Osmosis rather than being a rebate for high slippage. Trading rebates for slippage are something that other protocols have done and Osmosis seems to have gone down the opposite route of claiming this for ourselves.

Whether that is the right move now that Taker fees also exist as a form of revenue is something we should definitely be debating!

1 Like

It was dYdX UI, not Osmosis. They can decide to refund the user. We, OSMO stakers, can decide to deploy part of that protorev to the pool to lower the slippage in the future.