Claude Code

Build a Hyperliquid trading bot with Claude Code

Add Keel to Claude Code with one command and Claude Code can build a Hyperliquid trading strategy from your prompt, backtest it on real price and funding history, and keep the source in your repo. Keel is a strategy builder for Hyperliquid perpetuals that gives Claude Code 33 tools to search its building blocks, save versions and run backtests on its engine. Starting a strategy on your account is a step you take in the Keel app.

By Keel Research Team
Updated November 11, 2026
Or set it up directly
Claude Code
Terminal
claude mcp add --transport http keel https://mcp.usekeel.io/mcp
  1. 1Run the command in your terminal
  2. 2Inside Claude Code run /mcp and choose Authenticate
  3. 3Sign in or sign up on the Keel page that opens (no account needed beforehand)

Sign in in the browser when asked. No API keys. /mcp → Authenticate

Check it worked

Two ways to tell, and either one settles it. A connection that is already live is not improved by signing in again.

In Claude Code Keel should be listed there with its sign-in recorded. If it is, you are connected — signing in again changes nothing.

Terminal
claude mcp list

Ask the agent keel_account_status answers with the Keel account the session is signed in as, which nothing but a live connection can return. If the agent says it has no Keel tools, the sign-in did not finish.

Prompt
Use keel_account_status and tell me which Keel account this session is signed in as.

Not yet verified against a Claude Code version. These steps follow Anthropic's own documentation, read on 2026-09-16.

Ask AI about Keel
Other ways to connect
Every client, step by step
Example session
Claude Code + Keel
  1. YouFind a breakout strategy in Keel's library for Hyperliquid and show me how its backtest did.
  2. Claude CodeKeel's library has Channel Breakout Strategy on Hyperliquid. Every day it holds the top Hyperliquid perps by volume long or short in proportion to how far price sits outside a 20-day volatility channel. Its published backtest, Aug 2024 to Sep 2026, net of fees, slippage and funding: Sharpe 0.96, +127.0% total return, a worst drawdown of 40.4% and 4,034 trades.
Why connect an engine

Claude Code can write a backtester. You still have to trust it.

Ask Claude Code for a trading bot in an empty folder and it will happily write one: a data downloader, a loop over candles, an order function. The code may even run. What it can't give you is confidence that the backtest inside it is right. Did it charge fees on both sides of every trade? Did it pay and collect funding every hour? Did it use a price the bot could not have known yet? Each of those is a quiet bug that makes a losing strategy look good.

Keel takes that part off the table. Its backtest engine replays Hyperliquid prices and funding with fees and slippage on every trade, and it is the same engine behind every strategy in Keel's public library. Claude Code talks to it over MCP. Your terminal session stays where the thinking happens: Claude Code reads your notes, writes the strategy, starts the runs and explains the results, while Keel does the part that has to be exactly right.

In practice Claude Code gets 33 Keel tools. They cover the library of published strategies, Keel's 262 building blocks and their settings, saving and versioning strategies, starting and reading backtests, notes that stay with a strategy, and read-only checks on strategies already running on your account.

The server Claude Code connects to is Keel's Hyperliquid MCP server, the same one Claude and ChatGPT use.

How the engine charges fees, slippage and funding
Step by step

From an empty terminal to a tested strategy

Setup is one command and one sign-in. Every step after that is a prompt, so you can do the whole thing without leaving the terminal.

  1. 01

    Add the Keel server

    In your terminal, run claude mcp add --transport http keel https://mcp.usekeel.io/mcp. Claude Code registers Keel as a remote MCP server for this project. Nothing is installed on your machine.

  2. 02

    Sign in from inside Claude Code

    Start Claude Code, type /mcp and choose Authenticate next to keel. A Keel page opens in your browser. Sign in, or create a free account there, and the Keel tools show up in your session. There is no API key to copy.

  3. 03

    Describe the strategy, or start from the library

    Tell Claude Code what you want in a sentence or two: which coins, the signal, how often to rebalance and how big a position can get. If you would rather start from something tested, ask it to list Keel's library and pick one to copy.

  4. 04

    Let it write the strategy

    Claude Code searches the building blocks, reads the settings of the ones it needs, and writes the strategy in Keel's strategy language. Keel checks the wiring when it saves. A block that doesn't fit is rejected with a reason, and Claude Code fixes it before you see the result.

  5. 05

    Backtest and read the result

    Ask for a backtest. Claude Code starts the run, waits for it, and prints the return, Sharpe ratio, worst drawdown and trade count. Ask for the positions behind the worst month and it pulls them from the same run, so you can see what actually lost money.

  6. 06

    Iterate, and keep the source

    Change one setting, run it again, and ask for the two runs side by side. Keel keeps every saved version, can show the difference between any two, and can restore an old one. Claude Code can also write the strategy source into your repo so it lives next to the rest of your code.

  7. 07

    Review it in the Keel app before it runs

    The agent builds, tests and reads. When you want to run a strategy on your account, it hands it to the Keel app and you take it from there. Paper trade it on live prices first. When you start it for real, it trades from your own Hyperliquid account, where Keel can place trades and can never withdraw.

An example session

What it looks like in the terminal

A shortened session built on a strategy from Keel's public library. The figures Claude Code quotes are the library's published results, which is what Keel's tools return when it reads a library entry. The last step starts a new run of your own.

Example session
Claude Code + Keel
  1. YouFind a breakout strategy in Keel's library for Hyperliquid and show me how its backtest did.
  2. Claude CodeKeel's library has Channel Breakout Strategy on Hyperliquid. Every day it holds the top Hyperliquid perps by volume long or short in proportion to how far price sits outside a 20-day volatility channel. Its published backtest, Aug 2024 to Sep 2026, net of fees, slippage and funding: Sharpe 0.96, +127.0% total return, a worst drawdown of 40.4% and 4,034 trades.
  3. YouWhat about a slower 40-day channel?
  4. Claude CodeKeel tested that on the same coins and dates: Sharpe 0.89, +105.3% total return, a worst drawdown of 46.3% and 3,205 trades. The slower channel trades fewer times, with a deeper worst drawdown and a lower Sharpe (0.89 against 0.96).
  5. YouCopy it into my account with the 40-day channel, put the source in strategies/ in this repo, and run a fresh backtest.
  6. Claude CodeCopied, and saved a second version with the 40-day channel. The source is in strategies/breakout.strategy. The backtest is running on Keel now. I'll summarise it when it finishes and give you the link to open both versions in the Keel app.
The library's published result
Aug 2024 to Sep 2026
Channel Breakout Strategy on Hyperliquid
EquityDrawdown
Sharpe
0.96
Total return
+127.0%
Worst drawdown
−40.4%
Trades
4,034

Claude Code didn't estimate either result. The first came from the library entry and the second from a setting the library had already tested. Anything nobody has tested yet goes to the engine as a new backtest, and Claude Code waits for the answer.

The session ends with two things you can check: a file in your repo you can read and diff, and two saved versions in your Keel account with their backtests attached.

Open the strategy page with its monthly returns and every tested setting
Working from a repo

Habits that suit Claude Code

Claude Code is at its best on a list of small, checkable changes. A few ways to use that with Keel:

Keep the source under version control

Have Claude Code write each strategy to a file before it saves it to Keel. Your git history then shows why a setting changed, and Keel's own versions show what each one scored.

Hand it a queue

Write the experiments you want into a markdown file: three lookbacks, two universe sizes, with and without a volatility filter. Ask Claude Code to work down the list and report a table at the end.

Leave notes on the strategy

Ask Claude Code to add a note when you settle a decision. The note is stored with the strategy in your Keel account, so a session next week starts from what you already learned.

Compare, then decide

Before keeping a change, ask for the old and new runs side by side and the positions behind the biggest difference. A better Sharpe that came from one lucky trade shows up plainly that way.

Watch your quota

Every run counts toward your plan's backtest allowance. Claude Code can check how many you have left before it starts a long list.

Share a result

Ask for a public link to a strategy or a backtest when you want a second opinion. The link opens on usekeel.io without an account.

Claude Code or the Claude app

Pick the one that fits how you work

Both connect to the same Keel server with the same 33 tools, so a strategy you build in one shows up in the other. The difference is where you sit. Claude Code lives in your terminal, next to your files and git, and suits a list of experiments or source you want to keep in a repo.

The Claude app on the web, desktop or phone suits talking an idea through before it is precise enough to test. If you have never written code, start there. Its guide walks through the same steps in the Claude app.

The same steps work in Codex, Cursor and GitHub Copilot in VS Code. Each one adds the same Keel server and builds into the same account, and the agents page has the setup for each.

Limits

What Claude Code can't do with Keel

Start or stop a live strategy

Claude Code can read how your running strategies are doing. Starting, pausing and stopping happen in the Keel app, by you.

Trade stock or commodity perps

Stock and index perps are HIP-3 markets, and Keel doesn't support them yet. Support is coming soon. Strategies today run on Hyperliquid's crypto perps.

Move money

No Keel tool touches deposits or withdrawals, and Keel itself can never withdraw from your Hyperliquid account.

Skip the backtest

A result Claude Code quotes is either a library figure or a run on Keel's engine. If neither exists, the honest answer is to run one.

More on running a Hyperliquid trading bot
FAQ

Questions about Claude Code and Hyperliquid

How do I connect Claude Code to Hyperliquid?

Through Keel. Run claude mcp add --transport http keel https://mcp.usekeel.io/mcp in your terminal, then type /mcp inside Claude Code and choose Authenticate. Sign in or sign up on the Keel page that opens, and Claude Code can build and backtest Hyperliquid strategies.

Can Claude Code build a crypto trading bot?

Yes. Connected to Keel, it writes the strategy from your description, Keel checks and saves it, and the backtest runs on Keel's engine with fees, slippage and funding. The strategy is the bot: once you start it in the Keel app, it rebalances on its schedule without Claude Code.

Does Claude Code place trades?

No. None of the Keel tools sends an order. Claude Code builds, tests and reads, and you start a strategy yourself in the Keel app after reviewing it.

Can I run Keel locally instead of the hosted server?

Yes. Install the package with pipx install keel-trade, sign in with keel auth login, and add it with claude mcp add keel -- keel mcp serve. The same package also installs the keel command line tool for scripts.

What if the tools don't appear after I add the server?

The sign-in did not finish. Type /mcp, check that keel is listed, and choose Authenticate again. If it still fails, remove the server, add it again with the same command, and sign in on the page that opens.

Which markets can I backtest?

Hyperliquid's crypto perpetual futures, such as BTC, ETH, SOL and HYPE, on Keel's price and funding history. HIP-3 stock and commodity markets are coming soon.

What does it cost?

Connecting Claude Code costs nothing extra. Keel's free plan gives you 25 backtests every 30 days, plus 50 in your first week, and charges 5 basis points on live trades. Trader is $49 a month for more runs and a lower fee. Your Anthropic plan for Claude Code is billed by Anthropic.