Skip to content

Commit

Permalink
Epsilon should be in scaled value (#1484)
Browse files Browse the repository at this point in the history
  • Loading branch information
slundqui authored May 22, 2024
1 parent d0ac91e commit 52c1ad2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/agent0/hyperfuzz/system_fuzz/invariant_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,7 @@ def _check_initial_lp_profitable(pool_state: PoolState, epsilon: FixedPoint | No

difference_in_wei = lp_rate.scaled_value - vault_rate.scaled_value

# There's a weird type error for unary operator - for None type,
# so we do multiplication here
if difference_in_wei < (-1 * epsilon):
if difference_in_wei < (-epsilon.scaled_value):
exception_message = f"{lp_rate=} is expected to be >= {vault_rate=}, {difference_in_wei=}"
exception_data["invariance_check:lp_rate"] = lp_rate
exception_data["invariance_check:vault_rate"] = vault_rate
Expand Down

0 comments on commit 52c1ad2

Please sign in to comment.