Get a free key
Hyperliquid · Bots

Hyperliquid bots: copy trading and trading bots on live data

Build a Hyperliquid copy trading or trading bot on one free key: a trader's fills and closed trades live on the WebSocket, a webhook the moment a wallet opens, closes or flips, the newest bar of every coin in one call, and Claude Code writing the bot you describe.

Ask your AI · Claude, ChatGPT, CursorConnect in a minute →

“Send a webhook to my bot every time this wallet opens, closes or flips a position on Hyperliquid. (paste an address)”

alerts_create

“Show this trader's closed trades this month: the win rate, the biggest win and the biggest loss. (paste an address)”

hl_wallet_trades
No code

Copy a trader with an alert

Paste a wallet, get an e-mail or a webhook when it trades. Nothing to install.

The trader's wallet
Alert · a trader's fills

Copy a trader

Paste the wallet you copy. Each time it opens, closes, flips or increases a position you get an e-mail, or a POST to your webhook: that webhook is your bot's trigger. Checked about every 10 seconds; add reduce for partial closes too.

Alert · the trader nears liquidation

Know before the trader you copy is liquidated

One alert when a position of that wallet gets 80% of the way from its entry to its liquidation price (you set the share). A copied position is in the same trouble.

No wallet in mind? Pick one on the leaderboard. Every Hyperliquid alert type: the alerts reference →

The same alert from code, to your bot's webhook

bash
vike-data alerts register-webhook https://your-bot.example.com/hook
vike-data alerts create --type hl_wallet --wallet 0xfc667adba8d4837586078f4fdcdc29804337ca06 --channel webhook --label 'Copy 0xfc667adb'
With AI

Describe the bot, Claude Code writes it

Install the vike skill once, describe the bot in one sentence, and Claude Code writes and runs it on your key.

AI · Claude Code · the vike skill

Describe the bot, Claude Code writes it

One install teaches Claude Code the Vike data, the stream and the CLI; then a sentence is enough.

Skill
vike-data install --claude
Data
hl.fills, hl.closed_trades, REST
Free APIArchiveStreamMCP

How it works

  • Install the CLI and save your key once.
  • Install the vike skill where Claude Code reads it.
  • Ask for the bot in plain words; Claude Code writes it, runs it and shows you the output.

The setup and the ask

bash
npm install -g @vike-io/cli
vike-data init                  # paste your key once
vike-data install --claude      # the vike skill for Claude Code
With code

5 bots on the live stream

Each one is a short script on a free key: change the wallet or the coin and run it. Your bot places its own orders; this API gives it what to act on.

Copy trading · WebSocket · hl.fills

Copy-trading bot

Follow a trader and see what each fill did to its position, the moment it lands.

Data
hl.fills
Filter
wallet (up to 1,000), min_usd 0 = every fill
Each fill
action: open, close, flip, increase or reduce
Orders
your bot places its own orders
Free APIArchiveStreamMCP

How it works

  • Subscribe to hl.fills for the wallet you copy, with min_usd 0: without it you get fills from $1,000 only.
  • Each event says what the fill did (action) and the position before and after it.
  • Mirror it at your own size.

The code

python
import json, os
from websockets.sync.client import connect   # websockets >= 14

with connect("wss://stream.vike.io/v1/stream/hl",
             additional_headers={"X-API-KEY": os.environ["VIKE_API_KEY"]}) as ws:
    ws.send(json.dumps({"action": "subscribe", "id": "copy", "channel": "hl.fills",
                        "filter": {"wallet": ["0xfc667adba8d4837586078f4fdcdc29804337ca06"], "min_usd": 0}}))
    for message in ws:
        frame = json.loads(message)
        if frame["type"] == "ping":
            ws.send(json.dumps({"action": "pong"}))
        elif frame["type"] == "event":
            e = frame["event"]
            d = e["data"]
            s = e["subject"]
            print(e["ts"], s["symbol"], d["action"], d["side"], d["size_token"], "@", d["price"],
                  "position now", d["position_after"])
            # mirror it here at your own size: your bot places its own orders
Alerts · WebSocket · hl.fills

Telegram bot for a trader's moves

Forward every open, close and flip of the trader you follow to your own Telegram chat.

Data
hl.fills
Filter
wallet, action
Sends
your bot, your chat
Free APIArchiveStreamMCP

How it works

  • Subscribe to hl.fills for the wallet, with action narrowed to open, close and flip.
  • Post each one to Telegram with your bot's token.

The code

python
import json, os, requests
from websockets.sync.client import connect   # websockets >= 14

with connect("wss://stream.vike.io/v1/stream/hl",
             additional_headers={"X-API-KEY": os.environ["VIKE_API_KEY"]}) as ws:
    ws.send(json.dumps({"action": "subscribe", "id": "telegram", "channel": "hl.fills",
                        "filter": {"wallet": ["0xfc667adba8d4837586078f4fdcdc29804337ca06"], "action": ["open", "close", "flip"], "min_usd": 0}}))
    for message in ws:
        frame = json.loads(message)
        if frame["type"] == "ping":
            ws.send(json.dumps({"action": "pong"}))
        elif frame["type"] == "event":
            e = frame["event"]
            d = e["data"]
            s = e["subject"]
            text = f"{s['symbol']}: {d['action']} {d['side']} {d['size_token']} @ {d['price']} (${d['size_usd']:,.0f})"
            requests.post(f"https://api.telegram.org/bot{os.environ['TG_TOKEN']}/sendMessage",
                          json={"chat_id": os.environ["TG_CHAT"], "text": text})
Watchlist · WebSocket · hl.fills

Watchlist positions, kept live

Keep the open positions of a list of wallets up to date from their fills.

Data
hl.fills
Filter
wallet: up to 1,000 wallets on one subscription
State
position_after of each fill
Free APIArchiveStreamMCP

How it works

  • Subscribe to hl.fills for every wallet on your list.
  • Each fill carries the position after it (position_after): keep the newest per wallet and coin; 0 is closed.
  • To start from what they hold now, read /positions?wallet=… once (the copy-trade watcher study below does).

The code

python
import json, os
from websockets.sync.client import connect   # websockets >= 14

book = {}   # (wallet, coin) -> its position after the newest fill; negative = short

with connect("wss://stream.vike.io/v1/stream/hl",
             additional_headers={"X-API-KEY": os.environ["VIKE_API_KEY"]}) as ws:
    ws.send(json.dumps({"action": "subscribe", "id": "watchlist", "channel": "hl.fills",
                        "filter": {"wallet": ["0xfc667adba8d4837586078f4fdcdc29804337ca06", "0x25773676902085225ae5751075e4161369334897", "0x8c10d62907917967b17cdec0081ce42ae09eed8e"], "min_usd": 0}}))
    for message in ws:
        frame = json.loads(message)
        if frame["type"] == "ping":
            ws.send(json.dumps({"action": "pong"}))
        elif frame["type"] == "event":
            e = frame["event"]
            d = e["data"]
            after = d["position_after"]
            if after is None:      # a fill whose position could not be read: skip it
                continue
            key = (e["subject"]["wallet"], e["subject"]["symbol"])
            if after:
                book[key] = after
            else:
                book.pop(key, None)
            print({f"{w[:8]} {c}": size for (w, c), size in book.items()})
Large trades · WebSocket · hl.fills

Large trades on a coin

Every fill of a million dollars or more on one coin, with the wallet behind it and its cohort.

Data
hl.fills
Filter
coin, min_usd
Labels
size_cohort and pnl_cohort of the wallet
Free APIArchiveStreamMCP

How it works

  • Subscribe to hl.fills with the coin and a dollar floor.
  • Each event names the wallet, the side, the size in dollars and what the fill did to its position.

The code

python
import json, os
from websockets.sync.client import connect   # websockets >= 14

with connect("wss://stream.vike.io/v1/stream/hl",
             additional_headers={"X-API-KEY": os.environ["VIKE_API_KEY"]}) as ws:
    ws.send(json.dumps({"action": "subscribe", "id": "large-trades", "channel": "hl.fills",
                        "filter": {"coin": ["BTC"], "min_usd": 1000000}}))
    for message in ws:
        frame = json.loads(message)
        if frame["type"] == "ping":
            ws.send(json.dumps({"action": "pong"}))
        elif frame["type"] == "event":
            e = frame["event"]
            d = e["data"]
            lab = e["labels"]
            print(e["ts"], e["subject"]["wallet"], d["side"], f"${d['size_usd']:,.0f}", d["action"],
                  lab.get("size_cohort"), lab.get("pnl_cohort"))
Track record · WebSocket · hl.closed_trades

A trader's closed trades, as they close

Each round trip of the trader once it is closed: entry, exit, hold time and realized PnL, with a running tally.

Data
hl.closed_trades
Filter
wallet, coin, direction
Delay
written every 30 minutes
Free APIArchiveStreamMCP

How it works

  • Subscribe to hl.closed_trades for the wallet.
  • Closed trades are written every 30 minutes, so a close arrives with the next batch.
  • Count wins and losses as they come, or stop copying after a bad streak.

The code

python
import json, os
from websockets.sync.client import connect   # websockets >= 14

wins = losses = 0

with connect("wss://stream.vike.io/v1/stream/hl",
             additional_headers={"X-API-KEY": os.environ["VIKE_API_KEY"]}) as ws:
    ws.send(json.dumps({"action": "subscribe", "id": "closed-trades", "channel": "hl.closed_trades",
                        "filter": {"wallet": ["0xfc667adba8d4837586078f4fdcdc29804337ca06"]}}))
    for message in ws:
        frame = json.loads(message)
        if frame["type"] == "ping":
            ws.send(json.dumps({"action": "pong"}))
        elif frame["type"] == "event":
            e = frame["event"]
            d = e["data"]
            pnl = d["realized_pnl"]
            wins, losses = wins + (pnl > 0), losses + (pnl < 0)
            print(e["subject"]["symbol"], d["direction"], d["entry_price"], "->", d["exit_price"],
                  f"PnL {pnl:+,.2f}", f"held {d['duration_seconds']} s", f"{wins} won, {losses} lost")

Stream address wss://stream.vike.io/v1/stream/hl. Every channel, its filters and the connection rules: the WebSocket reference →

Poll

Or poll: the newest bar of every coin

One call a minute gives a bot every coin's newest 1-minute candle.

Hyperliquid · REST · CLI · MCP

The newest 1-minute bar of every coin, in one call

Route
GET /v1/hyperliquid/ohlcv/latest
CLI
vike-data candles hl
MCP
hl_ohlcv · 1 credit
Cost
1 request of the hourly limit
Free APIArchiveStreamMCP

The newest 1-minute candle of every symbol that traded in the last hour, in one request.

Parameters

ParameterInDescription
marketqueryperp | spot. Default perp
dexqueryHL core or a HIP-3 perp DEX, e.g. XYZ. Omit for every DEX; each row names its own
intervalqueryOnly 1m, the default. Any other value is a 400

Call it

bash
curl -H "X-API-KEY: $VIKE_API_KEY" \
  "https://data.vike.io/v1/hyperliquid/ohlcv/latest"
4 studies

Copy trading and bot questions, answered with code

Each with the sentence to ask your AI instead. Every block was run against the live API on 2026-11-03.

Hyperliquid · API

Copy-trade watcher: alert when a Hyperliquid wallet opens, adds or closes

Poll /wallets/{address}/fills with start set to the last fill you saw to catch every new fill within seconds, and diff /positions?wallet= between polls to tell an open, an add and a close apart.

Uses
/positions, /wallets/{…}/fills
Verified
live API, 2026-11-03: 4 calls, all 200
Free APIArchiveStreamMCP
Ask your AI agent: “What did Hyperliquid wallet 0xfc667adba8d4837586078f4fdcdc29804337ca06 trade in the last 10 minutes?”

The code

python
import os
import requests

API_KEY = os.environ["VIKE_API_KEY"]  # your key, read from the environment

# the wallet's newest fills
r = requests.get(
    "https://data.vike.io/v1/hyperliquid/wallets/0xfc667adba8d4837586078f4fdcdc29804337ca06/fills?limit=5",
    headers={"X-API-Key": API_KEY},
)
Hyperliquid · API

Vet a Hyperliquid trader before copying: win rate, drawdown, profit factor, hold time

Check win rate, drawdown, profit factor and hold time of a Hyperliquid wallet before following it.

Uses
/leaderboard, /liquidations, /wallets/{…}, /wallets/{…}/trades/summary
Verified
live API, 2026-11-03: 4 calls, all 200
Free APIArchiveStreamMCP
Ask your AI agent: “Vet Hyperliquid wallet 0xfc667adba8d4837586078f4fdcdc29804337ca06 before I copy it: win rate, drawdown, profit factor and hold time over 30 days”

The code

python
import os
import requests

API_KEY = os.environ["VIKE_API_KEY"]  # your key, read from the environment

# 30-day record of the wallet at the top of the 30-day PnL board
r = requests.get(
    "https://data.vike.io/v1/hyperliquid/wallets/0xfc667adba8d4837586078f4fdcdc29804337ca06?window=30d",
    headers={"X-API-Key": API_KEY},
)
Hyperliquid · API

How many other wallets hold the same position as this leaderboard trader? (crowding behind a copied wallet)

List the trader's open positions with /positions?wallet=, then pass one position's symbol, side, leverage and entry price to /positions/match; every other address in the matches holds the same trade.

Uses
/positions, /positions/match, /wallets/{…}
Verified
live API, 2026-11-03: 4 calls, all 200
Free APIArchiveStreamMCP
Ask your AI agent: “Who else on Hyperliquid holds a 10x NEAR long entered at 4.4524?”

The code

python
import os
import requests

API_KEY = os.environ["VIKE_API_KEY"]  # your key, read from the environment

# who else holds a 10x NEAR long entered at 4.45238, the position of the 30-day PnL leader
r = requests.get(
    "https://data.vike.io/v1/hyperliquid/positions/match?symbol=NEAR&side=long&leverage=10&entry_price=4.45238263796759&limit=50",
    headers={"X-API-Key": API_KEY},
)
Hyperliquid · API

Poll every Hyperliquid coin once a minute and flag volume spikes

Call /v1/hyperliquid/ohlcv/latest once a minute; it returns the newest 1-minute candle of every symbol that traded in the last hour, and you compare each candle's volume_usd with that symbol's own recent median.

Uses
/ohlcv, /ohlcv/latest
Verified
live API, 2026-11-03: 4 calls, all 200
Free APIArchiveStreamMCP
Ask your AI agent: “Which Hyperliquid coins traded far more than usual in the last minute? Show me the last five one-minute candles of the top one”

The code

python
import os
import requests

API_KEY = os.environ["VIKE_API_KEY"]  # your key, read from the environment

# the newest 1-minute candle of every perp on every dex: run this once a minute
r = requests.get(
    "https://data.vike.io/v1/hyperliquid/ohlcv/latest",
    headers={"X-API-Key": API_KEY},
)
FAQ

Hyperliquid bots FAQ

Can I build a Hyperliquid trading bot in Python?
Yes. Read fills, closed trades, candles and funding from this API on a free key, decide in Python, and place your orders from your own code. Every bot on this page is a short script you can run as it is.
How do I copy trade on Hyperliquid?
Without code: an alert on the trader's wallet, by e-mail or webhook. With code: subscribe to hl.fills for that wallet; each fill says whether it opened, closed, flipped, increased or reduced the position.
How do I pick a trader to copy?
Vet the wallet first: its win rate, drawdown, profit factor and hold time, then how many other wallets already hold the same position. Both studies are below, with their code.
Can I get Hyperliquid alerts in Telegram?
Alerts come by e-mail or webhook. For Telegram, run your own bot: subscribe to hl.fills and post each fill to your chat (the Telegram bot above).
Is there a Hyperliquid trading bot on GitHub?
You do not need one to start: every bot here is shown in full, ready to copy into your own repository, and Claude Code writes a new one from a sentence.