Skip to main content
Full API reference: Ondoperps API Documentation
All endpoints in this guide use the sandbox environment. For production, swap the base URL.
Ondo Perps is a tokenized equity perps exchange. Builders who integrate Ondo Perps into their frontend earn incremental fees on every fill they route. Fees are deposited directly into your Ondo Perps margin account. Your app handles the full user onboarding flow: wallet connection, SIWE auth, deposit, and order placement. Once a user is onboarded, every subsequent order is a single REST call with your builder code attached.

How It Works

The user’s wallet touches two things: SIWE login (to prove identity) and the on-chain deposit. Everything after that is REST calls authenticated by a JWT. Your app manages the session, and orders include your builder code. Incremental fees are attributed automatically on each fill.

Integration Flow


Step 1: Prerequisites

Environment: This guide runs in a browser with an EVM wallet extension installed (MetaMask, Phantom EVM, WalletConnect, etc.). The code uses window.ethereum. Sandbox access:
  1. Log in at app.ondoperps-sandbox.xyz and get your account ID
  2. Contact the Ondo Perps team at builders@ondoperps.xyz with your app’s public URL (for CORS allowlisting) and your account ID. You can also notify team of the fees your application will be charging (it will be applied to all user orders placed via your app). Alternatively, you can set desired fees in request body (see below). Please note, that currently builders are capped at 10 bps fee/order
  3. You’ll receive an invite code and your builder code
  4. The team enables API key management for your account
  5. Create and manage your API keys from the frontend
Base URLs:

Step 2: Set Up Your Client

Helper Methods

All authenticated endpoints require Authorization: Bearer {jwtToken}. Define these helpers once.

Step 3: Authenticate (SIWE)

Ondo Perps uses Sign In With Ethereum (ERC-4361). The user signs a challenge with their wallet. Your app receives a JWT for all subsequent requests.

3a. Connect Wallet

Auth must happen on Ethereum mainnet, regardless of which chain the user deposits on later.

3b. Define the SIWE Signing Function

3c. Request and Sign the Challenge

The response includes challenge.id and challenge.message, which you pass to the next two steps.

3d. Complete the Challenge and Get Your JWT

3e. Accept Terms (First Login Only)


Step 4: Deposit USDC

Sandbox

In sandbox, regular deposit flow is optional. You can click through the deposit flow in the sandbox frontend. No real funds are needed. Once your account is funded, skip to Step 5: Place Orders.

Production

Alternatively, use production-like deposit flow, where users deposit USDC on-chain. The flow: request a deposit address from the API, then send an ERC-20 transfer to that address. Note: this example is written for Sepolia USDC contract, you should use Mainnet USDC contract for Production.
Test funds (Sepolia):

Step 5: Place Orders

Market names use the format {TICKER}-USD.P. Examples: QQQ-USD.P, NVDA-USD.P, AMD-USD.P. See the Perps REST API for the full order schema, batch orders, and cancellation.

Market Order

The response includes orderId, market, type, side, size, status, and createdAt. See the Perps REST API for the full response schema.

Check Order Status

Check Positions

Limit Order

Note: depending on market conditions, a limit order at this price may be rejected. Use the current market price as a reference.
Builder code: Add your builderCode to every order to earn incremental fees. Contact the Ondo Perps team to get your code activated. Field name subject to change before v1.

Step 6 (Optional): Charting Data

Fetch chart data for TradingView or any charting library. This endpoint does not require authentication.

Step 7 (Optional): WebSockets

Subscribe to real-time price updates via WebSocket.
See the WebSocket API docs for all available channels and message formats.

Sandbox vs Production

All endpoints work identically in both environments. Change the base URL and deposit flow, everything else stays the same.

Full Example

Copy-paste the entire integration in one block. Mirrors Steps 2-7 above.

Main Flow

WebSockets


Changelog