fixed USDC APY
This commit is contained in:
parent
ac52e6f03c
commit
aab1d431fa
|
@ -121,7 +121,7 @@ const PositionItem = ({
|
|||
}
|
||||
}, [group, acct])
|
||||
|
||||
const [liqRatio, liqPriceChangePercentage] = useMemo(() => {
|
||||
const [liqRatio] = useMemo(() => {
|
||||
if (!borrowBalance || !borrowBank) return ['0.00', '']
|
||||
const liqRatio = getLiquidationRatio(
|
||||
borrowBalance,
|
||||
|
@ -136,13 +136,13 @@ const PositionItem = ({
|
|||
return [liqRatio, liqPriceChangePercentage.toFixed(2)]
|
||||
}, [bank, borrowBalance, borrowBank, stakeBalance])
|
||||
|
||||
console.log('liq price change percentage', liqPriceChangePercentage)
|
||||
|
||||
const { financialMetrics, stakeBankDepositRate } = useBankRates(
|
||||
bank.name,
|
||||
leverage,
|
||||
)
|
||||
const uiRate = bank.name == 'USDC' ? Number(stakeBankDepositRate) * 100 : financialMetrics.APY
|
||||
|
||||
const APY_Daily_Compound = Math.pow(1 + Number(stakeBankDepositRate) / 365, 365) - 1;
|
||||
const uiRate = bank.name == 'USDC' ? APY_Daily_Compound * 100 : financialMetrics.APY
|
||||
|
||||
return (
|
||||
<div className="rounded-2xl border-2 border-th-fgd-1 bg-th-bkg-1 p-6">
|
||||
|
|
|
@ -24,9 +24,10 @@ const TokenButton = ({
|
|||
1,
|
||||
)
|
||||
|
||||
const APY_Daily_Compound = Math.pow(1 + Number(stakeBankDepositRate) / 365, 365) - 1;
|
||||
const UiRate =
|
||||
tokenName === 'USDC'
|
||||
? Number(stakeBankDepositRate) * 100
|
||||
? APY_Daily_Compound * 100
|
||||
: Math.max(estimatedNetAPYFor1xLev.APY, financialMetrics.APY)
|
||||
|
||||
return (
|
||||
|
@ -74,8 +75,8 @@ const TokenButton = ({
|
|||
// </SheenLoader>
|
||||
// ) :
|
||||
tokenName === 'USDC'
|
||||
? `${UiRate.toFixed(2)}%`
|
||||
: `Up to ${UiRate.toFixed(2)}%`
|
||||
? `${UiRate.toFixed(2)}% APY`
|
||||
: `Up to ${UiRate.toFixed(2)}% APY`
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue