-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
good first issueGood for newcomersGood for newcomers
Description
Problem
--slippage accepts any integer with no bounds checking:
--slippage -5→ formula produces impossiblemin_tokens_out, guaranteed on-chain rejection--slippage 999→ large negative integer →struct.errorcrash with Python traceback
Fix
Add validation in src/pumpfun_cli/commands/trade.py in both buy() and sell(), after _validate_mint():
if slippage < 0 or slippage > 100:
error("Slippage must be between 0 and 100.", hint="Got: {slippage}")Files to change
src/pumpfun_cli/commands/trade.py— add validation inbuy()andsell()tests/test_commands/test_trade_cmd.py— add tests for out-of-range slippage
How to test
uv run pytest tests/test_commands/test_trade_cmd.py -vReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers