> ## Documentation Index
> Fetch the complete documentation index at: https://docs.derive.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> How to interact with the Derive Exchange.

The Derive Exchange is a fully-featured, low-latency exchange that settles trades and manages risk on-chain via Zero Knowledge proofs.

* Margining, settlement and permissioning are defined in the protocol, compiled into a RISC-V binary, and proven off-chain with the SP1 Hypercube zkVM.
* Protocol operations are batched and submitted to Ethereum L1, where each batch is verified with a PLONK SNARK proof.
* Withdrawals pay out as soon as their batch is verified on L1, subject to withdrawal rate limits.

This gives sub-millisecond matching and a smooth, CEX-like experience, while every operation still follows the on-chain protocol rules.

<Frame>
  <img className="block dark:hidden bg-white" src="https://mintcdn.com/derive-a0490cef/BhszcT-bQHpTuFnc/getting-started/interaction-methods-light.png?fit=max&auto=format&n=BhszcT-bQHpTuFnc&q=85&s=b62a9d49610d6ca3161e57ee0c4486be" alt="Diagram of the two ways users can interact with the exchange." width="1376" height="942" data-path="getting-started/interaction-methods-light.png" />

  <img className="hidden dark:block bg-black" src="https://mintcdn.com/derive-a0490cef/BhszcT-bQHpTuFnc/getting-started/interaction-methods.png?fit=max&auto=format&n=BhszcT-bQHpTuFnc&q=85&s=633dadc2bb41931b81fd75505b7cfd3c" alt="Diagram of the two ways users can interact with the exchange." width="1376" height="942" data-path="getting-started/interaction-methods.png" />
</Frame>

There are two ways users and builders can interact with the exchange:

* HTTP & WebSocket JSON-RPC API: send state-changing requests with self-custodial signed actions or non-sensitive market-data requests.
* L1 Transactions: deposit to the exchange via on-chain contract calls or interact with the exchange with a multi-sig. This method also allows users to withdraw funds using the "escape hatch".

## Agents

* Point your agent at our SKILL.MD at `https://docs.derive.xyz/skill.md`
* Install the skill with `npx skills add https://docs.derive.xyz`

## SDKs

<CardGroup cols={3}>
  <Card title="TypeScript" icon="square-js" href="https://github.com/derivexyz/derive-ts">
    `derive-ts`
  </Card>

  <Card title="Rust" icon="rust" href="https://github.com/derivexyz/derive-rs">
    `derive-rs`
  </Card>

  <Card title="Python" icon="python" href="https://github.com/derivexyz/derive-py">
    `derive-py`
  </Card>
</CardGroup>

## OpenAPI / AsyncAPI

Detailed API specifications can be downloaded here:

* OpenAPI: `https://docs.derive.xyz/openapi.json` (applies to both WS and HTTP)
* AsyncAPI for WS-only routes: `https://docs.derive.xyz/websocket.asyncapi.json`
* AsyncAPI for WS subscriptions: `https://docs.derive.xyz/subscriptions.asyncapi.json`

## Endpoints

<div className="derive-fit-table">
  | Environment | UI | WebSocket | REST |
  | - | - | - | - |
  | Mainnet | `https://app.derive.xyz` | `wss://api.derive.xyz/v3/ws` | `https://api.derive.xyz/v3` |
  | Testnet | `https://testnet.app.derive.xyz` | `wss://testnet.api.derive.xyz/v3/ws` | `https://testnet.api.derive.xyz/v3` |
</div>

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/getting-started/quickstart">
    Connect, log in, and place your first order end-to-end.
  </Card>

  <Card title="Authentication" icon="key" href="/authentication/session-login">
    Session login and per-action EIP-712 signing, step by step.
  </Card>

  <Card title="Subscriptions" icon="satellite-dish" href="/subscriptions">
    WebSocket channels for order books, tickers, trades, and account updates.
  </Card>

  <Card title="Action signing" icon="signature" href="/authentication/action-signing">
    Typehashes, modules, and per-deployment signing parameters.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.