---
name: derive-api
description: Trade and query the Derive v3 exchange (self-custodial options, perps, and spot; trades settle on-chain via ZK proofs). Use when placing or cancelling orders, requesting RFQ quotes, reading market data, managing subaccounts and session keys, moving funds (deposits, transfers, withdrawals), or launching and operating vaults over JSON-RPC — served over both WebSocket and HTTP POST.
metadata:
  author: derive
  version: "1.0"
---

# Derive v3 API

The Derive Exchange is a low-latency derivatives exchange that settles trades and manages
risk on-chain via zero-knowledge proofs.

There are two primary ways of interacting with the Derive v3 API:
1. **HTTP or WS** — for programmatic access to the exchange. Use this for your trading system, vault, or app.
2. **Onchain TXs** - for deposits, multi-sig/contract owned accounts that want to send onchain actions (like setting session keys)

Full documentation: https://docs.derive.xyz

## Start with machine-readable resources (served from the docs base URL)
- LLM table of contents: https://docs.derive.xyz/llms.txt
- OpenAPI (HTTP + WS methods): https://docs.derive.xyz/openapi.json
- AsyncAPI (WS-only methods): https://docs.derive.xyz/websocket.asyncapi.json
- AsyncAPI (WS subscriptions): https://docs.derive.xyz/subscriptions.asyncapi.json
- Docs search MCP server: `search_derive_api` (see
  https://docs.derive.xyz/.well-known/mcp/server-card.json)
- LLM full dump: https://docs.derive.xyz/llms-full.txt
- Onchain calls: see `v3.dosc.derive.xyz/getting-started/contracts` for ETH contract ABIs for onchain calls

Append `.md` to any path to get the corresponding markdown page.

## SDKs are great for both direct use and as a reference

The `/llms.txt` is useful for navigating the docs website to get more context on how the exchange works, but when actually constructing onchain calls, signing and typing, in addition to machine-readable sources, use SDKs directly or as a reference to make sure you get the details right.

- **TypeScript — available now.** `@derivexyz/derive-ts`
- **Rust — available now.** `derive-rs` (https://github.com/derivexyz/derive-rs).
- **Python — available now.** `derive-py` (https://github.com/derivexyz/derive-py).

## Some things will involve your human

The API is fully programmatic, meaning every action you can do in the UX can also be done via the API, however there are some exceptions in Testnet.

To get Sepolia ETH and mint some testnet USDC you'll need to refer to `https://docs.derive.xyz/getting-started/quickstart` and make your human do a few clicks.

## Notes on async issues

Some actions will not have instant confirmation, however most of them will have a programmatic way to check progress and completion. Whenever possible, try to track the progress of your actions for your human or for the app you're building.

- Deposits: these require ETH L1 transactions, exchange backend to register deposit after some number of block confirmations and sometimes a keeper to sweep funds (depending on deposit). The SDKs and `https://docs.derive.xyz/getting-started/depositing` docs provide details on how to track each stage of the deposit process.

## If you are migrating from V2

Get the detailed migration skill.md here https://docs.derive.xyz/migrating/breaking-changes.md

The technical context around v3 and what architecturally changes is described in several pages:
- https://docs.derive.xyz/migrating/v3-improvements.md
- https://docs.derive.xyz/migrating/new-features.md
- https://docs.derive.xyz/migrating/coming-soon.md
