Skip to content

Commit

Permalink
Prevent entries with zero volume in gasvols (#736)
Browse files Browse the repository at this point in the history
* Avoid entries with zero volume in gasvols

* Cleaner code
  • Loading branch information
trizin authored Nov 3, 2023
1 parent cd1e307 commit 32a4a5e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions df_py/volume/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,15 +524,14 @@ def _queryVolsOwners(

# add gas cost value
if gasCost > 0:
if order["tx"] in txgascost:
continue
if native_token_addr not in gasvols:
gasvols[native_token_addr] = {}

if nft_addr not in gasvols[native_token_addr]:
gasvols[native_token_addr][nft_addr] = 0

if order["tx"] not in txgascost:
txgascost[order["tx"]] = gasCost
gasvols[native_token_addr][nft_addr] += gasCost
txgascost[order["tx"]] = gasCost
gasvols[native_token_addr][nft_addr] += gasCost

if lastPriceValue == 0:
continue
Expand Down

0 comments on commit 32a4a5e

Please sign in to comment.