← Blog

I Gave Claude $100 and Told It to Trade Crypto

Contents
  1. Why
  2. The setup
  3. Portfolio isolation
  4. How the bot thinks
  5. The guardrails
  6. The moment of truth
  7. Then it all went wrong
  8. The rebuild
  9. The dashboard
  10. What I've learnt so far
  11. The too-safe trap
  12. v3: learning mode
  13. Where it stands now

I wanted to see what happens when you let an AI manage real money. Not paper trading, not a backtest, not a demo. Real USDC, real orders, real Coinbase. So I gave Claude $100 and told it to trade crypto.

This is the story of building an autonomous trading bot in a single Claude Code session, watching it lose money on every trade, then rebuilding the strategy from scratch based on actual research. It's still running. The story isn't over.

#Why

I've been running AI agents for a while now. WIMAUT came out of a $300 runaway cron. OpenClaw agents run daily tasks for Voltade. But those are all operational agents. They fetch data, write summaries, file tickets. They don't handle money.

The question I kept coming back to: can an AI agent make autonomous financial decisions that are actually profitable? Not "AI-assisted trading" where a human reviews signals. Fully autonomous. Scan the market, pick coins, size positions, place orders, manage exits. No human in the loop.

I decided to find out with the smallest amount of money I was comfortable losing entirely.

#The setup

I used Claude Code (Anthropic's CLI tool, included with Claude Max) as both the builder and the brain. Claude Code built the entire bot in one session, and the bot itself uses Claude via the CLI for two things: macro regime detection and individual trade analysis. More on that later.

The tech stack is intentionally simple:

  • Python with the coinbase-advanced-py SDK
  • SQLite for trade history and portfolio state
  • Claude CLI for AI analysis (via Max subscription, so no API costs)
  • Rich for console output

No ML models, no backtesting framework, no data pipelines. The entire project is about 800 lines across 8 files. I wanted to see how far you can get with an LLM reading price data and making judgment calls, the same way a human swing trader would.

#Portfolio isolation

This was the first thing I got right, and the thing I care about most.

I have a main Coinbase account with my actual investments. The trading bot cannot touch any of it. Coinbase lets you create isolated portfolios with separate balances. I created a "Trading Bot" portfolio, transferred exactly $100 USDC into it, and scoped the API key to only access that portfolio.

Every API call in the bot passes retail_portfolio_id to ensure it only sees and trades within the isolated portfolio. Even if there's a bug in the code, the worst case is losing $100. Everything else is in a completely separate universe.

This is the kind of thing that's easy to skip when you're excited to see trades happen. Don't skip it.

#How the bot thinks

Every 15 minutes, the bot runs a cycle.

The bot's first cycle: regime detection, market scan, and candidate ranking.

1. Regime detection. Claude reads the last 7 days of BTC daily candles and classifies the macro environment as risk-on, neutral, or risk-off. This determines how aggressively the bot deploys capital. Risk-on means up to 60% of the bankroll in positions. Risk-off means 10% max, mostly sitting in cash.

2. Exit management. Before looking for new trades, the bot checks all open positions. Trailing stops, take-profit levels, time stops. Stop-losses are server-side (Coinbase stop-limit orders), so they execute even if my Mac is asleep.

3. Grid trading. Before scanning for momentum plays, the bot runs a grid strategy on BTC and ETH. It places buy orders below the current price and sell orders above. Every time the price bounces between levels, a small profit is captured. The grid only runs when the market is ranging (ADX < 25). When the market starts trending, the grid pauses automatically.

4. Market scan. The bot pulls every USDC trading pair on Coinbase, filters to only the top liquid coins, then ranks by opportunity score.

5. AI analysis. The top candidates get sent to Claude with 24 hours of hourly candle data. Claude looks for reasonable setups and flags obvious traps.

6. Position sizing. Trades that pass analysis get sized as a fixed fraction of bankroll, scaled by confidence level. High confidence gets 25%, medium gets 15%, low gets 10%.

7. Execution. Limit buy orders (not market orders, which saves 0.6% per trade in Coinbase maker fees).

#The guardrails

This is the part I spent the most time on. Not the trading logic, not the AI prompts. The guardrails.

Hard floor. If the portfolio drops below $60, the bot stops trading entirely. No overrides, no "one more trade." It just stops.

Daily drawdown limit. 10% max drawdown in a single day. Hit that, and the bot pauses.

Loss streak detection. Four consecutive losing trades triggers recovery mode. Position sizes get reduced by 30%.

Server-side stop-losses. Every buy order is immediately followed by a stop-limit order at 10% below entry. These execute on Coinbase's servers, not mine.

Liquid pairs only. The bot trades 30 coins by volume and spread tightness. No random micro-caps with zero liquidity.

Minimum 2% net edge. Coinbase maker fees at my volume tier are 0.6% per side (1.2% round trip). The bot won't enter unless the expected edge clears fees plus slippage.

#The moment of truth

I ran the bot. First few cycles: nothing. "No trades generated this cycle." Over and over.

The problem was the AI prompt. I'd initially told Claude to "be conservative." So Claude was being conservative. It evaluated every candidate and said "skip." Technically correct. But useless.

I rewrote the prompt to be more aggressive, and it immediately started finding opportunities: OGN at +12% edge, BAL at +5.7% edge.

AI analysis phase: Claude evaluates each candidate, skipping exhausted pumps and buying momentum plays.

And then, on Coinbase:

Real orders filled on Coinbase: OGN and REQ, both market buys in the Trading Bot portfolio.

Two market orders, both filled. The bot chose small positions because Kelly criterion sized conservatively for a $100 bankroll in a neutral regime.

Trade execution: Claude's reasoning, market order placement, and Coinbase API responses.

#Then it all went wrong

Six trades. Six losses. Every single one.

Coin Entry Exit P&L What happened
REQ $0.086 $0.071 -$2.31 Stop loss. Price dumped.
OGN $0.031 $0.026 -$0.92 Stop loss. Price dumped.
OXT $0.020 $0.018 -$0.31 Trailing stop. Brief pump, then reversal.
OXT $0.022 $0.020 -$0.27 Stop loss. Same coin, same result.
SYND $0.048 $0.045 -$0.19 Stop loss. Immediate reversal after buy.
ACX $0.056 $0.052 -$0.15 Stop loss. Same pattern.

Total loss: $4.15. Not catastrophic (the guardrails worked), but a 100% loss rate is a strong signal that something is broken.

I asked Claude to do deep research into why. It came back with a 4,000-word analysis citing academic papers, quant firm strategies, and exchange fee structures. The diagnosis:

1. The fee assumption was wrong. The bot assumed 0.5% fees per side. Actual Coinbase fees at my volume tier: 1.2% per side. Round trip: 2.4%. The "2% minimum edge" threshold was underwater before the trade even started.

2. It was buying after the move. The scanner ranked coins by how much they'd already gone up in 24 hours. By definition, buying the top.

3. Five altcoin positions isn't diversification. Crypto correlation across altcoins is 0.70-0.89. Five positions in different altcoins is effectively the same bet repeated five times.

4. Illiquid micro-caps guaranteed adverse fills. OXT at $0.02, ACX at $0.05. These coins have wide spreads and thin order books. Even a $25 market order moves the price against you.

The full research is in the repo at docs/trading-research.md if you want to read it. Short version: the bot was doing everything that academic research says not to do.

#The rebuild

I rebuilt the strategy from scratch based on the research.

Grid trading on BTC and ETH. Instead of chasing momentum on illiquid altcoins, the bot places limit orders at regular price intervals on the two most liquid coins. Buy orders below the current price, sell orders above. Every oscillation captures a small profit. This only runs when the market is ranging (measured by the ADX indicator). When it starts trending, the grid pauses to avoid accumulating losing inventory.

Real-time WebSocket streamer. The 15-minute polling loop was too slow to catch moves. I added a second process that streams live tick data from Coinbase via WebSocket, watching for breakouts and momentum bursts. When it detects a move (>0.5% in 1 minute with volume surge), it enters immediately.

Limit orders only. Every order is now a limit order to get maker fees (0.6%) instead of taker fees (1.2%). This single change cuts costs nearly in half.

Liquid pairs whitelist. Only top coins by volume and spread. No more penny coins.

Conservative sizing. Kelly fraction dropped from 0.20 to 0.10. Max 2 positions instead of 5.

The architecture is now two processes running in parallel:

  • The agent (slow brain): 15-minute cycles for regime detection, watchlist generation, grid management, and Claude-powered analysis.
  • The streamer (fast reflex): Real-time WebSocket ticks for breakout detection, instant entries, and live trailing stops.

The agent tells the streamer what to watch. The streamer handles fast execution.

#The dashboard

The redesigned dashboard showing account status, strategy explanation, and trade history.

I also rebuilt the dashboard. The old one was a dark-themed wall of numbers. The new one explains what's happening in plain English: what the bot is doing, how it makes decisions, why it exited each trade, and what it's watching next. It has light/dark mode, live system health monitoring, and a tabbed log viewer for debugging.

Dashboard in dark mode with market regime analysis and system health.

Telegram notifications go through Lawrence (my OpenClaw agent) so I get alerts on my phone whenever a trade fills or exits.

#What I've learnt so far

The AI is not the edge. Claude is good at reading candle data and making coherent arguments for buying or selling. But coherent arguments don't make money. The six losing trades all had perfectly reasonable AI reasoning behind them. The edge (if there is one) comes from market structure: spreads, fees, order flow, mean reversion. The AI is useful for regime classification and risk assessment, not price prediction.

Fees are the invisible killer. At small account sizes on Coinbase, fees eat everything. 2.4% round trip on a trade that captures 3% gross profit leaves you with 0.6%. That's a win, but barely. Switching from taker to maker fees was the single most impactful change.

Grid trading is underrated. It's boring. There's no story to tell. "The bot placed a buy order at $70,500 and a sell order at $71,200 and made $0.04." But boring works. Grid trading doesn't need to predict direction. It just needs the price to oscillate, which BTC does constantly on short timeframes.

Guardrails work. Six consecutive losses and the total damage was $4.15 on a $100 account. The hard floor, stop-losses, and position sizing limits all functioned as designed. Without guardrails, those six trades could have wiped 40-50% of the account.

Prompts are product decisions. Changing the AI prompt from "conservative" to "aggressive" completely changed the bot's behaviour. That's not an engineering tweak. That's a product decision about risk appetite.

#The too-safe trap

The v2 rebuild was correct in theory. Grid trading, limit orders, liquid pairs. All the right ideas. But I made a different mistake: I made the bot too conservative.

For two days straight, every 15 minutes, the bot scanned the market, found candidates, ran them through Claude's analysis, and rejected every single one. The AI prompt said "be sceptical, default to skip." So it skipped everything. The minimum edge was 4% after taker fees (2.4% round trip), but the bot was placing limit orders (1.2% round trip), so it was using the wrong fee assumption. And Kelly criterion sizing on a $114 bankroll with 3-4% edges produced bet sizes under $2. The minimum order on Coinbase is $10.

The bot was technically running. But it was doing nothing. No trades means no data. No data means no learning. The adaptive system that's supposed to tune parameters based on outcomes had nothing to work with.

This is the trap with AI-powered systems: making the AI "careful" doesn't make it good. It makes it useless. You can't learn to trade by sitting in cash.

#v3: learning mode

I ripped out the conservative defaults and rebuilt around a different idea: trade more, learn faster.

Expanded the universe. 30 coins instead of 10. Added NEAR, ADA, UNI, AAVE, ARB, OP, PEPE, TRUMP, TAO, and more. Lowered minimum price from $5 to $0.50 and minimum volume from $10M to $1M.

Fixed the fee calculation. The sizing logic now uses maker fees (0.6% per side, 1.2% round trip) since we place limit orders. This alone doubled the number of trades that clear the minimum edge threshold.

Replaced Kelly with fixed fractions. Kelly criterion is mathematically optimal but practically useless at $114. It was producing $1.87 bets. Now: 25% of bankroll for high confidence, 15% for medium, 10% for low. Every trade is at least $11.

Allowed low-confidence trades. Previously, "low confidence" from Claude meant automatic skip. Now it means a smaller bet. The bot needs data from bad calls too. That's how the adaptive system learns what "low confidence" actually predicts.

Rewrote the AI prompt. From "you are a sceptical trader, default to skip" to "you are a trader focused on learning, look for reasons to buy." Not reckless. The prompt still tells Claude to skip freefall and exhausted pumps. But the default flipped from "prove I should buy" to "prove I shouldn't."

Loosened all the knobs. Hard floor dropped from $80 to $60. Daily drawdown limit up from 5% to 10%. Max positions from 2 to 4. Loss streak threshold from 2 to 4 before reducing sizes. Regime deployment limits roughly doubled.

The result was immediate. First cycle after the changes: Claude said "buy" on NEAR (+5.1% edge) and ETH (+4.3% edge). Both orders placed and filled within minutes.

After two days of silence, the bot was trading again.

#Where it stands now

Account value: ~$114. Two open positions (NEAR and ETH) from the first v3 cycle. The adaptive system is finally getting data to work with.

The shift in thinking is the real lesson. v1 was reckless (micro-caps, wrong fees, no research). v2 was paralysed (too conservative, wrong fee calc, Kelly too small). v3 is deliberate: accept more risk to generate learning data, then let the self-improvement loop tighten parameters based on real outcomes.

The bot runs a self-improvement cycle twice a day. Claude analyses trade history, identifies patterns in wins and losses, adjusts stop distances, edge thresholds, and regime deployment limits. But it can only do that if there are trades to analyse. The two days of v2 sitting in cash were wasted compute.

I'm not trying to make it rich. I'm trying to make it reliably profitable at small scale, then slowly increase capital. But first it needs to trade enough to figure out what works.

The $100 was worth it. The six losing trades taught me more about algorithmic trading than any course would have. And the two days of zero trades taught me something else: a system that never acts is worse than one that sometimes loses.


The full source code, research document, and dashboard are in a private repo. The bot uses Claude Code for development and Claude CLI (via Max subscription) for runtime AI analysis. Total monthly cost: $0 beyond the existing Claude Max subscription.

Updated 2026-03-16 with v3 learning mode: aggressive parameters, expanded coin universe, fixed fee calculations, and first new trades.