You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reject zero/negative buy amount before sending transaction #2
pumpfun buy <mint> 0 sends a 0-lamport transaction to the network, wasting fees. Negative amounts are parsed as CLI flags (-1 → "No such option"), which is safe but confusing.
Fix
Add validation in src/pumpfun_cli/commands/trade.pybuy(), after _validate_mint():
ifsol_amount<=0:
error("Buy amount must be greater than zero.")
Files to change
src/pumpfun_cli/commands/trade.py — add guard in buy()
tests/test_commands/test_trade_cmd.py — add test for zero amount
How to test
uv run pytest tests/test_commands/test_trade_cmd.py -v
Activity
feat: Add amount validation for buy and sell operations
blinkenstephanie commentedon Sep 22, 2026