EmerisHQ / demeris

Emeris web app
https://app.emeris.com/
Apache License 2.0
12 stars 2 forks source link

Hitting insufficient funds error on Osmosis transfers #1708

Open josietyleung opened 2 years ago

josietyleung commented 2 years ago

image.png https://www.mintscan.io/osmosis/txs/9382289060B79BAA78F1C477871FA12C4C50445BF084A06A3D9C4F6AA187F524

Steps to reproduce

  1. Did a Juno > Somm swap that requires multiple swaps in between
  2. Error happened on NGM > ATOM step
akc2267 commented 2 years ago

issues like this will continue to happen until multi-hop is implemented, then the whole tx will work or it will fail and then the user will have to increase slippage

josietyleung commented 2 years ago

Do we have an error handling in place for when that happens + reminder to users to increase slippage?

akc2267 commented 2 years ago

this is a bug with the max button. subtracting a little bit for fees fixes this. @luciorubeens said the fix is in the multi-hop deploy version

luciorubeens commented 2 years ago

I was able to reproduce on a multi-hop swap https://www.mintscan.io/osmosis/txs/95F9CD3C823B7011472F93D237C3947DC4158D5C7534C9714B65FB674F23A07A

Data dump to debug:

# Route
{"steps":[{"type":"pool","protocol":"osmosis","data":{"from":{"denom":"uosmo","amount":"1000"},"to":{"denom":"ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4","amount":"4615"},"fees":{"osmosis/uosmo":2},"pool_id":"osmosis/54"}},{"type":"pool","protocol":"osmosis","data":{"from":{"denom":"ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4","amount":"4615"},"to":{"denom":"ibc/7C4D60AA95E5A7558B0A364860979CA34B7FF8AAF255B87AF9E879374470CEC0","amount":"97314"},"fees":{"osmosis/ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4":0},"pool_id":"osmosis/301"}},{"type":"pool","protocol":"osmosis","data":{"from":{"denom":"ibc/7C4D60AA95E5A7558B0A364860979CA34B7FF8AAF255B87AF9E879374470CEC0","amount":"97314"},"to":{"denom":"ibc/9712DBB13B9631EDFA9BF61B55F1B2D290B2ADB67E3A4EB3A875F3B6081B3B84","amount":"1431290"},"fees":{"osmosis/ibc/7C4D60AA95E5A7558B0A364860979CA34B7FF8AAF255B87AF9E879374470CEC0":98},"pool_id":"osmosis/164"}}]}

# Step data
{"name":"swap","description":"","transactions":[{"status":"pending","type":"swap","protocol":"osmosis","data":[{"from":{"amount":"1000","denom":"uosmo"},"to":{"amount":"4615","denom":"ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4"},"pool":{"id":"54","type_id":1},"chainName":"osmosis"},{"from":{"amount":"4615","denom":"ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4"},"to":{"amount":"97314","denom":"ibc/7C4D60AA95E5A7558B0A364860979CA34B7FF8AAF255B87AF9E879374470CEC0"},"pool":{"id":"301","type_id":1},"chainName":"osmosis"},{"from":{"amount":"97314","denom":"ibc/7C4D60AA95E5A7558B0A364860979CA34B7FF8AAF255B87AF9E879374470CEC0"},"to":{"amount":"1416978","denom":"ibc/9712DBB13B9631EDFA9BF61B55F1B2D290B2ADB67E3A4EB3A875F3B6081B3B84"},"pool":{"id":"164","type_id":1},"chainName":"osmosis"}]}]}

inputAmount: "0.001"
maxSlippage: "1"
outputAmount: "1.43129"
luciorubeens commented 2 years ago

Should we increase these options to 1% 2% and 3%? wdyt?

screenshot-app emeris com-2022 05 13-18_39_20

josietyleung commented 2 years ago

Should we increase these options to 1% 2% and 3%? wdyt?

screenshot-app emeris com-2022 05 13-18_39_20

yes please! I keep hitting slippage error at 1% already.

Also can we update that error message so user knows they have to increase slippage when they hit this insufficient funds error. Something like:

Assets failed to be swapped Try increasing your slippage

With this format?