use borrow bank apy

This commit is contained in:
tjs 2023-11-10 10:17:21 -05:00
parent bd8cab80dd
commit 7a4a2b09f2
2 changed files with 3 additions and 2 deletions

View File

@ -13,7 +13,7 @@ const TokenButton = ({
handleTokenSelect: (v: string) => void
}) => {
const leverage = useLeverageMax(tokenName)
const { estimatedMaxAPY } = useBankRates(tokenName, leverage)
const { borrowBankStakeRate } = useBankRates(tokenName, leverage)
return (
<button
@ -59,7 +59,7 @@ const TokenButton = ({
// />
// </SheenLoader>
// ) :
`${estimatedMaxAPY.toFixed(2)}%`
`${borrowBankStakeRate.toFixed(2)}%`
}
</span>
</div>

View File

@ -32,6 +32,7 @@ export default function useLeverageMax(selectedToken: string) {
conversionRate *
floorToDecimal(stakeInitAssetWeight.toNumber(), 2).toNumber()
const max = floorToDecimal(1 + x.toNumber() / y, 2).toNumber()
return max
}, [stakeBank, borrowBank])