Skip to content

Commit

Permalink
Only log close if we found an open (#1722)
Browse files Browse the repository at this point in the history
  • Loading branch information
slundqui authored Oct 30, 2024
1 parent e614e6d commit 7b3a8f4
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/agent0/hyperfuzz/system_fuzz/run_fuzz_bots.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,27 +174,37 @@ def _check_trades_made_on_pool(
pool_trade_event_counts = trade_counts[trade_counts["hyperdrive_name"] == pool.name][
"event_type"
].values
# Only look for close trades if we found a corresponding open trade
if "OpenLong" not in pool_trade_event_counts:
has_err = True
error_message = f"Pool {pool.name} did not make any OpenLong trades after {iteration} iterations"
elif "CloseLong" not in pool_trade_event_counts:
has_err = True
error_message = (
f"Pool {pool.name} did not make any CloseLong trades "
f"with open positions after {iteration} iterations"
)

if "OpenShort" not in pool_trade_event_counts:
has_err = True
error_message = f"Pool {pool.name} did not make any OpenShort trades after {iteration} iterations"
if "CloseLong" not in pool_trade_event_counts:
elif "CloseShort" not in pool_trade_event_counts:
has_err = True
error_message = f"Pool {pool.name} did not make any CloseLong trades after {iteration} iterations"
if "CloseShort" not in pool_trade_event_counts:
has_err = True
error_message = f"Pool {pool.name} did not make any CloseShort trades after {iteration} iterations"
error_message = (
f"Pool {pool.name} did not make any CloseShort trades "
f"with open positions after {iteration} iterations"
)

if "AddLiquidity" not in pool_trade_event_counts:
has_err = True
error_message = (
f"Pool {pool.name} did not make any AddLiquidity trades after {iteration} iterations"
)
if "RemoveLiquidity" not in pool_trade_event_counts:
elif "RemoveLiquidity" not in pool_trade_event_counts:
has_err = True
error_message = (
f"Pool {pool.name} did not make any RemoveLiquidity trades after {iteration} iterations"
f"Pool {pool.name} did not make any RemoveLiquidity trades "
f"with open positions after {iteration} iterations"
)

if has_err:
Expand Down

0 comments on commit 7b3a8f4

Please sign in to comment.