Fujicracy / fuji-v2

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

Internal v2 testing #412

Closed ferostabio closed 1 year ago

ferostabio commented 1 year ago
github-actions[bot] commented 1 year ago

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

brozorec commented 1 year ago

Some feedback on the changes:

  1. On "Remove position": The "max" button should work differently; it shouldn't fill the input with the user's balance. Rather, we have to calculate what's the max amount the user can withdraw from this position:
MAX_COLLATERAL_WITHDRAW = 
    COLLATERAL_BALANCE - 
    (BORROW_BALANCE - PAYBACK_INPUT) / (MAX_LTV * COLLATERAL_PRICE)
  1. It seems that the "Borrow Limit" isn't calculated the right way, maybe because it doesn't take into account some of the inputs
BORROW_LIMIT = 
  (COLLATERAL_BALANCE + COLLATERAL_DELTA) * COLLATERAL_PRICE * MAX_LTV

COLLATERAL_DELTA = - COLATERAL_INPUT if we withdraw COLLATERAL_DELTA = + COLATERAL_INPUT if we deposit similar for BORROW_DELTA

  1. On manage-position, we've put "i" with a tooltip next to the disabled chain. Can we put just the tooltip on hovering over the disabled dropdown? Here's the text for the tooltip:

    • "Paying back an existing position from another chain will be enabled soon"
    • "Borrowing from an existing position to another chain will be enabled soon"
  2. When approving spending limit, change the button from "Approve" to "Approving ..." when the tx is pending.

ferostabio commented 1 year ago

@NikolaiYurchenko a little something about the recommended feature

ferostabio commented 1 year ago

@brozorec some stuff we need to continue with some of the items:

brozorec commented 1 year ago
  1. Tx History

    • [x] when only one action payback or deposit, there's a trailing "and" image
    • [x] use icons according to the design; if they are not available in Figma, ask Mark
  2. Approval process

    • [x] the height of the approval button changes when the state is pending and there's no text "Approving" (only on borrow page)
    • [x] when approval is successful, display a notification with a link to the chain explorer
  3. Borrow limit calculation After I tested it out again, I figured out that we shouldn't take into account the borrow balance and the borrow input. So here's how it should work. The calculation depends on whether we are adding position or removing position. In the first case, we have to add the collateral input, while in the second, we have to deduct it:

  1. Recommended LTV in input

    • [x] keep how it was looking before (Recommended 55%); just make it clickable with a pointer on hovering
  2. The max button when withdrawing doesn't work correctly, although I see the formula was implemented right. When COLLATERAL_BALANCE = 0.005 BORROW_BALANCE = 5.31 BORROW_INPUT = 0 COLLATERAL_PRICE = 1799 MAX_LTV = 75% then MAX = 0.005 - (5.31 - 0) / (0.75 * 1799) = 0.001066667 while I have image

Could the issue be that maxLtv isn't taken as a %?

  1. Let's consider dust if the value is lower than 0.0001
  2. Regarding the input placeholders and the titles for "Add Position" and "Remove Position", let me sync with @Markoyw
  3. For the issue with the Connext scan, Idk yet
brozorec commented 1 year ago

Updates about some of the unresolved points in the first comment:

  1. Wording “Add Position” and “Remove Position”
  2. Add contextualized placeholders in inputs @Markoyw is going to propose new designs so I suggest we do them in a separate PR.

  3. Connext explorer link appears too early This will also be handled in another PR that will address #423

  4. Take care of dust in both my positions and borrow screen We set an amount for dust to 0.0001 and we check only the collateral.

@NikolaiYurchenko Can you go through the feedback of @Markoyw from here and check if the comments about alignments, modals, font sizes and the other pure UI stuff are already handled?

brozorec commented 1 year ago