Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only log close if we found an open #1722

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading