Skip to content

Latest commit

Β 

History

History
96 lines (73 loc) Β· 3.06 KB

File metadata and controls

96 lines (73 loc) Β· 3.06 KB

PumpFun WebSocket 403 Error - Final Fix

πŸ”΄ Problem

Continuous ws error: Unexpected server response: 403 errors flooding Railway logs

βœ… Solution Applied

Code Changes (Already Deployed)

  1. Stricter enabled check - Now requires EXACT match of 'true'
  2. Constructor logging - Shows when service is disabled
  3. Enhanced error handling - Immediately terminates WebSocket on 403
  4. Reconnection guards - Multiple checks to prevent reconnect loops
  5. Missing import fixed - Added pumpFunWebhook import in webhook-routes.ts

What You Need to Do in Railway

Option 1: Disable PumpFun Monitor (RECOMMENDED)

Since Helius webhook already handles all token detection, PumpFun WebSocket is redundant.

Railway Dashboard Steps:

  1. Go to your Railway project
  2. Select your service
  3. Go to Variables tab
  4. Look for ENABLE_PUMPFUN_MONITOR variable
  5. If it exists:
    • DELETE IT (this will default to disabled), OR
    • Set it to false
  6. Click Deploy or let auto-deploy run

Expected Result:

  • Logs will show: [PumpFun] Service disabled (ENABLE_PUMPFUN_MONITOR not set to true)
  • No more 403 errors
  • Helius webhook continues to detect all tokens

Option 2: Get PumpFun API Key (Advanced)

If you specifically need PumpFun WebSocket monitoring:

  1. Contact https://pumpportal.fun for API access
  2. Get authenticated WebSocket URL
  3. Update PUMP_FUN_WS_URL in Railway with authenticated endpoint
  4. Ensure ENABLE_PUMPFUN_MONITOR=true

πŸ” How to Verify

After Deploy, Check Logs:

Look for one of these messages at startup:

If disabled (good):

[PumpFun] Service disabled (ENABLE_PUMPFUN_MONITOR not set to true)

If enabled but still getting 403:

[PumpFun] ⚠️  403 Authentication Error - Pump.fun WebSocket requires authentication
[PumpFun] Set ENABLE_PUMPFUN_MONITOR=false in Railway environment variables to disable

If successfully connected:

[PumpFun] Connecting to WebSocket: wss://pumpportal.fun/api/data
[PumpFun] WebSocket connected
[PumpFun] Subscribed to events: ['new_token', 'graduation']

🎯 Why This Happened

The PumpFun WebSocket endpoint (wss://pumpportal.fun/api/data) now requires authentication or is rate-limiting/blocking connections. Previously it was open, but they've tightened access.

Your app has:

  • βœ… Helius webhook - Detects ALL Solana tokens (working perfectly)
  • βœ… QuickNode streams - Custom monitoring (if configured)
  • ❌ PumpFun WebSocket - Redundant and requires auth

πŸ“Š Current Status

Working Services:

  • Helius webhook βœ… (detecting 120+ tokens/min)
  • Token analyzer βœ…
  • Database βœ…
  • Frontend βœ…
  • Discord bot βœ… (if enabled)
  • Telegram bot βœ… (if enabled)

Issue:

  • PumpFun WebSocket - Getting 403 errors (not critical, can be disabled)

πŸš€ Next Steps

  1. Check Railway Variables tab
  2. Remove or set ENABLE_PUMPFUN_MONITOR=false
  3. Wait for auto-deploy or manually redeploy
  4. Verify logs show service disabled
  5. Confirm 403 errors are gone

That's it! Your app will work perfectly with just Helius webhook handling token detection.