From 7e3dc943af58e6d4f4d7e322cbdc4c8f464c5c65 Mon Sep 17 00:00:00 2001 From: nhestrompia Date: Wed, 13 Sep 2023 12:25:58 +0300 Subject: [PATCH] fix: change vote stake formula --- web/src/pages/Courts/CourtDetails/Stats.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/src/pages/Courts/CourtDetails/Stats.tsx b/web/src/pages/Courts/CourtDetails/Stats.tsx index d6798c079..2bb78a6f7 100644 --- a/web/src/pages/Courts/CourtDetails/Stats.tsx +++ b/web/src/pages/Courts/CourtDetails/Stats.tsx @@ -44,8 +44,14 @@ const stats: IStat[] = [ { title: "Vote Stake", coinId: 0, - getText: (data) => formatPNK(data?.alpha), - getSubtext: (data, coinPrice) => formatUSD(Number(formatUnitsWei(data?.alpha)) * (coinPrice ?? 0)), + getText: (data) => { + const stake = BigInt((data?.minStake * data?.alpha) / 1e4); + return formatPNK(stake); + }, + getSubtext: (data, coinPrice) => { + const stake = BigInt((data?.minStake * data?.alpha) / 1e4); + return formatUSD(Number(formatUnitsWei(stake)) * (coinPrice ?? 0)); + }, color: "purple", icon: VoteStake, },