fix to lev of LSTS

This commit is contained in:
Finn 2024-06-06 10:19:20 +01:00
parent 551e890001
commit f66813541a
1 changed files with 3 additions and 5 deletions

View File

@ -40,13 +40,11 @@ export default function useLeverageMax(selectedToken: string) {
return max * 0.9 // Multiplied by 0.975 because you cant actually get to the end of the infinite geometric series?
} else {
const conversionRate = borrowBank.uiPrice / stakeBank.uiPrice
const leverageFactor = 1 / (1 - x)
const y = 1 - conversionRate * stakeInitAssetWeight.toNumber()
const max = floorToDecimal(leverageFactor, 2).toNumber()
const max = floorToDecimal(1 + (x / y) * 0.9, 1).toNumber()
return max
return max * 0.9 // Multiplied by 0.975 because you cant actually get to the end of the infinite geometric series?
}
}, [stakeBank, borrowBank, selectedToken])