What the error means
Error Code: ExceededSlippage. Error Number: 6004.
A trade on a PumpSwap pool would fill worse than your slippage limit because the pool price moved first. On buys sized in SOL, the same problem shows as 6040.
| Where it comes from | PumpSwap AMM program |
| Code | 6004 (0x1774); also 6040 (0x1798) BuySlippageBelowMinBaseAmountOut |
How to fix it
- Raise slippage a little, or trade a smaller amount.
- Raise the priority fee.
- Retry with a fresh quote; graduated coins can move fast right after migration.
If that is not it
- 6039 BuyNotEnoughQuoteTokensToCoverFees means the wallet cannot cover fees, not slippage.
More fixes: how to decode any Solana error code and why Solana transactions fail.
Source
Error text and code from PumpSwap program IDL (pump-fun/pump-public-docs, idl/pump_amm.json), read on 24 October 2026.

