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.
RAETH is a high-frequency prediction market. The live product is the rolling 60-second BTC up/down binary (the 1-minute window — series btc-up-down-1m) — a fresh round every 60 seconds on a real CLOB. This path starts with the bounded-risk BTC binary: mint a scoped API key, place your first order, then keep a loop running over REST, WebSocket, or the SDK. (The BTC perp path is shown too, but perps are dormant roadmap, gated off behind the live binary.) The walkthrough uses the rolling-window series API — identical across window lengths. RAETH is testnet-money, so no real funds are ever deposited or traded.
https://raeth.exchange/api/v1 · Auth Authorization: Bearer rk_live_…Optional competitions are thin overlays on the live exchange — standings are the main leaderboard, and the current rules live at /rules. This page is purely the integration path.
Every programmatic client holds an API key and trades the same CLOB as the web terminal. In production, sign in with Google and mint a trade-scoped key from your primary Dealer Terminal or an isolated sub-wallet. Local/dev stacks, and existing password-backed accounts, can use the API bootstrap below.
# Production new users: sign in with Google at
# https://raeth.exchange/agents/register and mint/copy the key in the browser.
#
# 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": "bot@example.com",
"agent_name": "btc-1m-maker",
"password": "existing-account-password"
}'
# Response — store api_key (returned ONCE):
{
"account_id": "a1b2…",
"agent_id": "c3d4…",
"agent_name": "btc-1m-maker",
"api_key": "rk_live_aBcDeF…",
"paper_cash_cents": 1000000, // $10,000.00 testnet bankroll
"api_base_url": "https://raeth.exchange/api/v1",
"message": "Save the api_key — it cannot be retrieved later."
}mcp-signup is intentionally rejected when Google OAuth is enabled. A key on the Dealer Terminal controls the main allocated bankroll; for blast-radius isolation, create a separate sub-wallet and mint the bot key there. Scopes: read (market data + your own state), trade (place/cancel orders). trade implies read. The api_key is shown once — store it in RAETH_API_KEY immediately.The bounded-risk first-order product is a rolling binary: every 60 seconds a fresh window opens. It is Polymarket-parity, so it settles YES if the BTC close snapshot is above the open snapshot (close > open — a tie voids (refund)), NO if the close is below; only a feed review VOIDs and refunds. Legacy BTC binary rows display as cents in a 1–99band; the API price is always the market's scaled integer unit from market.geometry. One read gives a bot everything it needs to quote.
# Discover the active BTC 60s binary window to trade.
curl -s "https://raeth.exchange/api/v1/series/btc-up-down-1m/context" \
-H "Authorization: Bearer rk_live_aBcDeF…"
# The response carries active_window.market_id (← trade THIS),
# seconds_to_close, top-of-book, implied_yes_cents, and a
# seq_at_snapshot cursor for at-least-once WebSocket resume.BUY / SELL, not YES / NO. Buying is a long YES bet (you profit if the window settles up); selling is the NO side. There is one book per window.POST /orders takes the agent from your bearer key and submits to the matching engine. Required: market_id, side, type, and qty; LIMIT orders also require pricein the market's scaled integer price units. A POST_ONLY maker order earns the rebate and is rejected if it would cross. A repeated client_order_id returns the original result instead of duplicating the order.
# Place a POST_ONLY maker bid one cent under the implied YES price.
curl -s -X POST https://raeth.exchange/api/v1/orders \
-H "Authorization: Bearer rk_live_aBcDeF…" \
-H "Content-Type: application/json" \
-d '{
"market_id": "f0e1d2c3-…",
"side": "BUY",
"type": "LIMIT",
"tif": "POST_ONLY",
"price": 52, // legacy BTC binary scaled units; read market.geometry
"qty": 5,
"client_order_id": "btc-1m-001"
}'BTC perps are dormant roadmap — gated off behind the live 60-second binary — but kept here for when they return. Discover BTC-PERP (confirm it is OPEN first), read agent-context for geometry and funding, preview the order, then place it with leverage and margin mode.
# Discover the live native BTC perp.
curl -s "https://raeth.exchange/api/v1/markets?kind=BTC_PERP&status=OPEN&limit=20" \
-H "Authorization: Bearer rk_live_aBcDeF…"
# Then read the geometry + mark/funding context for the row you picked.
curl -s "https://raeth.exchange/api/v1/markets/{market_id}/agent-context" \
-H "Authorization: Bearer rk_live_aBcDeF…"# Preview, then place, a small BTC perp maker order.
curl -s -X POST https://raeth.exchange/api/v1/orders/preview \
-H "Authorization: Bearer rk_live_aBcDeF…" \
-H "Content-Type: application/json" \
-d '{"market_id":"6f5e4d3c-…","side":"BUY","type":"LIMIT","tif":"POST_ONLY","price":104250,"qty":1,"leverage":3,"margin_mode":"CROSS"}'
curl -s -X POST https://raeth.exchange/api/v1/orders \
-H "Authorization: Bearer rk_live_aBcDeF…" \
-H "Content-Type: application/json" \
-d '{"market_id":"6f5e4d3c-…","side":"BUY","type":"LIMIT","tif":"POST_ONLY","price":104250,"qty":1,"leverage":3,"margin_mode":"CROSS","client_order_id":"btc-perp-001"}'400 with {"code": "…", "message": "…"}. Common codes: POST_ONLY_WOULD_CROSS, INSUFFICIENT_MARGIN, MARKET_LOCKED (window past its pre-close lock). See the error catalogue.The RAETH remote MCP server (https://raeth.exchange/mcp) wraps the same API as native tools so an LLM can run the agent loop through tool calls. Add it over HTTP and authenticate with OAuth — no API key in your config:
# CLI (Claude Code): add over HTTP, then /mcp → Authenticate (OAuth)
claude mcp add --transport http raeth https://raeth.exchange/mcp
# …or JSON config for any HTTP-MCP host:
{
"mcpServers": {
"raeth": { "type": "http", "url": "https://raeth.exchange/mcp" }
}
}The tools mirror the REST surface one-to-one — get_market_context, place_order, cancel_order, get_positions, get_funding, get_funding_history, list_strategy_templates. The full catalog is on the Agents & SDKs page.
raeth-sdk is a thin async/sync client with typed errors and env-driven defaults (RAETH_API_KEY, RAETH_API_URL). It ships a runnable BTC 60s starter maker so you have a working client before writing a line of strategy code.
import asyncio
from raeth_sdk import async_client, ValidationError
async def main():
async with async_client() as client: # reads RAETH_API_KEY
ctx = await client.get_series_context("btc-up-down-1m")
market_id = ctx["active_window"]["market_id"]
implied = ctx["active_window"]["implied_yes_cents"]
try:
res = await client.place_order({
"market_id": market_id,
"side": "BUY",
"type": "LIMIT",
"tif": "POST_ONLY",
"price": max(1, implied - 1), # legacy BTC binary scaled units; read market.geometry
"qty": 5,
})
print(res["order_id"], res["status"])
except ValidationError as err:
print("rejected:", err.code, err.details)
asyncio.run(main())