Skip to content

Commit 2a9baec

Browse files
authored
Fix #92priv: [Bug] Volume DF DCV bounds (#809)
Fix df-private#92: [Bug] Volume DF's DCV bounds are per user & per-asset, should only be per-asset - wrote a special test to catch the issue: `test_bound_by_DCV_1nft_2accounts()`. The test was failing (as it should have been) - then fixed the issue: just one line in df_py/volume/reward_calculator.py. This made the failing test pass (good) - also, a couple other tests in df_py/volume/test/test_calcrewards.py were failing: test_volume_reward_calculator() and test_volume_reward_calculator_predictoor_mul(). I refactored them to be more compact, then fixed the failures
1 parent cca4665 commit 2a9baec

File tree

2 files changed

+131
-139
lines changed

2 files changed

+131
-139
lines changed

df_py/volume/reward_calculator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def _calc_rewards_usd(self) -> np.ndarray:
201201
R[i, j] = min(
202202
perc_at_j * perc_at_ij * self.OCEAN_avail,
203203
ocean_locked_ij * TARGET_WPY, # bound rewards by max APY
204-
DCV_OCEAN_j * multiplier, # bound rewards by DCV
204+
DCV_OCEAN_j * perc_at_ij * multiplier, # bound rewards by DCV
205205
)
206206

207207
# filter negligible values

0 commit comments

Comments
 (0)