Skip to content

Commit

Permalink
fix(profile): wrong calculated total binance balance (#1571)
Browse files Browse the repository at this point in the history
  • Loading branch information
trkhoi authored Jan 8, 2024
1 parent d8a87b6 commit 1df2e2b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/commands/balances/index/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ async function switchView(
const trackingType = wallet?.data?.type
const { mochiWallets, wallets, cexes } = await profile.getUserWallets(
discordId,
false,
)
let isOwnWallet = wallets.some((w) =>
props.address.toLowerCase().includes(w.value.toLowerCase()),
Expand Down Expand Up @@ -710,6 +711,10 @@ async function switchView(
}

const { field: simpleField } = buildEarnField("Simple", balances.simple)
totalWorth += balances.simple.reduce(
(acc, cur) => acc + cur.amount * cur.price,
0,
)

if (simpleField) {
embed.addFields(simpleField)
Expand Down

0 comments on commit 1df2e2b

Please sign in to comment.