Logs show constant ws error: Unexpected server response: 403 from Pump Portal WebSocket:
[err] ws error: Unexpected server response: 403
[err] ws error: Unexpected server response: 403
[err] ws error: Unexpected server response: 403
Pump Portal (wss://pumpportal.fun/api/data) has changed to require authentication or has rate-limited/blocked your IP due to excessive connection attempts.
Your bot was trying to reconnect every 10 seconds infinitely, causing more 403 errors.
- Detects 403 errors specifically
- Logs clear warning: "Authentication required or IP blocked"
- Stops aggressive reconnection on 403
- Reconnect delays: 5s → 10s → 20s → 30s (max)
- Max 5 reconnect attempts (was infinite)
- If 403 detected, waits 5 minutes before retry
Add to Railway environment variables:
ENABLE_PUMPFUN_MONITOR=falseThis completely disables pump.fun WebSocket (you still get tokens via Helius webhook).
Since you already have Helius webhook detecting new tokens, pump.fun is redundant.
Railway Dashboard:
- Go to your service → Variables
- Add:
ENABLE_PUMPFUN_MONITOR=false - Redeploy
Result: 403 errors stop immediately, you still get all tokens via Helius.
If you need pump.fun specifically:
- Contact pumpportal.fun or check their docs for API access
- They may have introduced paid/authenticated WebSocket access
- Add API key to connection (if they provide one)
Check their status:
- Website: https://pumpportal.fun
- API docs: https://docs.pumpportal.fun (if exists)
- Discord/Telegram: Ask about 403 errors
Some alternatives to pump.fun WebSocket:
- Pump.fun API (REST): Poll their API instead of WebSocket
- Helius Webhooks: Already implemented ✅
- QuickNode Streams: Already configured ✅
- DexScreener API: Detects new token pairs
After this fix:
- ✅ 403 errors logged with clear explanation
- ✅ Stops spamming reconnection attempts
- ✅ Can be completely disabled via env var
- ✅ Fallback to Helius webhook for token detection
Your token detection still works via:
- ✅ Helius webhook (real-time)
- ✅ QuickNode streams (if configured)
- ✅ Manual scans via API
- ❌ Pump.fun WebSocket (403 blocked)
Check logs after redeploying:
Before (spammy):
[err] ws error: Unexpected server response: 403
[err] ws error: Unexpected server response: 403
[err] ws error: Unexpected server response: 403
After (clean):
[inf] [Alpha Alerts] Pump.fun WebSocket closed: 1006
[inf] [Alpha Alerts] Reconnecting to pump.fun in 5s (attempt 1/5)
[err] [Alpha Alerts] ❌ Pump.fun 403 - Authentication required or IP blocked
[inf] [Alpha Alerts] Skipping pump.fun reconnect - recent 403 error (auth required)
Or if disabled:
[inf] [Alpha Alerts] Pump.fun monitoring disabled (ENABLE_PUMPFUN_MONITOR=false)
Disable pump.fun monitoring by setting ENABLE_PUMPFUN_MONITOR=false because:
- ✅ You already have Helius webhook (better coverage)
- ✅ Stops 403 error spam in logs
- ✅ Saves bandwidth and connection resources
- ✅ No functionality loss (Helius catches all new tokens)
Files Modified:
server/alpha-alerts.ts- Added 403 detection, backoff, disable optionserver/services/pumpfun-webhook.ts- Better error messages
New Logic:
// Detects 403 and stops reconnecting
if (errorMsg.includes('403') || errorMsg.includes('Forbidden')) {
this.last403Error = Date.now();
console.error('[Alpha Alerts] ❌ Pump.fun 403 - Authentication required');
ws.close();
this.pumpFunReconnectAttempts = this.maxPumpFunReconnects;
}
// Exponential backoff: 5s, 10s, 20s, 30s
const backoff = Math.min(30000, 5000 * Math.pow(2, attempts - 1));-
Add env var to Railway:
ENABLE_PUMPFUN_MONITOR=false -
Redeploy service
-
Check logs - 403 errors should stop
-
Verify token detection still works via Helius webhook
If 403 errors persist after disabling pump.fun:
- Check other WebSocket connections in logs
- Verify Ankr API key isn't causing other 403s
- Consider IP unblocking if you need pump.fun access
Pump Portal Support:
- Check if they have Discord/Telegram for API access
- May need to pay for authenticated WebSocket access
- Or wait for IP ban to expire (usually 24hrs)