Skip to content

Quickstart

Go from zero to a placed order. You'll register a session, fund your account, read a market, and submit a signed order. All examples target staging; swap the hostnames for prod.

Prerequisites

  • A Solana Ed25519 keypair (the same key your Privy embedded wallet exposes). Your base58 public key is your user everywhere below.
  • The ability to produce 64-byte Ed25519 signatures (@noble/ed25519, tweetnacl, or any Solana signer).
  • Trading must be currently open, otherwise POST /v1/orders returns 403 trading_disabled.

1. Establish a session

Sign the bootstrap message and POST /v1/builders/register. See Authentication for the exact message bytes and cookie rules.

TS=$(date +%s)
# Message (exact, newline-delimited, no trailing newline):
#   Parti Session
#   User: <YOUR_PUBKEY>
#   Timestamp: <TS>
SIG=$(your-ed25519-signer)   # hex of the 64-byte signature over that message

curl -X POST https://oracle-api.parti.com/v1/builders/register \
  -c /tmp/parti-cookies.txt \
  -H 'Content-Type: application/json' \
  -d "{ \"user\":\"<YOUR_PUBKEY>\", \"name\":\"my-bot\", \"signature\":\"$SIG\", \"timestamp\":$TS }"
# → { "api_key": "<hex>" }   (stable per user; sets the parti_oracle_session cookie)

Store the cookie jar (-c / -b) and replay it on session-scoped calls.

2. Fund your account

Get your personal deposit address and send USDG on Robinhood Chain (an EVM chain, chain id 4663) to it. Balance credits automatically — no claim step. The deposit routes identify you by your EVM 0x address. See Deposits.

curl https://oracle-deposit.parti.com/v1/deposit/robinhood-address/<YOUR_0X_ADDRESS>
# → { "address": "0x… — send USDG here", "chain": "robinhood", "chain_id": 4663,
#     "token": "USDG", "min_usdg_micro": 1000000, ... }

# Poll until credited:
curl https://oracle-deposit.parti.com/v1/deposit/progress/<YOUR_0X_ADDRESS>
# → { "data": { "stage": "credited", ... } }

curl https://oracle-api.parti.com/v1/balance/<YOUR_PUBKEY>
# → { "user", "available", "locked", "total" }   (micro-USDC)

3. Read a market

Markets are public and edge-cached. Every outcome is its own binary YES/NO with its own market_id — place orders against outcomes[i].market_id, never the bare event_id of a multi-outcome event.

curl "https://oracle-api.parti.com/v1/markets?status=active&limit=5"
curl "https://oracle-api.parti.com/v1/markets/<id>/book"

Prices are basis points (0–10000; 5000 = 50¢, no_price = 10000 − yes_price).

4. Place an order

Sign the canonical 90-byte order message, then POST (cookie required; returns 403 trading_disabled when trading is not currently open):

[ 0..32) market_id   32 bytes — sha256(market_id_string) if not already hex
[32..64) user pubkey 32 bytes — base58 → bytes
[64]     outcome     u8 — 0 = yes, 1 = no
[65]     side        u8 — 0 = buy, 1 = sell
[66..74) price_bps   u64 LE — 0..10000
[74..82) size        u64 LE — contracts
[82..90) nonce       u64 LE — monotonic per user
curl -X POST https://oracle-api.parti.com/v1/orders \
  -b /tmp/parti-cookies.txt \
  -H 'Content-Type: application/json' \
  -d '{
    "market_id": "<hex_or_slug>", "user": "<YOUR_PUBKEY>",
    "side": "buy", "outcome": "yes", "price": 4850, "size": 100,
    "order_type": "post_only", "signature": "<hex>", "nonce": 1700000000
  }'
# → { order_id, fills: [...], remaining, market_id }

order_type: gtc (rest), post_only (reject if it would cross — preferred for makers), ioc (fill what you can, cancel rest), fok (all-or-nothing).

5. Subscribe to live updates

const ws = new WebSocket("wss://oracle-api.parti.com/v1/ws");
ws.onopen = () => {
  ws.send(JSON.stringify({ type: "subscribe", channel: "book:<market_id>" }));
  ws.send(JSON.stringify({ type: "subscribe", channel: "trades:<market_id>" }));
};

Seed initial state from GET /v1/markets/{id}/book and …/trades, then apply the book_update / trade pushes. See LP → Concepts for the full frame shapes.


Where next: Authentication · LP integration · Market maker onboarding · API reference