Skip to content

Commit

Permalink
list missing tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Aug 15, 2022
1 parent cc21c02 commit 9c4588b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ async function computeTVL(balances, timestamp) {
);
}
let tokenData = ([]).concat(...(await Promise.all(readRequests)));
const pkSet = new Set(tokenData.map(i => i.PK))
let usdTvl = 0;
const tokenBalances = {};
const usdTokenBalances = {} ;
Expand Down Expand Up @@ -396,6 +397,10 @@ async function computeTVL(balances, timestamp) {
console.error(`Data for ${response.PK} is stale`);
}
});
readKeys.filter(key => key.includes('0x')).forEach(key => {
if (pkSet.has(key)) return;
tokenBalances[`UNKNOWN (${key})`] = balances[key]
})
return {
usdTvl,
tokenBalances,
Expand Down

0 comments on commit 9c4588b

Please sign in to comment.