# Table of Contents - [API Key Authentication - Ondo Perps](#api-key-authentication-ondo-perps) - [Unknown](#unknown) - [API Key Authentication - Ondo Perps](#api-key-authentication-ondo-perps) - [Index - Ondo Perps](#index-ondo-perps) - [Welcome to Ondo Perps - Ondo Perps](#welcome-to-ondo-perps-ondo-perps) - [Builder Integration Guide - Ondo Perps](#builder-integration-guide-ondo-perps) - [Architecture - Ondo Perps](#architecture-ondo-perps) - [Technology - Ondo Perps](#technology-ondo-perps) - [Markets - Ondo Perps](#markets-ondo-perps) - [Public Beta - Ondo Perps](#public-beta-ondo-perps) - [Get Status - Ondo Perps](#get-status-ondo-perps) - [Hello - Ondo Perps](#hello-ondo-perps) - [Account Setup - Ondo Perps](#account-setup-ondo-perps) - [Placing Your First Order - Ondo Perps](#placing-your-first-order-ondo-perps) - [Funding Your Account - Ondo Perps](#funding-your-account-ondo-perps) --- # API Key Authentication - Ondo Perps > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/llms.txt](https://ondoperps.mintlify.app/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://ondoperps.mintlify.app/api-reference/#content-area) Access Restricted The content you are trying to access is not available in your region. Ondo Perps is not offered to persons in the United States or other restricted jurisdictions. --- # Unknown \# Ondo Perps ## Docs - \[Welcome to Ondo Perps\](https://docs.ondoperps.xyz/about.md) - \[Account Setup\](https://docs.ondoperps.xyz/account-set-up.md) - \[Get Account\](https://docs.ondoperps.xyz/api-reference/account/get-account.md): Returns account information for the authenticated user. - \[Get Open Order Counts\](https://docs.ondoperps.xyz/api-reference/account/get-open-order-counts.md): Returns open order counts per market/product for the authenticated account. - \[Create API Key\](https://docs.ondoperps.xyz/api-reference/api-keys/create-api-key.md): Create a new API key. The secret is returned only once. - \[Delete API Key\](https://docs.ondoperps.xyz/api-reference/api-keys/delete-api-key.md): Delete an API key by ID. - \[List API Keys\](https://docs.ondoperps.xyz/api-reference/api-keys/list-api-keys.md): Returns API keys for the authenticated account. - \[Remove API Key IP Whitelist Entry\](https://docs.ondoperps.xyz/api-reference/api-keys/remove-api-key-ip-whitelist-entry.md): Remove an IP address from the whitelist for an API key. - \[Set API Key IP Whitelist\](https://docs.ondoperps.xyz/api-reference/api-keys/set-api-key-ip-whitelist.md): Set or update IP whitelist for an API key. - \[API Key Authentication\](https://docs.ondoperps.xyz/api-reference/api\_key\_authentication.md): Example of how to use API keys - \[Complete SIWE Address Book Challenge\](https://docs.ondoperps.xyz/api-reference/auth/complete-siwe-address-book-challenge.md): Complete the signed challenge to add a withdrawal address. - \[Complete SIWE Login\](https://docs.ondoperps.xyz/api-reference/auth/complete-siwe-login.md): Complete Sign-In with Ethereum by submitting the signed challenge. Returns JWT. - \[Get SIWE Address Book Challenge\](https://docs.ondoperps.xyz/api-reference/auth/get-siwe-address-book-challenge.md): Get a Sign-In with Ethereum challenge for adding a withdrawal address. - \[Get SIWE Login Challenge\](https://docs.ondoperps.xyz/api-reference/auth/get-siwe-login-challenge.md): Get a Sign-In with Ethereum (ERC-4361) challenge for login. - \[Invalidate JWT\](https://docs.ondoperps.xyz/api-reference/auth/invalidate-jwt.md): Invalidates all JWTs for the authenticated account. - \[Connect\](https://docs.ondoperps.xyz/api-reference/connection/connect.md): Establish a WebSocket connection. After connecting, send JSON messages to interact with the API. - \[Login\](https://docs.ondoperps.xyz/api-reference/connection/login.md): Authenticate the WebSocket connection. Required before subscribing to private channels. - \[Ping\](https://docs.ondoperps.xyz/api-reference/connection/ping.md): Send \`{"op": "ping"}\` to keep the connection alive. The server responds with \`{"type": "pong"}\`. - \[Get Fills\](https://docs.ondoperps.xyz/api-reference/fills/get-fills.md): Returns a paginated list of fills for the authenticated account. - \[Get Fills by Order ID\](https://docs.ondoperps.xyz/api-reference/fills/get-fills-by-order-id.md): Returns all fills for a given order. The \`orderID\` path parameter can be: - \[Get Fills CSV\](https://docs.ondoperps.xyz/api-reference/fills/get-fills-csv.md): Export fills as CSV, sorted reverse chronologically. - \[Get Funding Fee Payments\](https://docs.ondoperps.xyz/api-reference/funding-rate/get-funding-fee-payments.md): Get a paginated history of funding fee payments for the authenticated account. For how funding is calculated and applied, see \[Funding rates\](/funding-rates). - \[Get Funding Rate History\](https://docs.ondoperps.xyz/api-reference/funding-rate/get-funding-rate-history.md): Get the historical funding rates for a market. For how funding is calculated and applied, see \[Funding rates\](/funding-rates). - \[Get Funding Rates\](https://docs.ondoperps.xyz/api-reference/funding-rate/get-funding-rates.md): Get an estimate of the current-interval funding rate in a given market, as well as when the next funding is and what premium index measurements make up the funding rate. For how funding is calculated and applied, see \[Funding rates\](/funding-rates). - \[Get Mark Prices\](https://docs.ondoperps.xyz/api-reference/funding-rate/get-mark-prices.md): Get the current mark prices for all perpetual futures markets. For how mark prices are derived, see \[External pricing derivations\](/pricing-derivations). - \[Builder Integration Guide\](https://docs.ondoperps.xyz/api-reference/integration\_guide.md): Walk-through integrating with Ondo Perps as a builder. This guide uses JavaScript in-browser examples - \[Get Balance\](https://docs.ondoperps.xyz/api-reference/margin-account/get-balance.md): Get a summary of the balance for a margin account. For how positions and balances work, see \[Positions and balances\](/positions-balances). - \[Get Liquidation History\](https://docs.ondoperps.xyz/api-reference/margin-account/get-liquidation-history.md): Returns a paginated history of liquidation events for the authenticated account. For how liquidations work, see \[Liquidations\](/def). - \[Get Max Order Size\](https://docs.ondoperps.xyz/api-reference/margin-account/get-max-order-size.md): Get a summary of the maximum order size that can be placed given the current state of the order book and available margin. For how size limits are determined, see \[Position size limits\](/maximum-position-sizes). - \[Get Orders Summaries\](https://docs.ondoperps.xyz/api-reference/margin-account/get-orders-summaries.md): Returns a summary of resting orders, position, and market order margin requirements for each market. - \[Get Candles\](https://docs.ondoperps.xyz/api-reference/market-data/get-candles.md): Returns OHLCV candlestick data for a perpetual futures market as an array of objects, each with the full field names \`startTime\`, \`open\`, \`high\`, \`low\`, \`close\`, and \`volume\` (values are strings). If you need the TradingView UDF format instead (parallel \`o\`/\`h\`/\`l\`/\`c\`/\`v\` arrays of numbers), use \`G… - \[Get Contracts\](https://docs.ondoperps.xyz/api-reference/market-data/get-contracts.md): Gets a list of perpetual futures contracts and their current market data. For the list of supported markets, see \[Markets\](/markets). - \[Get Open Interest\](https://docs.ondoperps.xyz/api-reference/market-data/get-open-interest.md): Get open interest across all perpetual futures markets. - \[Get Order Book Depth\](https://docs.ondoperps.xyz/api-reference/market-data/get-order-book-depth.md): Returns the current order book depth snapshot for a market. - \[Get Price History (TradingView)\](https://docs.ondoperps.xyz/api-reference/market-data/get-price-history-tradingview.md): Returns historical bar data in TradingView UDF format, as required by the TradingView charting library: a single object with parallel arrays keyed \`t\`, \`o\`, \`h\`, \`l\`, \`c\`, and \`v\` (values are numbers), plus a status field \`s\`. For a standard array-of-objects representation with full field names (\`op… - \[Get Symbol Info (TradingView)\](https://docs.ondoperps.xyz/api-reference/market-data/get-symbol-info-tradingview.md): Returns symbol metadata in TradingView UDF format. See https://www.tradingview.com/rest-api-spec/#operation/getSymbolInfo. - \[Get Trades\](https://docs.ondoperps.xyz/api-reference/market-data/get-trades.md): Returns a paginated list of public trades for a market. - \[Get Volume\](https://docs.ondoperps.xyz/api-reference/market-data/get-volume.md): Get 24-hour trading volume across all perpetual futures markets. - \[Get Markets\](https://docs.ondoperps.xyz/api-reference/markets/get-markets.md): Returns available trading markets. For the list of supported markets, see \[Markets\](/markets). - \[Batch Cancel Orders\](https://docs.ondoperps.xyz/api-reference/orders/batch-cancel-orders.md): Cancels multiple orders in a single call. Returns results for each order. Provide a comma-separated list of order IDs via the \`orderIDs\` query parameter. Each entry can be an internal order ID or \`client:{clientOrderID}\`. - \[Cancel All Orders\](https://docs.ondoperps.xyz/api-reference/orders/cancel-all-orders.md): Cancels all orders for the authenticated user. Optionally restricted to a single market. - \[Cancel Order by ID\](https://docs.ondoperps.xyz/api-reference/orders/cancel-order-by-id.md): Cancels an individual order by order ID. The \`orderID\` path parameter can be: - \[Create Batched Orders\](https://docs.ondoperps.xyz/api-reference/orders/create-batched-orders.md): Creates multiple orders in a single API call. Some orders may succeed while others fail. The response code is 2XX as long as there is no internal server error. Returns 400 with \`error\_code=batch\_order\_empty\` if the \`orders\` array is empty. Returns 400 with \`error\_code=batch\_order\_too\_many\_orders\` if… - \[Create Order\](https://docs.ondoperps.xyz/api-reference/orders/create-order.md): Creates a limit or market order. Change the "type" field to switch between order types. If \`postOnly\` is \`true\` and an order would match at placement, a 400 is returned with error \`post\_only\_has\_match\`. For the available order types and their behavior, see \[Order types\](/order-types). - \[Get Order by ID\](https://docs.ondoperps.xyz/api-reference/orders/get-order-by-id.md): Gets an individual order by order ID. The \`orderID\` path parameter can be: - \[Get Orders\](https://docs.ondoperps.xyz/api-reference/orders/get-orders.md): Returns a paginated list of orders matching the given parameters. - \[Get Orders CSV\](https://docs.ondoperps.xyz/api-reference/orders/get-orders-csv.md): Export filled orders as CSV, sorted reverse chronologically. - \[Get Portfolio Summary\](https://docs.ondoperps.xyz/api-reference/portfolio/get-portfolio-summary.md): Returns current portfolio metrics for the authenticated account: margin balance, net invested, PnL, volume metrics, and Sharpe ratios (when enabled and sufficient data). - \[Get Portfolio Summary Graph\](https://docs.ondoperps.xyz/api-reference/portfolio/get-portfolio-summary-graph.md): Returns time-series portfolio snapshots for the authenticated account. Optional query parameter \`range\` controls the bucket size: 7d (default), 24h, 30d, or all. - \[Get Leverage\](https://docs.ondoperps.xyz/api-reference/positions/get-leverage.md): Returns the current leverage setting(s) for the authenticated account. If \`market\` is provided, returns leverage for that market only; otherwise returns leverage for all markets. For how leverage and margin work, see \[Leverage\](/leverage). - \[Get Positions\](https://docs.ondoperps.xyz/api-reference/positions/get-positions.md): Returns all open positions for the authenticated account. For how positions and balances work, see \[Positions and balances\](/positions-balances). - \[Set Leverage\](https://docs.ondoperps.xyz/api-reference/positions/set-leverage.md): Sets the leverage for a market. Leverage must be a positive integer and cannot exceed the market's maximum leverage. Reducing leverage while insufficient margin is available will return 400 with \`error\_code=insufficient\_margin\`. For how leverage and margin work, see \[Leverage\](/leverage). - \[Subscribe: Deposits\](https://docs.ondoperps.xyz/api-reference/private-channels/subscribe:-deposits.md): Subscribe to the \`deposits\` channel. Requires authentication (login first). - \[Subscribe: Perps Balance\](https://docs.ondoperps.xyz/api-reference/private-channels/subscribe:-perps-balance.md): Subscribe to the \`balancePerps\` channel. Requires authentication (login first). - \[Subscribe: Perps Dead Man's Switch\](https://docs.ondoperps.xyz/api-reference/private-channels/subscribe:-perps-dead-mans-switch.md): Subscribe to the \`cancelAllOrdersAfterPerps\` channel. Requires authentication (login first). - \[Subscribe: Perps Fills\](https://docs.ondoperps.xyz/api-reference/private-channels/subscribe:-perps-fills.md): Subscribe to the \`fillsPerps\` channel. Requires authentication (login first). - \[Subscribe: Perps Funding Payments\](https://docs.ondoperps.xyz/api-reference/private-channels/subscribe:-perps-funding-payments.md): Subscribe to the \`fundingPaymentsPerps\` channel. Requires authentication (login first). - \[Subscribe: Perps Liquidation\](https://docs.ondoperps.xyz/api-reference/private-channels/subscribe:-perps-liquidation.md): Subscribe to the \`liquidationPerps\` channel. Requires authentication (login first). - \[Subscribe: Perps Liquidation Announcements\](https://docs.ondoperps.xyz/api-reference/private-channels/subscribe:-perps-liquidation-announcements.md): Subscribe to the \`liquidationAnnouncementsPerps\` channel. Requires authentication (login first). - \[Subscribe: Perps Margin Transfers\](https://docs.ondoperps.xyz/api-reference/private-channels/subscribe:-perps-margin-transfers.md): Subscribe to the \`marginTransfersPerps\` channel. Requires authentication (login first). - \[Subscribe: Perps Order Summaries\](https://docs.ondoperps.xyz/api-reference/private-channels/subscribe:-perps-order-summaries.md): Subscribe to the \`ordersSummariesPerps\` channel. Requires authentication (login first). - \[Subscribe: Perps Orders\](https://docs.ondoperps.xyz/api-reference/private-channels/subscribe:-perps-orders.md): Subscribe to the \`ordersPerps\` channel. Requires authentication (login first). - \[Subscribe: Perps Positions\](https://docs.ondoperps.xyz/api-reference/private-channels/subscribe:-perps-positions.md): Subscribe to the \`positionsPerps\` channel. Requires authentication (login first). - \[Subscribe: Withdrawals\](https://docs.ondoperps.xyz/api-reference/private-channels/subscribe:-withdrawals.md): Subscribe to the \`withdrawals\` channel. Requires authentication (login first). - \[Subscribe: Perps Depth Book\](https://docs.ondoperps.xyz/api-reference/public-channels/subscribe:-perps-depth-book.md): Subscribe to the \`depthBooksPerps\` channel. - \[Subscribe: Perps Funding Rates\](https://docs.ondoperps.xyz/api-reference/public-channels/subscribe:-perps-funding-rates.md): Subscribe to the \`fundingRatesPerps\` channel. - \[Subscribe: Perps Kline / Candlesticks\](https://docs.ondoperps.xyz/api-reference/public-channels/subscribe:-perps-kline-candlesticks.md): Subscribe to the \`kLinePerps\` channel. - \[Subscribe: Perps Mark Prices\](https://docs.ondoperps.xyz/api-reference/public-channels/subscribe:-perps-mark-prices.md): Subscribe to the \`markPricesPerps\` channel. - \[Subscribe: Perps Top of Book\](https://docs.ondoperps.xyz/api-reference/public-channels/subscribe:-perps-top-of-book.md): Subscribe to the \`topOfBooksPerps\` channel. - \[Subscribe: Perps Trades\](https://docs.ondoperps.xyz/api-reference/public-channels/subscribe:-perps-trades.md): Subscribe to the \`tradesPerps\` channel. - \[Sandbox Deposit\](https://docs.ondoperps.xyz/api-reference/sandbox/sandbox-deposit.md): Credits the account with funds in sandbox environment only. - \[Sandbox Withdrawal\](https://docs.ondoperps.xyz/api-reference/sandbox/sandbox-withdrawal.md): Debits the account in sandbox environment only. - \[Get Stop Orders\](https://docs.ondoperps.xyz/api-reference/stop-orders/get-stop-orders.md): Gets a list of all stop orders for all markets. This section covers Position-Level stop orders only (take-profit and stop-loss attached to open positions). For TP/SL attached to limit orders, see the order creation payload (takeProfit, stopLoss, etc.). For how stop orders work, see \[Take profit and…\ - \[Remove Stop Order\](https://docs.ondoperps.xyz/api-reference/stop-orders/remove-stop-order.md): Remove a stop order. If no type is specified, removes both stop loss and take profit. For how stop orders work, see \[Take profit and stop loss\](/take-profit-and-stop-loss).\ - \[Set Stop Order\](https://docs.ondoperps.xyz/api-reference/stop-orders/set-stop-order.md): Set a stop order for a particular position defined by market and direction. For how stop orders work, see \[Take profit and stop loss\](/take-profit-and-stop-loss).\ - \[Get Status\](https://docs.ondoperps.xyz/api-reference/tool/get-status.md): Returns public API and system status.\ - \[Hello\](https://docs.ondoperps.xyz/api-reference/tool/hello.md): Simple health check. Returns a static JSON payload.\ - \[Cancel TWAP Order\](https://docs.ondoperps.xyz/api-reference/twap-orders/cancel-twap-order.md): Cancels a running TWAP order. Child orders already placed are not affected. For how TWAP execution works, see \[TWAP orders\](/time-weighted-average-price).\ - \[Create TWAP Order\](https://docs.ondoperps.xyz/api-reference/twap-orders/create-twap-order.md): Creates a new TWAP (Time-Weighted Average Price) order. The order is split into child orders placed at regular intervals over the specified running time. Running time must be between 5 minutes and 24 hours and a multiple of the frequency. The number of child orders (runningTime / frequency) must be…\ - \[Get Running TWAP Orders\](https://docs.ondoperps.xyz/api-reference/twap-orders/get-running-twap-orders.md): Returns all currently running TWAP orders for the authenticated account. Optionally filter by market. For how TWAP execution works, see \[TWAP orders\](/time-weighted-average-price).\ - \[Get TWAP Order by ID\](https://docs.ondoperps.xyz/api-reference/twap-orders/get-twap-order-by-id.md): Returns a single TWAP order by its ID. For how TWAP execution works, see \[TWAP orders\](/time-weighted-average-price).\ - \[Get TWAP Order Fills\](https://docs.ondoperps.xyz/api-reference/twap-orders/get-twap-order-fills.md): Returns all fills for all child orders of a TWAP order. For how TWAP execution works, see \[TWAP orders\](/time-weighted-average-price).\ - \[Get TWAP Order History\](https://docs.ondoperps.xyz/api-reference/twap-orders/get-twap-order-history.md): Returns a paginated list of completed or cancelled TWAP orders for the authenticated account. For how TWAP execution works, see \[TWAP orders\](/time-weighted-average-price).\ - \[Edit Address Book Entry\](https://docs.ondoperps.xyz/api-reference/wallet/edit-address-book-entry.md): Update label for a withdrawal address.\ - \[Export Deposits CSV\](https://docs.ondoperps.xyz/api-reference/wallet/export-deposits-csv.md): Exports the account's deposit history as a downloadable CSV for the given time range. Columns: \`id\`, \`time\` (RFC 3339, UTC), \`coin\`, \`size\`, \`status\`. For supported assets and deposit steps, see \[Funding your account\](/funding-your-account).\ - \[Export Withdrawals CSV\](https://docs.ondoperps.xyz/api-reference/wallet/export-withdrawals-csv.md): Exports the account's withdrawal history as a downloadable CSV for the given time range. Columns: \`time\` (RFC 3339, UTC), \`coin\`, \`size\`, \`address\`, \`status\`. For the withdrawal process and timing, see \[Withdrawals\](/withdrawals).\ - \[Get Address Book\](https://docs.ondoperps.xyz/api-reference/wallet/get-address-book.md): Returns withdrawal address book entries for the authenticated account.\ - \[Get Deposit by ID\](https://docs.ondoperps.xyz/api-reference/wallet/get-deposit-by-id.md): Returns a single deposit by transaction ID. For supported assets and deposit steps, see \[Funding your account\](/funding-your-account).\ - \[Get Withdrawal by ID\](https://docs.ondoperps.xyz/api-reference/wallet/get-withdrawal-by-id.md): Returns a single withdrawal by transaction ID. For the withdrawal process and timing, see \[Withdrawals\](/withdrawals).\ - \[Get Withdrawal Limits\](https://docs.ondoperps.xyz/api-reference/wallet/get-withdrawal-limits.md): Returns withdrawal limits for the authenticated account. For the withdrawal process and timing, see \[Withdrawals\](/withdrawals).\ - \[Get Withdrawal Status\](https://docs.ondoperps.xyz/api-reference/wallet/get-withdrawal-status.md): Get status of one or more withdrawals. For the withdrawal process and timing, see \[Withdrawals\](/withdrawals).\ - \[List Deposit Addresses\](https://docs.ondoperps.xyz/api-reference/wallet/list-deposit-addresses.md): Returns the list of deposit addresses for the account. For supported assets and deposit steps, see \[Funding your account\](/funding-your-account).\ - \[List Deposits\](https://docs.ondoperps.xyz/api-reference/wallet/list-deposits.md): Returns deposit history for the authenticated account. For supported assets and deposit steps, see \[Funding your account\](/funding-your-account).\ - \[List Withdrawals\](https://docs.ondoperps.xyz/api-reference/wallet/list-withdrawals.md): Returns withdrawal history for the authenticated account. For the withdrawal process and timing, see \[Withdrawals\](/withdrawals).\ - \[Provision Deposit Address\](https://docs.ondoperps.xyz/api-reference/wallet/provision-deposit-address.md): Provision a new deposit address for a given symbol/chain. For supported assets and deposit steps, see \[Funding your account\](/funding-your-account).\ - \[Remove Address Book Entry\](https://docs.ondoperps.xyz/api-reference/wallet/remove-address-book-entry.md): Remove a withdrawal address from the address book.\ - \[Withdraw\](https://docs.ondoperps.xyz/api-reference/wallet/withdraw.md): Submit a withdrawal request. Rate limited per account. For the withdrawal process and timing, see \[Withdrawals\](/withdrawals).\ - \[Architecture\](https://docs.ondoperps.xyz/architecture.md)\ - \[Auto-Deleveraging (ADL)\](https://docs.ondoperps.xyz/auto-deleveraging.md)\ - \[Collateral Management\](https://docs.ondoperps.xyz/collateral-management.md)\ - \[Collateral Value\](https://docs.ondoperps.xyz/collateral-value.md)\ - \[Contact\](https://docs.ondoperps.xyz/contact.md)\ - \[Liquidations and Insurance\](https://docs.ondoperps.xyz/def.md)\ - \[Fees\](https://docs.ondoperps.xyz/fees.md)\ - \[Funding Rates\](https://docs.ondoperps.xyz/funding-rates.md)\ - \[Funding Your Account\](https://docs.ondoperps.xyz/funding-your-account.md)\ - \[Key Trading Concepts\](https://docs.ondoperps.xyz/key-trading-concepts.md)\ - \[Leverage\](https://docs.ondoperps.xyz/leverage.md)\ - \[Mark Price Protection\](https://docs.ondoperps.xyz/mark-price-protection.md)\ - \[Markets\](https://docs.ondoperps.xyz/markets.md)\ - \[Order Types\](https://docs.ondoperps.xyz/order-types.md)\ - \[Overview\](https://docs.ondoperps.xyz/overview.md)\ - \[Perpetual Futures\](https://docs.ondoperps.xyz/perpetual-futures.md)\ - \[Placing Your First Order\](https://docs.ondoperps.xyz/placing-your-first-order.md)\ - \[Positions, Balances, and Leverage\](https://docs.ondoperps.xyz/positions-balances.md)\ - \[Positions Panel\](https://docs.ondoperps.xyz/positions-panel.md)\ - \[Premium Index\](https://docs.ondoperps.xyz/premium-index.md)\ - \[External Pricing Derivations\](https://docs.ondoperps.xyz/pricing-derivations.md)\ - \[Profit & Loss\](https://docs.ondoperps.xyz/profit-and-loss.md)\ - \[Public Beta \](https://docs.ondoperps.xyz/public-beta.md)\ - \[Measuring Risk\](https://docs.ondoperps.xyz/risk-measures.md)\ - \[Settlement\](https://docs.ondoperps.xyz/settlement.md)\ - \[Take Profit / Stop Loss \](https://docs.ondoperps.xyz/take-profit-and-stop-loss.md)\ - \[Technology\](https://docs.ondoperps.xyz/technology.md)\ - \[TWAP\](https://docs.ondoperps.xyz/time-weighted-average-price.md)\ - \[Weekend Mechanics\](https://docs.ondoperps.xyz/weekend-mechanics.md)\ - \[Weekend and Extended Hours Trading\](https://docs.ondoperps.xyz/weekend-trading.md)\ - \[Withdrawals\](https://docs.ondoperps.xyz/withdrawals.md)\ \ ## OpenAPI Specs\ \ - \[rest-spec\](https://docs.ondoperps.xyz/api-reference/rest-spec.json)\ - \[ws-spec\](https://docs.ondoperps.xyz/api-reference/ws-spec.json)\ - \[gm-be-api-spec\](https://docs.ondoperps.xyz/gm-be-api-spec.json)\ - \[openapi\](https://docs.ondoperps.xyz/api-reference/openapi.json)\ \ ## Optional\ \ - \[Ondo Perps Website\](https://ondoperps.xyz) --- # API Key Authentication - Ondo Perps > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/llms.txt](https://ondoperps.mintlify.app/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://ondoperps.mintlify.app/api-reference/api_key_authentication#content-area) [​](https://ondoperps.mintlify.app/api-reference/api_key_authentication#generating-an-api-key) Generating an API Key ----------------------------------------------------------------------------------------------------------------------- To generate an API Key 1. Sign into your account with a web browser 2. Click on your address in the upper right corner 3. Click **API Keys** 4. Click **Add New API Key** 5. Name the key 6. Select the correct permissions 7. Click **Create API Key** 8. Record the secret key The secret key should be treated the same way as a password and not stored in an unencrypted manner. Place it in a password manager or key vault. ### [​](https://ondoperps.mintlify.app/api-reference/api_key_authentication#ip-whitelisting) IP Whitelisting It is strongly recommended to whitelist the IP addresses which are allowed to make requests for the given API key. Up to 16 IP addresses can be added per API key. Only IPv4 addresses are supported at this time. The default state with no whitelisted addresses (empty whitelist) is to allow requests from any IP. If there are addresses on the whitelist, then only requests from the whitelisted IPs are allowed. Requests from IPs not on the whitelist will error with code 401 and message: `"IP addr x.x.x.x is not allowed for key ondoKeyId_yyyyyyyy"`. [​](https://ondoperps.mintlify.app/api-reference/api_key_authentication#making-an-authenticated-rest-request) Making an Authenticated REST Request ----------------------------------------------------------------------------------------------------------------------------------------------------- Authenticated REST requests need the following headers: * `ONDO-KEY-ID` The key id (including the “ondoKeyId\_” prefix) * `ONDO-TIMESTAMP` Number of milliseconds since the Unix epoch, this must be within 30 seconds of the time the request is received. * `ONDO-SIGN` hex representation of SHA256 HMAC of the following four strings concatenated together using the API Secret (including the “ondoApiSecret\_” prefix). * `timestamp` identical to the ONDO-TIMESTAMP header * `method` HTTP method in uppercase * `requestPath` full path and query parameters of the URL, excluding the hostname * `body` request body string [​](https://ondoperps.mintlify.app/api-reference/api_key_authentication#error-codes) Error Codes --------------------------------------------------------------------------------------------------- Requests made through API key authentication can fail with the following error codes: * `api_key_not_found` — The API key provided could not be found. * `failed_to_parse_timestamp` — The timestamp provided could not be parsed. * `timestamp_too_far` — The timestamp is too far from the server timestamp (more than 30 seconds in the past or future) * `failed_to_decode_hex_signature` — The hex signature could not be decoded. * `signature_mismatch` — There is a mismatch in the signature. * `key_doesnt_have_scope` — The API key does not have the required scope for the endpoint. * `ip_not_permitted` — The IP address making the request is not whitelisted for this API key. [​](https://ondoperps.mintlify.app/api-reference/api_key_authentication#example-in-go) Example in Go ------------------------------------------------------------------------------------------------------- package main import ( "crypto/hmac" "crypto/sha256" "encoding/hex" "fmt" "io" "net/http" "strings" "time" ) func main() { keyId := "ondoKeyId_KEYID" apiSecret := "ondoApiSecret_SECRET" method := "GET" base := "https://api.ondoperps.xyz" path := "/v1/perps/orders?market=AAPL-USD.P&limit=1000" body := "" req, _ := http.NewRequest(method, base+path, strings.NewReader(body)) timestamp := fmt.Sprintf("%d", time.Now().UnixMilli()) // Ensure path contains query params `?market=AVAX-USDC&limit=1000`. concattedString := timestamp + method + path + body mac := hmac.New(sha256.New, []byte(apiSecret)) mac.Write([]byte(concattedString)) sig := mac.Sum(nil) req.Header.Set("ONDO-KEY-ID", keyId) req.Header.Set("ONDO-TIMESTAMP", timestamp) req.Header.Set("ONDO-SIGN", hex.EncodeToString(sig)) res, err := http.DefaultClient.Do(req) if err != nil { fmt.Printf("http err: %s", err) return } data, _ := io.ReadAll(res.Body) fmt.Printf("Status: %s, Body: %s", res.Status, data) } Note: in Go, `req.URL.RequestURI()` contains the query parameters and should be used, whereas `req.URL.Path` does not. [​](https://ondoperps.mintlify.app/api-reference/api_key_authentication#example-in-python) Example in Python --------------------------------------------------------------------------------------------------------------- import hmac import hashlib import time import requests key_id = "ondoKeyId_KEYID" api_secret = "ondoApiSecret_SECRET" method = "GET" base = "https://api.ondoperps.xyz" path = "/v1/perps/orders?market=AAPL-USD.P&limit=1000" body = "" url = base + path timestamp = str(int(time.time() * 1000)) # Ensure path contains query params `?market=AAPL-USD.P&limit=1000` concatted_string = timestamp + method + path + body mac = hmac.new(api_secret.encode(), concatted_string.encode(), hashlib.sha256) signature = mac.hexdigest() headers = { "ONDO-KEY-ID": key_id, "ONDO-TIMESTAMP": timestamp, "ONDO-SIGN": signature } response = requests.get(url, headers=headers) print(f"Status: {response.status_code}, Body: {response.text}") [Builder Integration Guide](https://ondoperps.mintlify.app/api-reference/integration_guide) Ctrl+I --- # Index - Ondo Perps > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/llms.txt](https://ondoperps.mintlify.app/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://ondoperps.mintlify.app/#content-area) Access Restricted The content you are trying to access is not available in your region. Ondo Perps is not offered to persons in the United States or other restricted jurisdictions. --- # Welcome to Ondo Perps - Ondo Perps > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/llms.txt](https://ondoperps.mintlify.app/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://ondoperps.mintlify.app/about#content-area) Access Restricted The content you are trying to access is not available in your region. Ondo Perps is not offered to persons in the United States or other restricted jurisdictions. --- # Builder Integration Guide - Ondo Perps > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/llms.txt](https://ondoperps.mintlify.app/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://ondoperps.mintlify.app/api-reference/integration_guide#content-area) > **Full API reference:** [Ondoperps API Documentation](https://ondoperps.mintlify.app/) > 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. ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#how-it-works) 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. ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#integration-flow) Integration Flow 1. Connect wallet → User approves wallet connection 2. SIWE auth → User signs challenge, your app gets a JWT 3. Accept TOS → First login only 4. Deposit USDC → On-chain transfer (production only; sandbox uses demo funds) 5. Place orders → REST call with builderCode on every order 6. Earn fees → Incremental fees credited per fill * * * [​](https://ondoperps.mintlify.app/api-reference/integration_guide#step-1-prerequisites) 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](http://app.ondoperps-sandbox.xyz/) and get your account ID 2. Contact the Ondo Perps team at [**builders@ondoperps.xyz**](mailto: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:** | Environment | REST API | WebSocket | | --- | --- | --- | | Sandbox | `https://api.ondoperps-sandbox.xyz` | `wss://api.ondoperps-sandbox.xyz/ws` | | Production | `https://api.ondoperps.xyz` | `wss://api.ondoperps.xyz/ws` | * * * [​](https://ondoperps.mintlify.app/api-reference/integration_guide#step-2-set-up-your-client) Step 2: Set Up Your Client --------------------------------------------------------------------------------------------------------------------------- const provider = window.ethereum // Sandbox base URL. For production, use 'api.ondoperps.xyz' const ondoBase = 'api.ondoperps-sandbox.xyz' const ondoUrl = `https://${ondoBase}` // Market to test. Format: {TICKER}-USD.P // Available markets include: XAU-USD.P, NVDA-USD.P, QQQ-USD.P, AMD-USD.P const testMarket = 'XAU' ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#helper-methods) Helper Methods All authenticated endpoints require `Authorization: Bearer {jwtToken}`. Define these helpers once. const parseResponse = (data) => { if (!data.success) { throw new Error(`Request failed: ${JSON.stringify(data)} (code: ${data.error_code})`) } return data.result } const fetchPost = async (endpoint, data) => { return fetch(`${ondoUrl}${endpoint}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data), }) .then(response => response.json()) .then(data => parseResponse(data)) } let jwtToken = '' const fetchAuthPost = async (endpoint, data) => { return fetch(`${ondoUrl}${endpoint}`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${jwtToken}`, }, body: JSON.stringify(data), }) .then(response => response.json()) .then(data => parseResponse(data)) } const fetchAuthGet = async (endpoint) => { return fetch(`${ondoUrl}${endpoint}`, { method: 'GET', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${jwtToken}`, }, }) .then(response => response.json()) .then(data => parseResponse(data)) } * * * [​](https://ondoperps.mintlify.app/api-reference/integration_guide#step-3-authenticate-siwe) Step 3: Authenticate (SIWE) --------------------------------------------------------------------------------------------------------------------------- Ondo Perps uses Sign In With Ethereum ([ERC-4361](https://eips.ethereum.org/EIPS/eip-4361) ). The user signs a challenge with their wallet. Your app receives a JWT for all subsequent requests. ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#3a-connect-wallet) 3a. Connect Wallet Auth must happen on Ethereum mainnet, regardless of which chain the user deposits on later. // Ensure wallet is on Ethereum mainnet let chainId = await ethereum.request({ method: 'eth_chainId' }) if (chainId !== '0x1') { await window.ethereum.request({ method: 'wallet_switchEthereumChain', params: [{ chainId: '0x1' }], }) } // Request the user's account const accounts = await provider.request({ method: 'eth_requestAccounts' }) const from = accounts[0] ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#3b-define-the-siwe-signing-function) 3b. Define the SIWE Signing Function const siweSign = async (siweMessage) => { const bytes = new TextEncoder().encode(siweMessage) const hex = Array.from(bytes, byte => byte.toString(16).padStart(2, '0')).join('') const msg = `0x${hex}` return await provider.request({ method: 'personal_sign', params: [msg, from], }) } ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#3c-request-and-sign-the-challenge) 3c. Request and Sign the Challenge // Optionally pass builderCode to embed builder data into the JWT. // Builder code information will then be passed automatically in all requests. const getChallengeData = { walletAddress: from, chainId: '1', builderCode: "" } const challenge = await fetchPost('/v1/auth/erc-4361/login/get_challenge', getChallengeData) const signedMessage = await siweSign(challenge.message) The response includes `challenge.id` and `challenge.message`, which you pass to the next two steps. ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#3d-complete-the-challenge-and-get-your-jwt) 3d. Complete the Challenge and Get Your JWT const completeChallengeData = { id: challenge.id, signature: signedMessage } const completeChallenge = await fetchPost('/v1/auth/erc-4361/login/complete_challenge', completeChallengeData) jwtToken = completeChallenge.token ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#3e-accept-terms-first-login-only) 3e. Accept Terms (First Login Only) await fetchAuthPost('/v1/agreement', { termsVersion: 1, privacyVersion: 1, }) * * * [​](https://ondoperps.mintlify.app/api-reference/integration_guide#step-4-deposit-usdc) Step 4: Deposit USDC --------------------------------------------------------------------------------------------------------------- ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#sandbox) Sandbox In sandbox, regular deposit flow is optional. You can click through the deposit flow in the [sandbox frontend](https://app.ondoperps-sandbox.xyz/) . No real funds are needed. Once your account is funded, skip to Step 5: Place Orders. ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#production) 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. // Get your account ID const accountData = await fetchAuthGet('/v1/account') const accountID = accountData.accountID // Request a deposit address const provisionAddressReq = { symbol: 'USDC', deposit_destination: { id: accountID, wallet: 'margin', }, network: 'ethereum', // also supports: solana, avalanche } const provisioned = await fetchAuthPost('/v1/provision_address', provisionAddressReq) const depositAddress = provisioned.address // Switch to the deposit chain (Sepolia for testnet, mainnet for production) await window.ethereum.request({ method: 'wallet_switchEthereumChain', params: [{ chainId: '0xAA36A7' }], // Sepolia testnet }) // Send ERC-20 transfer: 50 USDC to the provisioned deposit address // 0xa9059cbb = transfer(address,uint256) selector // 0x02faf080 = 50,000,000 (50 USDC with 6 decimals) const depositNoPrefix = depositAddress.replace(/^0x/i, '') const sent_tx = await window.ethereum.request({ method: 'eth_sendTransaction', params: [{\ to: '0x94a9D9AC8a22534E3FaCa9F4e7F2E2cf85d5E4C8', // Sepolia USDC contract\ from: from,\ data: `0xa9059cbb000000000000000000000000${depositNoPrefix}0000000000000000000000000000000000000000000000000000000002faf080`,\ }], }) // Poll for transaction confirmation for (;;) { const tx = await window.ethereum.request({ method: 'eth_getTransactionByHash', params: [sent_tx], }) if (tx.blockHash && tx.blockHash !== '') { break } // Wait 2 seconds between polls to avoid rate limiting await new Promise(resolve => setTimeout(resolve, 2000)) } console.log('Deposit confirmed on-chain') **Test funds (Sepolia):** * USDC faucet: [gho.aave.com/faucet](http://gho.aave.com/faucet) * ETH faucet: [sepolia-faucet.pk910.de](http://sepolia-faucet.pk910.de/) * * * [​](https://ondoperps.mintlify.app/api-reference/integration_guide#step-5-place-orders) 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](https://www.notion.so/Perps-REST-API-2ff278059c7f8199b12ef2f7e04e59ca?pvs=21) for the full order schema, batch orders, and cancellation. ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#market-order) Market Order // Optionally pass builderCode.feeRateBps to set desired fees for this order // (in bps; must be a positive int number) // Optionally pass builderCode.code to set builder code if it was not passed to // GetChallenge const marketOrderReq = { market: `${testMarket}-USD.P`, type: 'market', side: 'sell', size: '0.01', builderCode: { feeRateBps: 1, code: 'yourCode' } } const placedMarketOrder = await fetchAuthPost('/v1/perps/orders', marketOrderReq) The response includes `orderId`, `market`, `type`, `side`, `size`, `status`, and `createdAt`. See the [Perps REST API](https://www.notion.so/Perps-REST-API-2ff278059c7f8199b12ef2f7e04e59ca?pvs=21) for the full response schema. ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#check-order-status) Check Order Status const orderDetails = await fetchAuthGet(`/v1/perps/orders/${placedMarketOrder.orderId}`) ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#check-positions) Check Positions const positions = await fetchAuthGet('/v1/perps/positions') ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#limit-order) Limit Order const limitOrderReq = { market: `${testMarket}-USD.P`, type: 'limit', side: 'buy', price: '5280', size: '0.02', } const placedLimitOrder = await fetchAuthPost('/v1/perps/orders', limitOrderReq) 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. * * * [​](https://ondoperps.mintlify.app/api-reference/integration_guide#step-6-optional--charting-data) Step 6 (Optional): Charting Data -------------------------------------------------------------------------------------------------------------------------------------- Fetch chart data for TradingView or any charting library. This endpoint does not require authentication. const fetchHistory = async (endpoint) => { return fetch(`${ondoUrl}${endpoint}`, { method: 'GET', headers: { 'Content-Type': 'application/json' }, }).then(response => response.json()) } const ts = Math.floor(Date.now() / 1000) const history = await fetchHistory( `/v1/perps/history?symbol=${testMarket}USD.P&resolution=15&to=${ts}&countback=2` ) * * * [​](https://ondoperps.mintlify.app/api-reference/integration_guide#step-7-optional--websockets) Step 7 (Optional): WebSockets -------------------------------------------------------------------------------------------------------------------------------- Subscribe to real-time price updates via WebSocket. const wss = new WebSocket(`wss://${ondoBase}/ws`) wss.addEventListener('message', (event) => { const data = event.data const obj = JSON.parse(data) switch (obj.type) { case 'pong': console.log('pong received') break case 'subscribed': console.log(`subscribed: ${data}`) break case 'update': console.log(`update: ${data}`) break default: console.error(`unexpected message: ${data}`) } }) wss.addEventListener('open', () => { console.log('connected to WS') // Send pings every 1 second to keep the connection alive let pingInterval = setInterval(() => { const ping = { op: 'ping', id: window.crypto.randomUUID(), } wss.send(JSON.stringify(ping)) }, 1000) // Subscribe to mark price updates const markPriceSub = { op: 'subscribe', channel: 'markPricesPerps', markets: [`${testMarket}-USD.P`], } wss.send(JSON.stringify(markPriceSub)) }) See the [WebSocket API docs](https://www.notion.so/Common-WebSocket-API-2ff278059c7f81c9ac10c8ffeb8b64dc?pvs=21) for all available channels and message formats. * * * [​](https://ondoperps.mintlify.app/api-reference/integration_guide#sandbox-vs-production) Sandbox vs Production ------------------------------------------------------------------------------------------------------------------ | | Sandbox | Production | | --- | --- | --- | | REST API | `https://api.ondoperps-sandbox.xyz` | `https://api.ondoperps.xyz` | | WebSocket | `wss://api.ondoperps-sandbox.xyz/ws` | `wss://api.ondoperps.xyz/ws` | | Frontend | `https://app.ondoperps-sandbox.xyz` | `https://app.ondoperps.xyz` | | Funds | Demo funds (no real money) | Real USDC deposits | | Auth chain | Ethereum mainnet | Ethereum mainnet | | Endpoints | Same | Same | All endpoints work identically in both environments. Change the base URL and deposit flow, everything else stays the same. * * * [​](https://ondoperps.mintlify.app/api-reference/integration_guide#full-example) Full Example ------------------------------------------------------------------------------------------------ Copy-paste the entire integration in one block. Mirrors Steps 2-7 above. ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#main-flow) Main Flow // --- Step 2: Setup --- const provider = window.ethereum const ondoBase = 'api.ondoperps-sandbox.xyz' const ondoUrl = `https://${ondoBase}` const testMarket = 'XAU' const parseResponse = (data) => { if (!data.success) { throw new Error(`Request failed: ${JSON.stringify(data)} (code: ${data.error_code})`) } return data.result } const fetchPost = async (endpoint, data) => { return fetch(`${ondoUrl}${endpoint}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data), }) .then(response => response.json()) .then(data => parseResponse(data)) } let jwtToken = '' const fetchAuthPost = async (endpoint, data) => { return fetch(`${ondoUrl}${endpoint}`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${jwtToken}`, }, body: JSON.stringify(data), }) .then(response => response.json()) .then(data => parseResponse(data)) } const fetchAuthGet = async (endpoint) => { return fetch(`${ondoUrl}${endpoint}`, { method: 'GET', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${jwtToken}`, }, }) .then(response => response.json()) .then(data => parseResponse(data)) } // --- Step 3: Authenticate (SIWE) --- let chainId = await ethereum.request({ method: 'eth_chainId' }) if (chainId !== '0x1') { await window.ethereum.request({ method: 'wallet_switchEthereumChain', params: [{ chainId: '0x1' }], }) } const accounts = await provider.request({ method: 'eth_requestAccounts' }) const from = accounts[0] const siweSign = async (siweMessage) => { const bytes = new TextEncoder().encode(siweMessage) const hex = Array.from(bytes, byte => byte.toString(16).padStart(2, '0')).join('') const msg = `0x${hex}` return await provider.request({ method: 'personal_sign', params: [msg, from], }) } const getChallengeData = { walletAddress: from, chainId: '1', builderCode: "" } const challenge = await fetchPost('/v1/auth/erc-4361/login/get_challenge', getChallengeData) const signedMessage = await siweSign(challenge.message) const completeChallengeData = { id: challenge.id, signature: signedMessage, } const completeChallenge = await fetchPost('/v1/auth/erc-4361/login/complete_challenge', completeChallengeData) jwtToken = completeChallenge.token // Accept terms (first login only) await fetchAuthPost('/v1/agreement', { termsVersion: 1, privacyVersion: 1, }) // --- Step 4: Deposit --- // Get your account ID const accountData = await fetchAuthGet('/v1/account') const accountID = accountData.accountID // Request a deposit address const provisionAddressReq = { symbol: 'USDC', deposit_destination: { id: accountID, wallet: 'margin', }, network: 'ethereum', // also supports: solana, avalanche } const provisioned = await fetchAuthPost('/v1/provision_address', provisionAddressReq) const depositAddress = provisioned.address // Switch to the deposit chain (Sepolia for testnet, mainnet for production) await window.ethereum.request({ method: 'wallet_switchEthereumChain', params: [{ chainId: '0xAA36A7' }], // Sepolia testnet }) // Send ERC-20 transfer: 50 USDC to the provisioned deposit address // 0xa9059cbb = transfer(address,uint256) selector // 0x02faf080 = 50,000,000 (50 USDC with 6 decimals) const depositNoPrefix = depositAddress.replace(/^0x/i, '') const sent_tx = await window.ethereum.request({ method: 'eth_sendTransaction', params: [{\ to: '0x94a9D9AC8a22534E3FaCa9F4e7F2E2cf85d5E4C8', // Sepolia USDC contract\ from: from,\ data: `0xa9059cbb000000000000000000000000${depositNoPrefix}0000000000000000000000000000000000000000000000000000000002faf080`,\ }], }) // Poll for transaction confirmation for (;;) { const tx = await window.ethereum.request({ method: 'eth_getTransactionByHash', params: [sent_tx], }) if (tx.blockHash && tx.blockHash !== '') { break } // Wait 2 seconds between polls to avoid rate limiting await new Promise(resolve => setTimeout(resolve, 2000)) } console.log('Deposit confirmed on-chain') // --- Step 5: Place Orders --- const marketOrderReq = { market: `${testMarket}-USD.P`, type: 'market', side: 'sell', size: '0.01', } const placedMarketOrder = await fetchAuthPost('/v1/perps/orders', marketOrderReq) const orderDetails = await fetchAuthGet(`/v1/perps/orders/${placedMarketOrder.orderId}`) const positions = await fetchAuthGet('/v1/perps/positions') // Uncomment to place a limit order: // const limitOrderReq = { // market: `${testMarket}-USD.P`, // type: 'limit', // side: 'buy', // price: '5280', // size: '0.02', // } // const placedLimitOrder = await fetchAuthPost('/v1/perps/orders', limitOrderReq) // --- Step 6: Charting Data --- const fetchHistory = async (endpoint) => { return fetch(`${ondoUrl}${endpoint}`, { method: 'GET', headers: { 'Content-Type': 'application/json' }, }).then(response => response.json()) } const ts = Math.floor(Date.now() / 1000) const history = await fetchHistory( `/v1/perps/history?symbol=${testMarket}USD.P&resolution=15&to=${ts}&countback=2` ) ### [​](https://ondoperps.mintlify.app/api-reference/integration_guide#websockets) WebSockets const ondoBase = 'api.ondoperps-sandbox.xyz' const testMarket = 'XAU' const wss = new WebSocket(`wss://${ondoBase}/ws`) wss.addEventListener('message', (event) => { const data = event.data const obj = JSON.parse(data) switch (obj.type) { case 'pong': console.log('pong received') break case 'subscribed': console.log(`subscribed: ${data}`) break case 'update': console.log(`update: ${data}`) break default: console.error(`unexpected message: ${data}`) } }) wss.addEventListener('open', () => { console.log('connected to WS') let pingInterval = setInterval(() => { const ping = { op: 'ping', id: window.crypto.randomUUID(), } wss.send(JSON.stringify(ping)) }, 1000) const markPriceSub = { op: 'subscribe', channel: 'markPricesPerps', markets: [`${testMarket}-USD.P`], } wss.send(JSON.stringify(markPriceSub)) }) * * * [​](https://ondoperps.mintlify.app/api-reference/integration_guide#changelog) Changelog ------------------------------------------------------------------------------------------ | Version | Date | Changes | | --- | --- | --- | | 1.0.0 | 2026-03-09 | Initial release. Sandbox-first guide with SIWE auth, deposit, order placement, charting, and WebSocket examples. | | 1.0.1 | 2026-03-18 | Added Updated API Docs | | 1.0.2 | 2026-03-20 | Added builder code in complete invite challenge path | | 1.0.3 | 2026-06-01 | Moved builderCode from complete\_challenge to get\_challenge | [API Key Authentication](https://ondoperps.mintlify.app/api-reference/api_key_authentication) [Get Status](https://ondoperps.mintlify.app/api-reference/tool/get-status) ⌘I --- # Architecture - Ondo Perps > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/llms.txt](https://ondoperps.mintlify.app/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://ondoperps.mintlify.app/architecture#content-area) Ondo Perps runs as an offchain matching engine with onchain settlement. The two are separate by design: the matching engine optimizes for speed and determinism; the settlement layer handles onchain asset custody. * * * [​](https://ondoperps.mintlify.app/architecture#the-three-components) The Three Components --------------------------------------------------------------------------------------------- ### [​](https://ondoperps.mintlify.app/architecture#exchange-engine) Exchange-Engine The Exchange-Engine housing the matching engine, account manager, order book, position tracking, and liquidation logic. It runs entirely offchain. When a user deposits or withdraws, the exchange-engine queries the chain-core for onchain state, it does not interact with the chain directly. #### [​](https://ondoperps.mintlify.app/architecture#chain-engine) Chain-Engine The chain-core is the onchain interface. It processes deposits and withdrawals: it watches for incoming onchain transfers, confirms them, and signals the exchange-engine to credit the account. For withdrawals, it executes the onchain transaction and pays gas on behalf of the user. The chain-core holds no knowledge of internal accounts. It sees only onchain addresses and transfer amounts sweeping deposits into the main hot wallet. #### [​](https://ondoperps.mintlify.app/architecture#attestor-network) Attestor Network The attestor network is the trust layer between the exchange-engine and the chain-core. It distributes the cryptographic secrets each component needs to operate, and serves as the consensus mechanism for blockchain state. Neither component can function fully without it. * * * [​](https://ondoperps.mintlify.app/architecture#execution-integrity) Execution Integrity ------------------------------------------------------------------------------------------- The matching engine runs inside an SGX (Software Guard Extensions) hardware enclave. SGX creates an isolated memory region that the operating system and the hardware owner cannot read or modify, including Ondo’s own infrastructure team. The enclave produces a cryptographic attestation proving it is running a specific, published binary. Reproducible builds ensure the binary is deterministic: the same source code produces the same binary every time, so the deployed code is independently verifiable against the published source. The attestation model removes operator trust as a variable. No party, including Ondo, can modify matching logic or access order state while the enclave is running. * * * [​](https://ondoperps.mintlify.app/architecture#deposit-and-withdrawal-flow) Deposit and Withdrawal Flow ----------------------------------------------------------------------------------------------------------- **Deposit:** 1. User sends USDC or a supported tokenized equity to their assigned deposit address onchain 2. No bridge required, standard ERC-20 transfer 3. Chain-core detects the transfer and notifies the exchange-engine 4. Exchange-engine credits the user’s margin wallet 5. The chain-core sweeps the deposit into its main hot wallet **Withdrawal:** 1. User requests withdrawal via API 2. Exchange-engine validates against available margin (cannot withdraw collateral backing open positions) 3. Chain-core executes the onchain transfer; Ondo pays gas 4. Withdrawal is marked as finalized when enough confirmations has been reached Ethereum is live. Additional chains are coming soon. Deposit addresses are chain-specific. * * * [​](https://ondoperps.mintlify.app/architecture#collateral-custody) Collateral Custody ----------------------------------------------------------------------------------------- The chain-core manages an omnibus account that holds collateral. Individual account balances are tracked offchain by the exchange-engine. There is no pooled smart contract governing user funds. The trust guarantee is the SGX attestation, a cryptographic proof that the running binary matches the published source, not onchain contract auditability. [Technology](https://ondoperps.mintlify.app/technology) [Markets](https://ondoperps.mintlify.app/markets) ⌘I --- # Technology - Ondo Perps > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/llms.txt](https://ondoperps.mintlify.app/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://ondoperps.mintlify.app/technology#content-area) Access Restricted The content you are trying to access is not available in your region. Ondo Perps is not offered to persons in the United States or other restricted jurisdictions. --- # Markets - Ondo Perps > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/llms.txt](https://ondoperps.mintlify.app/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://ondoperps.mintlify.app/markets#content-area) [​](https://ondoperps.mintlify.app/markets#supported-markets) Supported Markets ---------------------------------------------------------------------------------- All markets are USD-settled perpetual contracts denoted by the `.P` suffix in the market name. Default maximum position size is $500,000 per symbol, per account. For details on pricing outside of U.S. market hours see Weekend and Extended Hours Trading. ### [​](https://ondoperps.mintlify.app/markets#equity-perpetuals) Equity Perpetuals | **Market** | **Asset** | **Max Leverage** | | --- | --- | --- | | AAPL-USD.P | Apple | 20x | | AMD-USD.P | AMD | 10x | | AMZN-USD.P | Amazon | 10x | | COIN-USD.P | Coinbase | 10x | | CRCL-USD.P | Circle | 10x | | GOOGL-USD.P | Alphabet (Google) | 10x | | HOOD-USD.P | Robinhood | 10x | | INTC-USD.P | Intel | 10x | | META-USD.P | Meta | 10x | | MSFT-USD.P | Microsoft | 10x | | MSTR-USD.P | MicroStrategy | 10x | | MU-USD.P | Micron Technology | 5x | | NFLX-USD.P | Netflix | 10x | | NVDA-USD.P | NVIDIA | 10x | | ORCL-USD.P | Oracle | 10x | | PLTR-USD.P | Palantir | 10x | | SPCX-USD.P | SpaceX | 10x | | TSLA-USD.P | Tesla | 10x | ### [​](https://ondoperps.mintlify.app/markets#index-perpetuals) Index Perpetuals | **Market** | **Asset** | **Max Leverage** | | --- | --- | --- | | US500-USD.P | S&P 500 | 20x | | US100-USD.P | Nasdaq 100 | 20x | ### [​](https://ondoperps.mintlify.app/markets#commodity-perpetuals) Commodity Perpetuals | **Market** | **Asset** | **Max Leverage** | | --- | --- | --- | | XAU-USD.P | Gold | 20x | | XAG-USD.P | Silver | 20x | | WTI-USD.P | Crude Oil (WTI) | 20x | ### [​](https://ondoperps.mintlify.app/markets#etf-perpetuals) ETF Perpetuals | **Market** | **Asset** | **Max Leverage** | | --- | --- | --- | | DRAM-USD.P | Roundhill Memory ETF | 10x | [​](https://ondoperps.mintlify.app/markets#fees) Fees -------------------------------------------------------- | **Fee Type** | **Rate** | | --- | --- | | Maker | 0.015% | | Taker | 0.035% | [​](https://ondoperps.mintlify.app/markets#funding) Funding -------------------------------------------------------------- | **Parameter** | **Value** | | --- | --- | | Daily Interest Rate | 0.03% | | Funding Rate Cap | 1% per interval | | Funding Intervals | 8 per day | [​](https://ondoperps.mintlify.app/markets#holiday-schedule-2026-2027) Holiday Schedule (2026-2027) ------------------------------------------------------------------------------------------------------ Ondo Perps markets are open 24/7 but the underlying markets will be closed on the following dates. For details on pricing outside of U.S. market hours see Weekend and Extended Hours Trading. | **Date** | **Holiday** | **Status** | | --- | --- | --- | | 2026-04-03 | Good Friday | Closed | | 2026-05-25 | Memorial Day | Closed | | 2026-06-19 | Juneteenth | Closed | | 2026-07-03 | Independence Day (observed) | Closed | | 2026-09-07 | Labor Day | Closed | | 2026-11-26 | Thanksgiving | Closed | | 2026-11-27 | Day after Thanksgiving | Early close (1:00 PM ET) | | 2026-12-24 | Christmas Eve | Early close (1:00 PM ET) | | 2026-12-25 | Christmas | Closed | | 2027-01-01 | New Year’s Day | Closed | [Architecture](https://ondoperps.mintlify.app/architecture) [Public Beta](https://ondoperps.mintlify.app/public-beta) ⌘I --- # Public Beta - Ondo Perps > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/llms.txt](https://ondoperps.mintlify.app/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://ondoperps.mintlify.app/public-beta#content-area) Ondo Perps is now live in Public Beta. Qualifying users can now access the platform directly via the app. During the Public Beta, certain features and functionality may be subject to restrictions, limits, or changes. Reduced risk parameters are currently in place, and maximum position sizes are capped at $500,000 per market, per account. Tokenized Stock Collateral is currently available in Pre-Alpha on a limited-access basis. Traders may apply for access directly on the platform. During Public Beta, existing API keys remain active, but new API key creation is disabled by default. Traders may request access by emailing [**support@ondoperps.xyz**](mailto:support@ondoperps.xyz) . Frequent updates will be deployed during Public Beta. Platform availability may be briefly affected during scheduled or unscheduled maintenance windows. Safeguards are in place to minimize impact on traders. If any issues arise, please contact support. For any questions, feedback, or support, traders can reach us at **[support@ondoperps.xyz](mailto:support@ondoperps.xyz) .** For full terms and conditions, please see the **[Terms of Use](https://app.ondoperps.xyz/terms-of-use) .** [Markets](https://ondoperps.mintlify.app/markets) [Account Setup](https://ondoperps.mintlify.app/account-set-up) ⌘I --- # Get Status - Ondo Perps > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/llms.txt](https://ondoperps.mintlify.app/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://ondoperps.mintlify.app/api-reference/tool/get-status#content-area) Get Status cURL curl --request GET \ --url https://api.ondoperps.xyz/status import requestsurl = "https://api.ondoperps.xyz/status"response = requests.get(url)print(response.text) const options = {method: 'GET'};fetch('https://api.ondoperps.xyz/status', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); "https://api.ondoperps.xyz/status", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET",]);$response = curl_exec($curl);$err = curl_error($curl);curl_close($curl);if ($err) { echo "cURL Error #:" . $err;} else { echo $response;} package mainimport ( "fmt" "net/http" "io")func main() { url := "https://api.ondoperps.xyz/status" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body))} HttpResponse response = Unirest.get("https://api.ondoperps.xyz/status") .asString(); require 'uri'require 'net/http'url = URI("https://api.ondoperps.xyz/status")http = Net::HTTP.new(url.host, url.port)http.use_ssl = truerequest = Net::HTTP::Get.new(url)response = http.request(request)puts response.read_body 200 429 500 { "success": true, "result": { "marketStatus": "open" } } { "success": false, "error": "Description of the error", "error_code": "too_many_requests"} { "success": false, "error": "Description of the error", "error_code": "unknown"} GET / status Try it Get Status cURL curl --request GET \ --url https://api.ondoperps.xyz/status import requestsurl = "https://api.ondoperps.xyz/status"response = requests.get(url)print(response.text) const options = {method: 'GET'};fetch('https://api.ondoperps.xyz/status', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); "https://api.ondoperps.xyz/status", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET",]);$response = curl_exec($curl);$err = curl_error($curl);curl_close($curl);if ($err) { echo "cURL Error #:" . $err;} else { echo $response;} package mainimport ( "fmt" "net/http" "io")func main() { url := "https://api.ondoperps.xyz/status" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body))} HttpResponse response = Unirest.get("https://api.ondoperps.xyz/status") .asString(); require 'uri'require 'net/http'url = URI("https://api.ondoperps.xyz/status")http = Net::HTTP.new(url.host, url.port)http.use_ssl = truerequest = Net::HTTP::Get.new(url)response = http.request(request)puts response.read_body 200 429 500 { "success": true, "result": { "marketStatus": "open" } } { "success": false, "error": "Description of the error", "error_code": "too_many_requests"} { "success": false, "error": "Description of the error", "error_code": "unknown"} #### Response 200 application/json Status response [​](https://ondoperps.mintlify.app/api-reference/tool/get-status#response-success) success boolean required Whether the request was successful Example: `true` [​](https://ondoperps.mintlify.app/api-reference/tool/get-status#response-error) error string Error message, present only on failure Example: `""` [​](https://ondoperps.mintlify.app/api-reference/tool/get-status#response-error-code) error\_code string Semantic error code. See each endpoint's error responses for the specific codes it can return. [​](https://ondoperps.mintlify.app/api-reference/tool/get-status#response-deprecated) deprecated string Deprecation notice, if applicable Example: `""` [​](https://ondoperps.mintlify.app/api-reference/tool/get-status#response-result) result object Show child attributes [Builder Integration Guide](https://ondoperps.mintlify.app/api-reference/integration_guide) [Hello](https://ondoperps.mintlify.app/api-reference/tool/hello) ⌘I --- # Hello - Ondo Perps > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/llms.txt](https://ondoperps.mintlify.app/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://ondoperps.mintlify.app/api-reference/tool/hello#content-area) Hello cURL curl --request GET \ --url https://api.ondoperps.xyz/hello import requestsurl = "https://api.ondoperps.xyz/hello"response = requests.get(url)print(response.text) const options = {method: 'GET'};fetch('https://api.ondoperps.xyz/hello', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); "https://api.ondoperps.xyz/hello", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET",]);$response = curl_exec($curl);$err = curl_error($curl);curl_close($curl);if ($err) { echo "cURL Error #:" . $err;} else { echo $response;} package mainimport ( "fmt" "net/http" "io")func main() { url := "https://api.ondoperps.xyz/hello" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body))} HttpResponse response = Unirest.get("https://api.ondoperps.xyz/hello") .asString(); require 'uri'require 'net/http'url = URI("https://api.ondoperps.xyz/hello")http = Net::HTTP.new(url.host, url.port)http.use_ssl = truerequest = Net::HTTP::Get.new(url)response = http.request(request)puts response.read_body 200 429 500 { "hello": "world" } { "success": false, "error": "Description of the error", "error_code": "too_many_requests"} { "success": false, "error": "Description of the error", "error_code": "unknown"} Access Restricted The content you are trying to access is not available in your region. Ondo Perps is not offered to persons in the United States or other restricted jurisdictions. --- # Account Setup - Ondo Perps > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/llms.txt](https://ondoperps.mintlify.app/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://ondoperps.mintlify.app/account-set-up#content-area) Access Restricted The content you are trying to access is not available in your region. Ondo Perps is not offered to persons in the United States or other restricted jurisdictions. --- # Placing Your First Order - Ondo Perps > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/llms.txt](https://ondoperps.mintlify.app/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://ondoperps.mintlify.app/placing-your-first-order#content-area) Access Restricted The content you are trying to access is not available in your region. Ondo Perps is not offered to persons in the United States or other restricted jurisdictions. --- # Funding Your Account - Ondo Perps > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/llms.txt](https://ondoperps.mintlify.app/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://ondoperps.mintlify.app/funding-your-account#content-area) Access Restricted The content you are trying to access is not available in your region. Ondo Perps is not offered to persons in the United States or other restricted jurisdictions. ---