Documentation Index
Fetch the complete documentation index at: https://docs.raydium.io/llms.txt
Use this file to discover all available pages before exploring further.
Raydium Perps is a white-labeled deployment on Orderly Network. The order book, matching engine, and account state all live on Orderly. The Raydium SDK v2 (
@raydium-io/raydium-sdk-v2) does not cover perps — for programmatic access, use Orderly’s REST + WebSocket API directly. The snippets below show the most common flows; the canonical reference is at orderly.network/docs.Version banner.
- Backend: Orderly Network REST + WebSocket API
- Snippet schema verified against Orderly’s API as of 2026-04
- Solana cluster for on-chain deposits:
mainnet-beta - Signing: Solana ed25519 over the Orderly EIP-712-style payload (Orderly uses an EIP-712 schema even for non-EVM chains; see Orderly docs for the latest field list)
What’s on this page
The flows below cover the integrator-relevant lifecycle:- Account setup — deposit USDC and register the account with Orderly.
- Authenticated REST calls — request signing for order placement, cancellation, and account queries.
- Trading — placing market / limit orders, cancelling, fetching positions and fills.
- Market data — subscribing to the orderbook and trade WebSocket.
- Withdrawal — initiating a withdrawal back to the wallet.
@solana/web3.js and tweetnacl for Ed25519 signing. They are starting points — Orderly’s API surface is broad and changes faster than this page; always check Orderly’s live docs before shipping production code.
Setup
Account registration
Before placing any orders, register the wallet with Orderly:(broker_id, wallet_address) pair — the registration is idempotent. If a wallet has already registered with Raydium’s broker, the call returns the same account ID without creating a new one.
Deposit USDC
Deposits move USDC from the wallet ATA to Orderly’s settlement vault. They are on-chain Solana transactions:/v1/client/holding to confirm:
orderlyAuthGet is defined below — every authenticated call goes through it.)
Request signing helper
Every authenticated REST call to Orderly carries an Ed25519 signature over(timestamp + method + path + body):
timestamp more than 5 seconds off the server clock are rejected. Sync your clock (NTP) and avoid signing requests in advance.
Place a market order
order_id plus a status. Fills come over the WebSocket (see below); the REST response itself does not block until fully filled.
Place a limit order with Post-Only
IOC / FOK, set time_in_force: "IOC" or "FOK". See products/perps/order-types for the semantics of each flag.
Cancel an order
/v1/orders or watching the WebSocket — assuming a cancel succeeded without confirmation can lead to duplicate or unintended positions.
Fetch open positions
position_qty is a short, positive is a long. position_qty == 0 means the position is closed but the row may still show until the next cleanup.
Fetch fill history
page and size query params to paginate.
WebSocket: market data
subscribe payload signed the same way as REST requests, scoped to your account ID. Orderly’s docs have the exact payload shape; it changes occasionally, so don’t hard-code a particular schema here.
Withdraw USDC
products/perps/fees). The on-chain transfer happens within 1–2 minutes under normal conditions; expect longer during congestion.
Pitfalls
- Don’t reuse the trading key across environments. A single Orderly trading key registered against your wallet is associated with one Solana mainnet account. If you also need devnet or staging, generate a separate key for each.
- Time sync. Orderly’s clock-skew tolerance is tight (±5s). On long-running services, NTP drift will eventually break signing. Re-sync periodically.
- WebSocket reconnects. The public WS occasionally drops connections during Orderly upgrades. Implement exponential backoff and resubscribe on reopen.
- Rate limits. REST calls are tier-rate-limited per account. Bulk-cancel via
cancel_allrather than loopingcancel-by-id when you have >5 orders to cancel. - Position direction is implicit. A
BUYorder onPERP_SOL_USDCopens or extends a long; aSELLopens or extends a short — but if you’re already long, aSELLreduces (and may flip) the position because Raydium Perps is one-way mode. Always check current position before placing an order if the direction matters. - Funding and liquidations are separate from order flow. Funding payments and liquidations show up as separate event streams; they are not “orders”. Subscribe to the relevant private WS topics if you need to observe them.
Where to go next
products/perps/trading-basics— the conceptual primer on perpetual mechanics.products/perps/order-types— the semantics of each order type and flag.products/perps/collateral— supported collateral assets and per-chain limits.products/perps/fees— maker/taker schedules and the withdrawal fee.
- Orderly Network developer documentation — canonical reference for the API surface used above. Raydium Perps consumes this directly.
- Orderly TypeScript SDK — wraps the same REST/WebSocket layer with typed helpers; useful if you want to skip writing the signing layer yourself.


