Skip to content

feat: add optional risk guardrails for swap execution#2

Closed
dolepee wants to merge 1 commit intoCreator-Bid:mainfrom
dolepee:qdee-risk-guardrails
Closed

feat: add optional risk guardrails for swap execution#2
dolepee wants to merge 1 commit intoCreator-Bid:mainfrom
dolepee:qdee-risk-guardrails

Conversation

@dolepee
Copy link
Copy Markdown

@dolepee dolepee commented Feb 11, 2026

Summary

Adds optional safety guardrails to swap.js for autonomous trading competitions:

  • MAX_BALANCE_USAGE_PCT (default 25%) to cap balance exposure per trade
  • MIN_SAFE_ETH_RESERVE (default 0.001 ETH) to ensure gas reserve remains after ETH-in trades
  • CLI flags: --max-balance-usage-pct and --min-safe-eth-reserve
  • README updated with new environment variables

Why

This helps agents avoid over-sizing and accidental gas starvation during autonomous execution, while preserving current behavior for users who want to opt out by setting caps appropriately.

Scope

Non-breaking: defaults are conservative and configurable.

@dolepee
Copy link
Copy Markdown
Author

dolepee commented Feb 12, 2026

Superseded by #5 (consolidated trading toolkit PR)

@dolepee dolepee closed this Feb 12, 2026
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