# AI trading, how to build a Claude-powered crypto bot and test it live

AI trading in practice: how a Claude-powered bot connects to exchange APIs, runs a strategy on live crypto data and gets tested before real capital.

Source: https://whatseon.top/ai-trading-how/ · based on the channel [Richard Donchian](https://www.youtube.com/channel/UCrytrZyYl9mK3yVyQmzNjfw) · Video: [AI Trading: How I Built a Trading Bot With Claude AI - Full Step-By-Step Guide With Tests](https://www.youtube.com/watch?v=LTfUDgg0KNA) · 2026-11-08

![AI trading, how to build a Claude-powered crypto bot and test it live](https://whatseon.top/ai-trading-how/ai-trading-how.webp)

## Key takeaways

- The build follows four stages: strategy definition, Claude-generated code, exchange API connection via keys, and a live test on real-time market data.
- The full walkthrough and setup materials are linked from the video at https://tr.ee/l99AYj.
- One viewer plans to stress-test the setup with 3.5 ETH before trusting it with more capital.
- The bot is tested on live crypto data rather than backtest-only results, so slippage, latency and fees all count.
- The author, Richard Donchian, frames the video as education, not financial advice; crypto trading carries substantial risk.

AI trading means letting a large language model such as Claude write, wire up and run the code that places crypto orders — and the practical route is a four-stage build: define a rule-based strategy, have Claude generate the bot, connect it to an exchange through API keys, then test it on live market data before risking real money. The complete step-by-step walkthrough, including the setup materials used in the build, is available through the [full guide link](https://tr.ee/l99AYj). The approach is deliberately unglamorous: the AI writes and iterates on code, while the trading logic stays explicit and inspectable.

## What an AI trading bot with Claude actually is

An AI trading bot with Claude is not a model that predicts prices from vibes; it is ordinary trading automation whose code was drafted, debugged and refined in conversation with a language model. Claude's role is to translate a plain-English strategy into Python, handle the boilerplate of exchange connectivity, and explain errors when a request fails — the decision rules themselves remain something a human defines and can read line by line.

That distinction matters for anyone searching for AI trading tools. A bot built this way has three separable parts:

1. **The strategy layer** — entry and exit conditions written as explicit rules (for example, a moving-average crossover or a momentum threshold on a given timeframe).
2. **The execution layer** — code that signs requests to the exchange, places market or limit orders, and tracks open positions.
3. **The data layer** — real-time price feeds or candles pulled from the exchange API on a schedule.

Claude is most useful in layers two and three, where the work is repetitive and error-prone: authentication signatures, rate limits, JSON parsing, retry logic. In layer one it acts as a translator and a second pair of eyes, not as an oracle. Anyone expecting the model to "know" where Bitcoin is going next will be disappointed; anyone who wants a working crypto trading bot without writing every line from scratch gets real leverage.

## The build, step by step

Building the bot follows a fixed sequence, and skipping a step is where most beginners lose money. The order below reflects how the walkthrough is structured.

1. **Write the strategy in plain language.** Specify the pair, the timeframe, the exact entry condition, the exit condition, the position size and a hard stop. Vague instructions produce vague code.
2. **Ask Claude to generate the bot.** Provide the strategy, the exchange's API documentation and the language you want (Python is the default). Request a single script with clear functions rather than a monolith.
3. **Create API keys on the exchange.** Generate a key pair with trading permission enabled and withdrawals disabled. Store the key and secret in environment variables, never in the source file.
4. **Connect and verify.** Run the bot in read-only mode first: fetch balances and prices, print them, confirm the signatures and endpoints work before any order is sent.
5. **Paper-trade, then go live small.** Execute against live data with a minimal position size, watch the fills, and only then scale.

Each step is a checkpoint. If the balance fetch fails, the order endpoint will fail too — and debugging a rejected order is far harder than debugging a rejected read request.

## Connecting to an exchange API safely

The single most important configuration choice is a key that can trade but cannot withdraw. Most major crypto exchanges let you scope API permissions individually; enabling spot trading while leaving withdrawal disabled means a leaked key can lose trading capital but cannot drain the account to an external address. IP whitelisting, where the exchange supports it, adds a second lock.

Other settings worth getting right from the start: a request timeout and retry cap so a network hiccup does not turn into a loop of duplicate orders, a check that rounds order sizes to the exchange's lot-size rules, and logging of every request and response to a local file. When something goes wrong at 3 a.m., that log is the only evidence you will have. Claude can be asked to add each of these — timeouts, rounding, logging — as discrete improvements to the script, which is exactly the kind of incremental work language models do well.

## How the live test is run and what to watch

A live test means the bot trades on real-time market data, and the point is to expose everything a backtest hides. The metrics that matter are execution quality, not headline returns: how far the fill price deviates from the price at signal time (slippage), how much the exchange takes in fees per round trip, and how the bot behaves when a candle closes during a network delay.

A realistic first run uses a small balance — one viewer of the breakdown said they intended to test the setup with 3.5 ETH before committing more — and a single pair with tight spreads. Keep the bot's position size small enough that a total loss is an acceptable cost of learning. Record every trade with entry time, signal, fill price and exit, then compare the live results against what the same rules would have produced on historical data. If the gap is wide, the problem is usually execution or fees rather than the strategy itself.

## Typical doubts from traders trying this

The questions that come up most often are about trust and about the AI's actual role. Some viewers of the build expressed enthusiasm for combining a language model with a real on-chain deployment; others wanted to see it running live before believing it. Both reactions are reasonable, and both point at the same answer: the bot earns trust through observation, not through the fact that an AI wrote it.

Common concerns and how to handle them:

- **"Will the AI make trading decisions for me?"** No — it writes and maintains the code. The rules are yours, and you should be able to explain every one of them.
- **"Can I skip the small-size test?"** Not sensibly. Live data exposes latency, fees and partial fills that no simulation reproduces exactly.
- **"What if the code has a bug?"** Assume it does. Disable withdrawals on the key, cap position size in code, and keep a manual kill switch — closing the process or revoking the API key.
- **"Is this profitable?"** Nobody can promise that. Crypto is highly volatile, and past performance does not guarantee future results.

## Risks and limits of AI-assisted crypto trading

AI trading does not remove market risk; it removes some of the friction of building automation. A model-generated bot can still be wrong about the exchange's API version, can still misread a candle, and can still place an order the moment liquidity is thinnest. The strategy layer is where losses originate, and no amount of clean code fixes a bad rule.

The honest framing is that Claude shortens the path from idea to running code — an afternoon instead of a week — and makes iteration cheap. It does not supply an edge. Treat the first version as a prototype, keep the position size trivial, and let the live results decide whether the idea deserves more capital. The author of the breakdown, Richard Donchian, states clearly that the material is educational and not financial or investment advice.

## Summary

The Claude-assisted build is a practical template for AI trading: define explicit rules, let the model write the bot, lock down the API key, and validate on live data at a size you can afford to lose. Richard Donchian's video breakdown walks through the setup, the strategy, the API connection and a live crypto trading test in that order, which is the right order to copy. The tooling is genuinely accessible now; the discipline of testing small is still what separates a working bot from an expensive lesson. To follow the same build with the linked setup materials, start here: [get the full step-by-step guide](https://tr.ee/l99AYj).

## Questions & answers

**Do I need to know how to code to build an AI trading bot with Claude?**

You need to be able to read code well enough to check it, but not to write it from scratch. Claude generates the script, handles the exchange API calls and explains errors, while you define the strategy and verify each function does what you intended. Basic Python literacy — variables, functions, loops — is enough to follow the build and catch obvious mistakes.

**How much capital should I use for the first live test?**

Use an amount small enough that losing all of it would not affect your finances, and keep it to a single trading pair with tight spreads. One viewer of the breakdown planned an initial test with 3.5 ETH, but the size matters less than the discipline of running live before scaling. Compare the live fills against the same rules on historical data before adding capital.

**Is an AI trading bot safe to connect to my exchange account?**

It can be reasonably safe if the API key has trading enabled but withdrawals disabled, and IP whitelisting is switched on where the exchange offers it. Store keys in environment variables rather than in the script, add request timeouts and order-size rounding, and keep a way to revoke the key instantly. A leaked trading-only key can lose your balance but cannot move funds off the exchange.

**Can Claude AI guarantee profits in crypto trading?**

No. The model writes and maintains code; it does not supply a market edge, and the strategy rules remain the source of both gains and losses. Crypto is highly volatile and past performance does not guarantee future results, so treat the first version as a prototype and let live, small-size results decide whether to continue.
