fix perp stats funding rate
This commit is contained in:
parent
d379cc1a75
commit
c87f8b19b8
|
@ -25,9 +25,7 @@ const PerpMarketsTable = () => {
|
|||
const { theme } = useTheme()
|
||||
const { width } = useViewport()
|
||||
const showTableView = width ? width > breakpoints.md : false
|
||||
// const bids = mangoStore((s) => s.selectedMarket.bidsAccount)
|
||||
// const asks = mangoStore((s) => s.selectedMarket.asksAccount)
|
||||
const rates = usePerpFundingRate()
|
||||
const rate = usePerpFundingRate()
|
||||
|
||||
return (
|
||||
<ContentBox hideBorder hidePadding>
|
||||
|
@ -63,11 +61,13 @@ const PerpMarketsTable = () => {
|
|||
const chartData = coingeckoData ? coingeckoData.prices : undefined
|
||||
|
||||
let fundingRate
|
||||
if (rates.isSuccess && rates.data) {
|
||||
const marketRate = rates.data.find(
|
||||
if (rate.isSuccess && market instanceof PerpMarket) {
|
||||
const marketRate = rate?.data?.find(
|
||||
(r) => r.market_index === market.perpMarketIndex
|
||||
)
|
||||
fundingRate = `${marketRate?.funding_apr?.toFixed(2)}%`
|
||||
fundingRate = marketRate
|
||||
? `${marketRate.funding_rate_hourly.toFixed(4)}%`
|
||||
: '–'
|
||||
} else {
|
||||
fundingRate = '–'
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ export async function getStaticProps({ locale }: { locale: string }) {
|
|||
'onboarding',
|
||||
'profile',
|
||||
'token',
|
||||
'trade',
|
||||
])),
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue