From ce5345b588bd4cb67a492f154eb819c3671800e1 Mon Sep 17 00:00:00 2001 From: Tyler Shipe Date: Thu, 18 Nov 2021 17:46:53 +0000 Subject: [PATCH] add liq mining info to stats --- components/stats_page/StatsPerps.tsx | 66 +++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/components/stats_page/StatsPerps.tsx b/components/stats_page/StatsPerps.tsx index d3cb4b6f..404877a1 100644 --- a/components/stats_page/StatsPerps.tsx +++ b/components/stats_page/StatsPerps.tsx @@ -81,6 +81,15 @@ export default function StatsPerps({ perpStats }) { perpsData.splice(index, 1) } + const progress = + 1 - + selectedMarket.liquidityMiningInfo.mngoLeft.toNumber() / + selectedMarket.liquidityMiningInfo.mngoPerPeriod.toNumber() + const start = selectedMarket.liquidityMiningInfo.periodStart.toNumber() + const now = Date.now() / 1000 + const elapsed = now - start + const est = start + elapsed / progress + return ( <>
@@ -132,7 +141,7 @@ export default function StatsPerps({ perpStats }) { ))}
-
+
+
+
Liquidity Mining
+
+
Rate
+
+ {( + selectedMarket.liquidityMiningInfo.rate.toNumber() * 100 + ).toFixed(2)} + % +
+
+
+
Max Depth Bps
+
+ {selectedMarket.liquidityMiningInfo.maxDepthBps.toString()} +
+
+
+
Target Period Length
+
+ {( + selectedMarket.liquidityMiningInfo.targetPeriodLength.toNumber() / + 60 + ).toFixed()}{' '} + mins +
+
+
+
MNGO Per Period
+
+ {( + selectedMarket.liquidityMiningInfo.mngoPerPeriod.toNumber() / + Math.pow(10, 6) + ).toFixed(2)} +
+
+
+
MNGO Left In Period
+
+ {( + selectedMarket.liquidityMiningInfo.mngoLeft.toNumber() / + Math.pow(10, 6) + ).toFixed(2)} +
+
+ +
+
Est Period End
+
{new Date(est * 1000).toUTCString()}
+
+
+
Period Progress
+
{(progress * 100).toFixed(2)}%
+
+
)