Skip to main content

Current model

Joyride identifies trading accounts by wallet address.

HTTP

Authenticated HTTP reads (the query API) require a JWT obtained via SIWS (see the WebSocket section below for the sign-in flow). Send it as a Bearer token:
For CLI users, joyride login performs the SIWS flow and stores the JWT at ~/.joyride/session.json. Subsequent CLI commands (and the MCP server) send it automatically. The server sets the session lifetime (the JWT’s exp claim), not a fixed client default; joyride auth status shows the exact expiry, and joyride logout clears the stored token on shared machines.

WebSocket

SIWS runs over the core trading WebSocket (wss://joyride.exchange/api/client). The server requires a challenge/response before any private/* method:
  1. Request a nonce:
  1. Sign the message Sign in to Joyride\n\nWallet: {wallet}\nNonce: {nonce} with the wallet’s ed25519 key.
  2. Submit the signed payload:
Successful auth returns { wallet, account_id, roles, session_token }. The session_token is the JWT you reuse as an HTTP Bearer credential (query API) and to resume the session without re-signing. Accounts are not auto-provisioned. A wallet with no Joyride account yields no usable account_id; the SDK raises AccountNotProvisioned and the CLI prints a “sign up at joyride.exchange” pointer. Create the account in the web app (referral code + terms attestation) first.

Resuming a session

Once you hold a valid session_token, resume without re-signing on the next connection:

Admin endpoints

Admin routes require:
ADMIN_TOKEN is read from the server environment. For hosted environments, use an issued admin token and send it as a bearer token on each admin request.