Fujicracy / fuji-v2

Cross-chain money market aggregator
https://fuji-v2-frontend.vercel.app
15 stars 10 forks source link

Warning block on existing position #429

Closed NikolaiYurchenko closed 1 year ago

NikolaiYurchenko commented 1 year ago

Warning block on Borrow page to show in same open position exists

github-actions[bot] commented 1 year ago

Please test this PR on: https://v2-staging-429-dot-fuji-306908.ey.r.appspot.com

ferostabio commented 1 year ago

Made the PR into a draft again since there's still a lot to do.

ferostabio commented 1 year ago

@NikolaiYurchenko turned the PR into a draft again and added a checklist.

ferostabio commented 1 year ago

@brozorec when calling preview calls in a cross-chain operation and we pass 0 in both amount fields, we get the following error from the sdk:

Sdk error while attempting to set meta: division-by-zero [ See: https://links.ethers.org/v5-errors-NUMERIC_FAULT-division-by-zero ] (fault="division-by-zero", operation="div", code=NUMERIC_FAULT, version=bignumber/5.7.0)
ferostabio commented 1 year ago
Captura de pantalla 2023-04-06 a la(s) 17 12 06
brozorec commented 1 year ago

@ferostar @NikolaiYurchenko great job on this and the following PR :muscle:

I have these suggestions to improve the warning messages and the routing modal:

Messages

"Based on your selection, we've noticed that you have an open WETH/USDC position on (icon) Optimism. You may proceed to manage it."

"Based on your selection, we've noticed that you have an open WETH/USDC position on (icon) Optimism. You may proceed to manage it.

If you're trying to open a similar position on another chain, please [select a different route]."

Routing modal

ferostabio commented 1 year ago

Another important issue @brozorec is that we just don't show the routing modal on a mobile device.

ferostabio commented 1 year ago

Turned the comments above into checklists so it's clear what remains to be done

NikolaiYurchenko commented 1 year ago

Message changed, on mobile underline is hidded, returned input check becase Mark told me to do it

ferostabio commented 1 year ago

Have a look @brozorec !

brozorec commented 1 year ago

I removed the chain icon because it didn't look good (sorry about that). I also used the vault values because a position is determined by the vault where it was open, not by the start and the end step. The steps define only the route.