Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Quickstart

Get trading in under 5 minutes. You'll need an Ed25519 keypair and some test USDC.

1. Create an account

Sign up at dist-lac-seven.vercel.app. The onboarding flow mints test USDC on Solana, bridges it to the appchain, and creates your margin account. Takes about 15 seconds.

After onboarding, go to Settings (top-right) and copy your Appchain Public Key. You'll need this for API calls.

2. Get your account ID

curl https://v4-api.dev.parcllabs.com/v1/accounts/by-owner/YOUR_PUBKEY_HEX

Response:

{
  "accountId": 12,
  "owner": "35504e68...",
  "collateral": "10000000000",
  "positions": [],
  "openOrders": []
}

The accountId is what you use for placing orders.

3. Check available markets

curl https://v4-api.dev.parcllabs.com/v1/markets

Returns an array of markets. Each has a marketId (0 = NYC, 1 = USA, 2 = Austin), current prices, and fee rates.

4. Read the orderbook

curl https://v4-api.dev.parcllabs.com/v1/markets/0/orderbook

Returns bids and asks with price and size at each level.

5. Place an order

Orders are Ed25519-signed transactions submitted via POST /v1/tx. See signing transactions for the full flow.

The short version: you construct a JSON transaction, serialize it with your nonce and timestamp, sign the bytes with your Ed25519 private key, and POST the signed payload.

6. Stream real-time data

Connect to the WebSocket for live orderbook updates, fills, and price changes:

const ws = new WebSocket("wss://v4-api.dev.parcllabs.com/v1/ws");
 
ws.onopen = () => {
  ws.send(JSON.stringify({
    type: "subscribe",
    channels: [
      { channel: "orderbook", market_id: 0 },
      { channel: "trades", market_id: 0 }
    ]
  }));
};
 
ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);
  console.log(msg.type, msg);
};

See WebSocket reference for all channels and message formats.