From bde358b6370c9faf5723d558f20850a3d0f3281c Mon Sep 17 00:00:00 2001 From: alecks <0xalecks@gmail.com> Date: Thu, 11 Apr 2024 14:50:32 -0400 Subject: [PATCH] ui: fix grown stalk calculation --- projects/sdk/src/lib/silo/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/sdk/src/lib/silo/utils.ts b/projects/sdk/src/lib/silo/utils.ts index 05c8c8fc93..9633f6756f 100644 --- a/projects/sdk/src/lib/silo/utils.ts +++ b/projects/sdk/src/lib/silo/utils.ts @@ -181,7 +181,8 @@ export function calculateGrownStalkSeeds( * @param bdv The bdv of the deposit */ export function calculateGrownStalkStems(stemTip: ethers.BigNumber, stem: ethers.BigNumber, bdv: TokenValue) { - const deltaStem = stemTip.sub(stem); + const deltaStem = stemTip.sub(stem).div(10 ** 6); + if (deltaStem.lt(0)) return Silo.sdk.tokens.STALK.fromHuman("0"); // FIXME return Silo.sdk.tokens.STALK.fromBlockchain(bdv.toBigNumber().mul(deltaStem)); }