DEV Community

Kuba Brzeziński
Kuba Brzeziński

Posted on

I built a Solana memecoin trading bot with Claude AI - here's what actually happened

About a month ago I got tired of manually watching crypto charts. Trading felt like a full-time job - stressful, emotional, and impossible to scale. So I did what any developer would do: I decided to automate it.

But I didn't want to actually trade. I wanted to understand the market first. So I built a monitoring bot - one that watches new token launches on Pump.fun, runs them through Claude AI for scam detection, and tracks what would have happened if I'd bought.

No real money on the line. Just data.

The idea

The idea was simple in theory:

  1. Listen for new tokens on Pump.fun via WebSocket
  2. Pre-filter obvious scams (creator holds > 50%, liquidity < $5k, under 30 seconds old)
  3. Send survivors to Claude Haiku with token metadata
  4. Claude decides: buy or skip, with a confidence score
  5. Track price via Helius WebSocket, simulate TP/SL

TypeScript, Node.js, Solana web3.js, Jupiter API, and Claude Haiku as the brain.

What actually went wrong

Problem 1: Pump.fun kept changing their API.
This was the most frustrating part. I'd get the WebSocket working, leave it running overnight, come back to zero data. Their endpoint structure changed multiple times during the week I was building. No changelog, no warning. Just silence.

Problem 2: WebSocket reconnection logic was a mess.
My initial implementation didn't handle disconnects gracefully. When Helius dropped the connection (which happened often on the free tier), the bot just... stopped. Silently. I added reconnection logic but it took longer than it should have.

Problem 3: TP/SL never triggered.
The price monitoring was working, but my sell logic had a race condition. By the time the condition was evaluated, the price had already moved past the threshold. Classic async bug - and in memecoin time, a few hundred milliseconds is the difference between profit and loss.

Problem 4: Latency killed the concept.
This is what ultimately paused the project. Helius free tier adds meaningful latency. By the time my bot detected a new token, parsed it, called Claude, got a response, and checked the price - early buyers had already moved the price. The monitoring data was accurate. The timing wasn't.

What Claude actually did well

The AI layer was honestly the most reliable part. I fed Claude token metadata - holder distribution, liquidity, creator wallet history, description - and asked for a buy/skip decision with confidence score.

It caught patterns I hadn't thought to hardcode: celebrity name tokens with no context, descriptions that were copy-pasted from other coins, supply distributions that looked clean on the surface but had obvious accumulation patterns.

False positives happened, but the pre-filters kept Claude API costs low - roughly $15/month at 500 calls a day.

The results

Honest answer: mostly simulated losses, with occasional gems.

The bot found a few tokens early that pumped 200-300% within an hour. But for every one of those, there were fifteen that went to zero within minutes. The AI filtering helped - it avoided the most obvious scams - but it couldn't predict community momentum, influencer shills, or pure luck.

What I finished up

The core monitoring logic works. What I cleaned up for this challenge:

  • Fixed the README (including a typo in the repo description)
  • Added proper reconnection handling with exponential backoff
  • Documented the known latency limitation so anyone who forks this doesn't spend three days figuring out why free-tier RPC kills the strategy

What I learned

Infrastructure constraints matter as much as the logic. You can have a perfect algorithm and lose because your data arrives 400ms late.

Claude Haiku is surprisingly good at pattern recognition on structured data - better than I expected for the cost.

And Pump.fun's API instability is a real moat. The teams profiting from memecoin trading aren't just smarter - they have paid, reliable infrastructure.

Would I build it again? Yes. Would I run it with real money on Helius free tier? Absolutely not.


Repo: https://github.com/KubaBrzezinskiDev/trading-monitor-bot

Top comments (0)