Skip to content

Commit

Permalink
Merge pull request #223 from delta-hq/revert-222-main
Browse files Browse the repository at this point in the history
Revert "zkDX: derivatives : fix balance missing issue"
  • Loading branch information
0xroll authored Jun 20, 2024
2 parents bae23e7 + b33c526 commit 7afecc9
Show file tree
Hide file tree
Showing 3 changed files with 8,244 additions and 8,322 deletions.
2 changes: 1 addition & 1 deletion adapters/zkdx/hourly_blocks.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
number,timestamp
5570666,1718542798
4243360,1714773599
6 changes: 1 addition & 5 deletions adapters/zkdx/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,11 @@ export const getBalanceMap = async (blockNumber: number) => {
let token_address = tokenBalanceShot["token_address"];
let token_balance = tokenBalanceShot["token_balance"];

let tokenBalance = balanceMap.get(user_address);
let tokenBalance = balanceMap.get(user_address)?.get(token_address);
if (tokenBalance == undefined) {
let newBalance = new Map<string, string>();
newBalance.set(token_address, token_balance);
balanceMap.set(user_address, newBalance);
} else {
let balance = tokenBalance.get(token_address);
if (balance == undefined)
tokenBalance.set(token_address, token_balance);
}
}
if (tokenBalanceShots.length < 1000) {
Expand Down
Loading

0 comments on commit 7afecc9

Please sign in to comment.