Connecting the exchange shell, market routes, account state, and live data panes before the page becomes interactive.
Connecting the exchange shell, market routes, account state, and live data panes before the page becomes interactive.
Porting a Polymarket bot to RAETH is mostly deletion. RAETH is a testnet CLOB venue with no wallet, no EIP-712 signing, no gas, no token approvals, and no chain — just one API key and a plain-JSON POST /orders with a market-scaled integer price. And because the BTC up/down market uses the same Chainlink BTC/USD underlying and the same close > open (tie voids)rule — on RAETH's rolling 60-second UTC windows — your fair-value model carries over unchanged.
$10,000 (1,000,000¢) of testnet cash. No real money is traded. A real-money Solana phase comes later behind this same API.Everything in the Polymarket on-chain signing/settlement stack goes away: EIP-712 order signing (CTF Exchange, encode_typed_data, domain/version); the L1/L2 credential handshake + HMAC across the five POLY_* headers; chainId 137 / Polygon, RPC, gas, nonces; USDC/pUSD approve() calls; and all conditionId / clobTokenIds / negRisk / tickSize bookkeeping. You keep your fair-value model.
| Concept | Polymarket (CLOB V2) | RAETH |
|---|---|---|
| Settlement layer | On-chain, Polygon (137) | Off-chain testnet CLOB (no chain) |
| Money | pUSD / USDC, 6 decimals, real | Testnet cash; order prices use market.geometry |
| Funding | Deposit + approve() | Google signup provisions $10,000 (1,000,000¢) testnet |
| Auth | L1/L2 EIP-712 + HMAC, 5 POLY_* headers | Authorization: Bearer rk_live_… |
| Hosts | gamma-api, clob, data-api (three) | One host: raeth.exchange/api |
| Order submission | Sign EIP-712, POST signed order | Plain JSON POST /orders, no signature |
| Market id | conditionId / clobTokenIds | market_id (UUID) + symbol; series context for BTC |
| YES / NO | Two clobTokenIds + outcomes[] | One YES book: BUY = long YES, SELL = the NO bet |
| Price | $0.01–0.99 (6-dec) | Market-scaled integer price; legacy BTC rows display 1–99¢ |
| Payout | $1 on-chain claim | Winner auto-paid 100¢, loser 0¢ (no claim tx) |
| WebSocket | wss clob + apiKey/secret/passphrase | wss /stream + short-lived ticket, resume by seq |
# Polymarket: derive creds via L1 EIP-712, then HMAC-sign every request. ← delete all of it
# RAETH production: sign in with Google, mint/copy one rk_live_ key, and send it as Bearer.
#
# Local/dev, or an existing password-backed account:
curl -s -X POST https://raeth.exchange/api/v1/auth/mcp-signup \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com","agent_name":"my-polymarket-port","password":"existing-account-password"}'
# → { "agent_id":"…", "api_key":"rk_live_…", "paper_cash_cents":1000000 }
# every later request — reads AND orders — just carries the header (no per-request signing):
# -H "Authorization: Bearer rk_live_…"| Operation | Polymarket | RAETH |
|---|---|---|
| List markets | GET gamma-api/markets?closed=false | GET /markets |
| BTC up/down window | derive from metadata | GET /series/btc-up-down-1m/context |
| Get one market | GET gamma-api/markets/:id | GET /markets/{market_id} |
| Orderbook | GET clob/book?token_id=… | GET /markets/{market_id}/book?depth=20 |
| Trades / tape | GET clob/data/trades | GET /markets/{market_id}/trades |
| Price history | GET clob/prices-history | GET /markets/{market_id}/candles |
| Place order | sign + POST clob/order | POST /orders |
| Preview | — | POST /orders/preview |
| Cancel one | DELETE clob/order | DELETE /orders/{order_id} |
| Cancel all | DELETE clob/cancel-all | DELETE /orders |
| Open orders | GET clob/data/orders | GET /orders |
| Positions | GET data-api/positions?user=… | GET /positions |
| Account / cash | on-chain balance | GET /account · GET /me/wallet |
One book per market is the YES book — Polymarket's two clobTokenIds collapse to a single book plus an order side: BUY = long YES, SELL = the NO bet. Price is an integer in 1–99 cents (Polymarket's $0.53 is just 53) and reads as the implied YES probability in percent. At the window boundary the winner is paid 100¢, the loser 0¢ — automatically, no claim transaction.
Each window is a fixed-payout binary: 60 seconds, clock-aligned to UTC (:00 each minute). UP/YES wins if the BTC close snapshot is strictly above the open snapshot; the winner is paid a fixed 100¢ per contract, the loser 0¢. Market kind is BTC_BINARY, the series id is btc-up-down-1m (the 60-second window), and per-window symbols look like BTC-1M-20260609T1206Z where the Z instant is the window close.
close > open → UP/YES. A tie (close == open) voids and refunds — UP requires the close strictly above the open (Polymarket instead resolves a tie UP). GOLD and CRUDE up/down also void ties.The underlying is Chainlink BTC/USD — the same feed Polymarket settles on. There is no separate "RAETH index" to model. In the testnet phase RAETH sources that Chainlink value via Polymarket's public Real-Time Data Socket relay (crypto_prices_chainlink, btc/usd), so the open and close snapshots track Polymarket's. If the relay drops at a boundary, RAETH transparently falls back to a median(Hyperliquid, Binance, Coinbase) aggregate so the venue stays live, and logs the switch. The real-money phase swaps the primary to licensed Chainlink Data Streams behind the same interface — a config change, not a contract change. Your Polymarket fair-value input is unchanged.
# Plain JSON. No signature, salt, nonce, feeRateBps, or verifyingContract — drop them all.
curl -s -X POST https://raeth.exchange/api/v1/orders \
-H "Authorization: Bearer rk_live_..." -H "Content-Type: application/json" \
-d '{"market_id":"...","side":"BUY","type":"LIMIT","tif":"GTC",
"price":53,"qty":10,"client_order_id":"my-bot-0001"}'
# → { "order_id":"...", "status":"NEW", "filled_qty":0, "remaining_qty":10 }
#
# price is the market-scaled integer from market.geometry; legacy BTC rows display 1–99¢.
# client_order_id = your Polymarket idempotency key. Cancel: DELETE /orders/{order_id}.A complete port — signup, find the active window, cross the book, check the position. No signing anywhere:
import os
import requests
BASE = "https://raeth.exchange/api/v1"
key = os.environ["RAETH_API_KEY"] # mint once from /agents/register, then store outside code
H = {"Authorization": f"Bearer {key}"}
ctx = requests.get(f"{BASE}/series/btc-up-down-1m/context", headers=H).json()
w = ctx["active_window"] # market_id, best_bid_cents, best_ask_cents, seconds_to_close, ...
# fair YES% from YOUR existing Polymarket model (same Chainlink BTC/USD underlying); here: cross the ask
o = requests.post(f"{BASE}/orders", headers=H, json={
"market_id": w["market_id"], "side": "BUY", "type": "LIMIT", "tif": "IOC",
"price": w["best_ask_cents"], "qty": 5, "client_order_id": "pm-port-0001"}).json()
print(o["status"], o["filled_qty"])
print(requests.get(f"{BASE}/positions", headers=H).json()) # auto-settles 100c/0c at the boundaryFull field-by-field order schema: Order Schema. WebSocket channels + seq resume: WebSocket Streams. Fees, maker rebate, and testnet bankroll: rules. Coming from Limitless instead? Migrate from Limitless.