Fujicracy / fuji-v2

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

Warning: max LTV #364

Closed brozorec closed 1 year ago

brozorec commented 1 year ago

Context

When the user only borrows or only withdraws and the position LTV reaches a level that's 5% before the max LTV, we display a warning modal, where the user gets prompted to confirm the operation because it's put the position at risk of liquidation.

Every vault has a maxLTV (maximum loan-to-value) that positions on that vault have to respect. The LTV represents the ratio between the value of the debt and the value of the collateral. For a position with 1 ETH as collateral (1 ETH = $1500) and debt of 1000 USDC, the LTV is 66% (1000 / 1500).

TODOs

The text msg in the modal: "The Loan-to-Value of your position becomes XX% that's very close to the maximum allowed. Your position risks being liquidated if the price of the collateral changes. Please, make sure you understand the risks associated with this operation. We highly recommend you change the amount of the collateral and/or the debt so that your position LTV reaches a healthier level.

Notes