diff --git a/screens/Trading/index.tsx b/screens/Trading/index.tsx index 34917fd5..7f428469 100644 --- a/screens/Trading/index.tsx +++ b/screens/Trading/index.tsx @@ -168,8 +168,23 @@ const Trading = () => { currentTokenCate1?.metadata?.symbol == "wNEAR" ? "NEAR" : currentTokenCate1?.metadata?.symbol }/${currentTokenCate2?.metadata?.symbol}`; + const [volumeStats, setVolumeStats] = useState({}); + useEffect(() => { + const fetchVolumeStats = async () => { + try { + const response = await DataSource.shared.getMarginTradingVolumeStatistics(); + setVolumeStats({ + totalVolume: response.totalVolume || 0, + volume24h: response.volume24h || 0, + }); + } catch (error) { + console.error("Failed to fetch volume statistics:", error); + } + }; + + fetchVolumeStats(); + }, []); // - console.log(marginAccountList); return ( {/* back */} @@ -277,12 +292,12 @@ const Trading = () => { {/* total v */}

Total Volume

- $23.25M + {formatWithCommas_usd(volumeStats.totalVolume)}
{/* 24h v */}

24H Volume

- $13.25K + {formatWithCommas_usd(volumeStats.volume24h)}
{/* long short */}