Skip to content

fix: cancel YES order when NO order fails#2

Open
asm554 wants to merge 1 commit into
strongca22-cpu:mainfrom
asm554:fix/cancel-yes-order-on-no-failure
Open

fix: cancel YES order when NO order fails#2
asm554 wants to merge 1 commit into
strongca22-cpu:mainfrom
asm554:fix/cancel-yes-order-on-no-failure

Conversation

@asm554

@asm554 asm554 commented Apr 12, 2026

Copy link
Copy Markdown

Problem

When the YES order succeeds but the NO order fails, the bot returned False without cancelling the open YES order. This left an unhedged position on a binary market — real financial risk.

Fix

The bot now attempts to cancel the YES order via bot.cancel_order() (already implemented in src/bot.py). If cancellation fails or no order ID is available, a CRITICAL log is emitted for manual intervention.

Test plan

  • Simulate NO order failure in dry-run mode and verify YES order cancellation is attempted
  • Verify CRITICAL log appears when bot.cancel_order() returns False

🤖 Generated with Claude Code

If NO order placement fails after YES order succeeds, the bot now
attempts to cancel the YES order via bot.cancel_order(). If cancellation
also fails, a CRITICAL log is emitted for manual intervention.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant