How to build a trading bot with Claude Code, and test it without risking money
A prompt that builds a working market maker in minutes, a free place to run it on a real order book, and a straight answer on whether it will make money.
Short answer: Give Claude Code an exchange's API docs and describe the bot, and it will write a working one in minutes. Writing it isn't the hard part any more. Finding out whether it makes money is, and that needs a market where someone can actually hit your quotes. Paste the prompt below and it builds a market maker on Rizon, a paper exchange with a public API. There's no sign-up, the key takes one call, and a bad idea costs nothing.
The prompt
Open Claude Code in an empty folder and paste this:
Build me a market-making bot for Rizon, a paper-money exchange with a public API, and run it.
1. Fetch https://rizon.markets/CLAUDE.md, save it as CLAUDE.md in this folder and follow it.
2. Get a key with POST https://rizon.markets/api/v1/accounts. Save it to .env and make sure .env is gitignored.
3. Quote both sides of BTC-15s: post-only limit orders, $20 a side, re-quoting when the price moves, at most 3 times a second. Cancel everything on Ctrl-C.
4. Stop if the session's loss passes $200. Log fills and realised PnL every 10 seconds.
5. Run it for 5 minutes, then tell me how many fills it got, its PnL, and how many of those fills lost money.CLAUDE.md is a page that tells a coding agent everything about the API: how to connect, what will bite it, and how to behave. More prompts cover a data collector, an event-market maker, a momentum trader, a copy trader and a dashboard.
What happened when we ran it
We gave a fresh Claude session this prompt on Nov 4, 2026, against a copy of the exchange, with nothing else to go on. Here's the log.
| Step | What happened |
|---|---|
| Build and test | 17 minutes, a 310-line bot, no bugs to fix |
| First version | Quoted about $1 from the price and got run over: 14 fills in 22 seconds, 9 of them losers, at $1 a side |
| What Claude changed | Without being asked, it dropped its signals and quoted wider: 0.2 sigma, about $9 from the price |
| The 5-minute run | $20 a side: 52 fills, 24 of them losers, PnL +$50 |
That +$50 means nothing yet. One standard deviation on 52 fills of ±$20 is about $144, so it's noise. And 81% of its fills were already through the price when they filled, which is what being a market maker feels like: you get hit when the price is about to go through you.
So you get working code in minutes, and the first thing it teaches you is that quoting close is expensive. Rizon has a bot that picks off stale quotes, as fast traders do on real venues, so a market maker that re-quotes a beat late gets hit on exactly the fills it didn't want. Now you have a real problem to solve:
For each fill, log the price 1 and 5 seconds later, and print my realised spread: what I earned on the spread, net of how the price moved against me. Then tell me what's costing me the most, and try one change.That loop is where the value is: measure, change one thing, run it again. Claude is very good at it. Here's what to measure.
Three ways in
| Way | Best for | How |
|---|---|---|
| The prompt above | A bot from nothing | Paste it into Claude Code, or any coding agent |
| The starter repo | Working code to change | git clone, then bun bot.ts. About 100 lines, with CLAUDE.md included |
| The MCP server | Trading from a chat, with no code | claude mcp add --transport http rizon https://rizon.markets/mcp |
With the MCP server connected, you can just ask: "Make a paper account, show me the BTC-1m book, and buy $10 of Higher." Claude gets tools for markets, books, prices, orders and positions.
Will it make money?
Not by itself. Claude writes code quickly. It doesn't hand you an edge, and neither does a prompt that promises one. Rizon keeps a public record of simple bots, losers included: rules with no edge lose the spread, and the money goes to whoever is faster or better informed. Do trading bots work? has the wider evidence.
What a coding agent changes is how fast you can test ideas. A rule that would have taken a weekend to wire up takes minutes, so you can throw away ten of them before lunch. That's only worth something if you test them honestly, on data you didn't tune them to, with costs counted.
Moving to real money
Rizon is paper, so this is where it stops. If you take a bot to a real venue, a few things change at once:
| On paper | With real money |
|---|---|
| A bug costs nothing | A bug can drain the account in seconds |
| The key is throwaway | The key controls funds: keep it out of the repo, and out of the agent's reach |
| Flow is mostly bots | Flow includes people who know more than you |
| Fills are free | Fees, gas and rebates change the sums |
Set hard limits in code before you start: largest order, most open size, loss for the day, and a kill switch. Polymarket and Kalshi both publish trading APIs. Check they're open to you where you live, and read their rules on automated trading.
FAQ
Can Claude build a trading bot?
Yes. Given an API's docs, Claude Code can write, run and debug a working bot in one session. Whether the bot makes money is a separate question, and it depends on the strategy, not on who wrote the code.
Can Claude connect to Polymarket?
Claude has no built-in connection, but it can write code against Polymarket's public trading API, and third-party MCP servers exist. Remember that those keys hold real money.
Can Claude trade for me?
It can place orders if you give it a key, through code or an MCP server. On Rizon that's paper money. Think hard before giving any agent keys to real money: put limits in code, because a model won't reliably keep to limits it was only told about.
How do I test a trading bot without real money?
Run it on a venue with a paper or demo environment and a live book, so its orders really interact with other traders. Here's how the options compare.
What language should the bot be in?
Whatever you'll read most easily. Python and TypeScript both work well, since the API is plain REST and a WebSocket. For a strategy at this speed, the language won't be what limits you.