funding rate fixes

This commit is contained in:
Tyler Shipe 2021-08-13 15:10:50 -04:00
parent c703e64712
commit 7d086d2279
1 changed files with 5 additions and 1 deletions

View File

@ -47,6 +47,8 @@ const MarketHeader = () => {
const volume = ohlcv ? ohlcv.v[0] : '--'
const fetchPerpStats = useCallback(async () => {
console.log('fetching perp stats')
const perpStats = await fetch(
`https://mango-stats-v3.herokuapp.com/perp/funding_rate?market=${selectedMarketName}`
)
@ -179,7 +181,9 @@ const MarketHeader = () => {
{selectedMarketName.includes('PERP') ? (
<>
<div className="pr-6">
<div className="text-th-fgd-3 tiny-text">Funding (1h Ave)</div>
<div className="text-th-fgd-3 tiny-text">
Avg Funding Rate (1h)
</div>
<div className="font-semibold text-th-fgd-1 text-xs">
{calculateFundingRate(perpStats, selectedMarket)?.toFixed(4)}%
</div>