hats-finance / StakeWise-0xd91cd6ed6c9a112fdc112b1a3c66e47697f522cd

Liquid staking protocol for Ethereum
Other
0 stars 0 forks source link

redeemToLtvPercent is higher than redeemFromLtvPercent #131

Open hats-bug-reporter[bot] opened 1 year ago

hats-bug-reporter[bot] commented 1 year ago

Github username: -- Submission hash (on-chain): 0xb8786f8a177ac7616fc8a584546e94b601b150285990c466fcdb6e36a0a79f6d Severity: low

Description: Description\ redeemToLtvPercent is lower than redeemFromLtvPercent

on the repo , redeemToLtvPercent is set to be 9000 (90%) while redeemFromLtvPercent is set to be 9150 (91.50%). Since redemption would increase the LTV, a user would for example, have an LTV of 90%, is unable to redeem X amount such that his LTV becomes 91% post-redemption, since redeemToLtvPercent is checked at the end of redemption and revert the tx. This makes the redeemFromLtvPercent invalid config for now.

    redeemFromLtvPercent: 9150, // 91.5%
    redeemToLtvPercent: 9000, // 90%

https://github.com/hats-finance/StakeWise-0xd91cd6ed6c9a112fdc112b1a3c66e47697f522cd/blob/main/helpers/constants.ts#L42-L43

Attachments

  1. Proof of Concept (PoC) File

  2. Revised Code File (Optional)

revise the config

    redeemFromLtvPercent: 9000, // 90%
    redeemToLtvPercent: 9150, // 91.50%
tsudmi commented 1 year ago

The redemption increases LTV, that's why redeemToLtvPercent is lower.