Schemas Get a free key
Polymarket · Bots

Polymarket bots: trading, copy trading and arbitrage

Copy a wallet without writing code, or build your own bot on recorded markets, live trades and wallet positions. Your bot places its orders through Polymarket’s own SDK; this API gives it what to act on.

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

“Which Polymarket wallets are worth copying: best 30-day P&L with 20+ resolved markets?”

polymarket_leaderboard

“What did wallet 0x… trade today, and is it in profit?”

polymarket_wallet
No code

Copy a wallet with an alert

Pick a trader, get an e-mail when they trade. Nothing to install.

Alert · a wallet’s trades

Follow a wallet

Paste a wallet from the leaderboard or any wallet page. Every time it buys or sells, you get the market, the side, the size and the price.

No wallet in mind? Pick one on the leaderboard.

Alert · big trades in a market

Watch a market for whales

Pick a market and a size, from $1,000 up. You hear about every trade above it, with the wallet behind it.

Or press Create alert on any market page: the market is filled in for you.

With AI

Let Claude Code build the bot

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.

Needs
Claude Code, Node.js 22.12+
Skill
vike-data install --claude
Data
pm.positions, pm.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

4 bots, ready to run

Each one is a short script on a free key: change the wallet or market and run it.

Copy trading · WebSocket · pm.positions

Copy-trading bot

Follow wallets and mirror what each trade did to their position.

Data
pm.positions
Filter
wallet (up to 1,000)
Delay
about 5 minutes after the trade
Orders
Polymarket’s own SDK
Free APIArchiveStreamMCP

How it works

  • Subscribe to pm.positions for the wallets you copy.
  • Each event says open, increase, reduce, close or flip, with shares before and after.
  • Mirror it at your own size through Polymarket’s SDK.

The code

python
import json, os
from websockets.sync.client import connect

with connect("wss://stream.vike.io/v1/stream/polymarket",
             additional_headers={"X-API-KEY": os.environ["VIKE_API_KEY"]}) as ws:
    ws.send(json.dumps({"action": "subscribe", "id": "s1", "channel": "pm.positions",
                        "filter": {"wallet": ["0x…"]}}))
    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"]
            print(e["subject"]["title"], e["subject"]["outcome"], d["action"], d["side"], d["size"], "@", d["price"])
Alerts · WebSocket · pm.trades

Telegram bot for big trades

Forward every big trade in the markets you follow to your own Telegram chat.

Data
pm.trades
Filter
market, min_usd
Delay
about 5 minutes after the trade
Sends
your bot, your chat
Free APIArchiveStreamMCP

How it works

  • Subscribe to pm.trades for your markets, from a dollar size up.
  • Post each trade to Telegram with your bot’s token.

The code

python
import json, os, requests
from websockets.sync.client import connect

with connect("wss://stream.vike.io/v1/stream/polymarket",
             additional_headers={"X-API-KEY": os.environ["VIKE_API_KEY"]}) as ws:
    ws.send(json.dumps({"action": "subscribe", "id": "s1", "channel": "pm.trades",
                        "filter": {"market": ["0x…"], "min_usd": 1000}}))
    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"]
            text = f"{e['subject']['title']} · {e['subject']['outcome']}: {d['side']} ${d['usd']:,.0f} @ {d['price']}"
            requests.post(f"https://api.telegram.org/bot{os.environ['TG_TOKEN']}/sendMessage",
                          json={"chat_id": os.environ["TG_CHAT"], "text": text})
Trading · REST

Trading bot in Python

Find the 5-minute BTC market trading now, read its book, decide, and trade through Polymarket’s SDK.

Data
/markets, /orderbook
Ids
slug ends in the window start
Backtest
/settlements/bulk
Orders
Polymarket’s own SDK
Free APIArchiveStreamMCP

How it works

  • Find the market trading now: its slug ends in its start time.
  • Read its order book and recent trades.
  • Test the rule on how past markets settled, then send orders through Polymarket’s SDK.

The code

python
import os, time, requests

KEY = {"X-API-KEY": os.environ["VIKE_API_KEY"]}
start = int(time.time()) // 300 * 300          # this 5-minute window
m = requests.get("https://data.vike.io/v1/polymarket/markets",
                 params={"query": f"btc-updown-5m-{start}", "limit": 1}, headers=KEY).json()[0]
up, down = m["token_ids"]
book = requests.get("https://data.vike.io/v1/polymarket/orderbook",
                    params={"token_id": up, "depth": 5}, headers=KEY).json()
print(m["slug"], book[:4])
Arbitrage · REST

Arbitrage bot: Up + Down under $1

Check whether both outcomes of one market can be bought for less than $1 together.

Data
/orderbook × 2
Rule
same as_of_ts on both books
Cost
2 requests a check
Orders
Polymarket’s own SDK
Free APIArchiveStreamMCP

How it works

  • Read both outcomes’ books of one market.
  • Add the two best asks only when both snapshots carry the same as_of_ts.
  • Walk both ladders against the taker fee before you call it an edge.

The code

python
import os, requests

KEY = {"X-API-KEY": os.environ["VIKE_API_KEY"]}
UP, DOWN = "…", "…"  # the two token ids of one market, from /markets

def best_ask(token):
    rows = requests.get("https://data.vike.io/v1/polymarket/orderbook",
                        params={"token_id": token, "depth": 1}, headers=KEY).json()
    asks = [r for r in rows if r["side"] == "ask"]
    return (asks[0]["price"], asks[0]["as_of_ts"]) if asks else (None, None)

(up_ask, t1), (down_ask, t2) = best_ask(UP), best_ask(DOWN)
if t1 == t2 and up_ask is not None and down_ask is not None and up_ask + down_ask < 1:
    print("Up + Down =", up_ask + down_ask)
FAQ

Polymarket bot FAQ

Can I build a Polymarket trading bot in Python?
Yes. Read markets, books and trades from this API on a free key, decide in Python, and send orders through Polymarket’s own SDK.
How do I copy trade on Polymarket?
Without code: an alert on the wallet. With code: subscribe to pm.positions for that wallet and mirror each open, increase, reduce or close.
Is there a Polymarket arbitrage bot?
The recipe above checks whether Up and Down of one market cost less than $1 together, from books taken at the same moment.
Can I get Polymarket trades in Telegram?
Yes, with your own Telegram bot: subscribe to pm.trades and forward each trade to your chat.