Skip to content

Commit

Permalink
Volume Calculation, do not skip the orders in multi order transactions (
Browse files Browse the repository at this point in the history
#757)

* Do not skip the whole calc on dup gas tx

* Update predictoor multiplier

* Fix test

* Update multiplier test

* Revert test_calc_challenge_rewards

* Avoid double nesting
  • Loading branch information
trizin authored Nov 16, 2023
1 parent f89a5af commit b841602
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion df_py/util/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@
23294: ["0x4ac2e51f9b1b0ca9e000dfe6032b24639b172703"],
23295: ["0xe02a421dfc549336d47efee85699bd0a3da7d6ff"],
}

PREDICTOOR_MULTIPLIER = 1 - 1 / 1.201
PREDICTOOR_RELEASE_WEEK = 62
PREDICTOOR_MULTIPLIER = 0.201
PREDICTOOR_OCEAN_BUDGET = 37_000
PREDICTOOR_DF_FIRST_DATE = datetime(2023, 11, 9)

Expand Down
4 changes: 1 addition & 3 deletions df_py/volume/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,7 @@ def _queryVolsOwners(
native_token_addr = networkutil._CHAINID_TO_ADDRS[chainID].lower()

# add gas cost value
if gasCost > 0:
if order["tx"] in txgascost:
continue
if gasCost > 0 and order["tx"] not in txgascost:
if native_token_addr not in gasvols:
gasvols[native_token_addr] = {}
if nft_addr not in gasvols[native_token_addr]:
Expand Down
4 changes: 2 additions & 2 deletions df_py/volume/test/test_calcrewards.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,12 +1043,12 @@ def test_calc_rewards_volume_predictoor_mul():
assert rewards_per_lp[2]["0xlp_addr2"] == approx(444.44444444)
assert rewards_per_lp[2]["0xlp_addr3"] == approx(222.22222222)
assert rewards_per_lp[1]["0xlp_addr1"] == approx(
300 * 0.201
300 * (1 - 1 / 1.201)
) # predictoor multiplier
assert rewards_info[2]["0xnft_addr2"]["0xlp_addr2"] == approx(444.44444444)
assert rewards_info[2]["0xnft_addr2"]["0xlp_addr3"] == approx(222.22222222)
assert rewards_info[1]["0xnft_addr1"]["0xlp_addr1"] == approx(
300 * 0.201
300 * (1 - 1 / 1.201)
) # predictoor multiplier


Expand Down

0 comments on commit b841602

Please sign in to comment.