From 14d92c94b0f69dcb908c7521e794c0b20aad9523 Mon Sep 17 00:00:00 2001 From: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> Date: Tue, 14 Jun 2022 09:20:46 +0200 Subject: [PATCH] [crown-finance] bugfix --- projects/crown-finance/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/crown-finance/index.js b/projects/crown-finance/index.js index 8bd33cd6c..f8f3e2d9c 100644 --- a/projects/crown-finance/index.js +++ b/projects/crown-finance/index.js @@ -31,7 +31,7 @@ async function getAllTVL(block) { for (let i = 0; i < length; i++) calls.push({ params: [i] }) const { output: data } = await sdk.api.abi.multiCall({ target: contract, - abi: abi.poolInfo2, + abi: abi.poolInfo2, calls, chain, block, }) @@ -42,14 +42,14 @@ async function getAllTVL(block) { data.forEach(({ output }) => { const token = output.lpToken.toLowerCase() const amount = output.amount0 - if (token === crown) balances.staking[transform(token)] = amount - else tempBalances[token] = amount + if (token === crown) sdk.util.sumSingleBalance(balances.staking, transform(token), amount) + else sdk.util.sumSingleBalance(tempBalances, token, amount) lps.push(token) }) const pairs = await getLPData({ lps, chain, block }) - const { updateBalances, prices, pairBalances } = await getTokenPrices({ lps: Object.keys(pairs), allLps: true, coreAssets: [ tether ], block, chain, minLPRatio: 0.001 }) + const { updateBalances, } = await getTokenPrices({ lps: Object.keys(pairs), allLps: true, coreAssets: [tether], block, chain, minLPRatio: 0.001 }) Object.entries(tempBalances).forEach(([token, balance]) => { if (pairs[token]) { const { token0Address, token1Address } = pairs[token]