> ## 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.

# Derive v3 API

> One JSON-RPC API to integrate market-making systems, launch vaults, and give your users direct access to the Derive Exchange.

<div className="derive-hero relative overflow-hidden">
  <div className="relative mx-auto max-w-6xl px-6 pt-16 pb-12 lg:pt-24 lg:pb-16">
    <div className="grid items-start gap-10 lg:grid-cols-2 lg:gap-14">
      <div>
        <h1 className="derive-h1 mt-4 text-gray-900 dark:text-white">Build with Derive.</h1>

        <p className="mt-5 max-w-xl text-lg leading-relaxed text-gray-600 dark:text-gray-400">
          Options, perps, lending and vaults within minutes.
        </p>

        <div className="mt-8 flex flex-wrap gap-3">
          <a className="derive-btn derive-btn-primary" href="/getting-started/quickstart">
            <Icon icon="rocket" size={16} color="#ffffff" /> Quickstart
          </a>

          <a className="derive-btn derive-btn-secondary" href="/getting-started/introduction">
            How Derive works
          </a>
        </div>

        <div className="mt-8 flex flex-wrap gap-2.5">
          <span className="derive-chip">
            <span className="derive-accent">WS</span>
            <span className="derive-mono">wss\://testnet.api.derive.xyz/v3/ws</span>
          </span>

          <span className="derive-chip">
            <span className="derive-accent">HTTP</span>
            <span className="derive-mono">[https://testnet.api.derive.xyz/v3](https://testnet.api.derive.xyz/v3)</span>
          </span>
        </div>
      </div>

      <div className="derive-code">
        <CodeGroup>
          ```typescript TypeScript theme={null}
          import { DeriveClient } from '@derivexyz/derive-ts';

          const client = new DeriveClient({
            network: 'mainnet',
            wallet: PRIVATE_KEY
          });
          await client.connect();
          await client.login();

          const { order } = await client.orders.place({
            subaccountId: 9,
            instrumentName: 'ETH-PERP',
            direction: 'buy',
            orderType: 'limit',
            limitPrice: '3100',
            amount: '1',
          });
          ```

          ```python Python theme={null}
          import asyncio
          from decimal import Decimal

          from derive_py import WebSocketClient
          from derive_py.data_types import Direction, OrderType


          async def main():
              client = WebSocketClient.from_env()
              await client.connect()

              response = await client.orders.create(
                  instrument_name="ETH-PERP",
                  direction=Direction.buy,
                  order_type=OrderType.limit,
                  limit_price=Decimal("3100"),
                  amount=Decimal("1"),
              )
              print(response.order.order_id)
              await client.disconnect()


          asyncio.run(main())
          ```

          ```rust Rust theme={null}
          use bigdecimal::BigDecimal;
          use derive_rs::{Environment, WsClient, actions::OrderArgs};
          use derive_rs::models::{Direction, OrderType, TimeInForce};

          #[tokio::main]
          async fn main() -> Result<(), Box<dyn std::error::Error>> {
              let client = WsClient::new(
                  Environment::Mainnet,
                  Some(std::env::var("DERIVE_PRIVATE_KEY")?),
                  Some(std::env::var("DERIVE_WALLET")?),
                  Some(9),
              )
              .await?;
              client.login().await?;

              let order = OrderArgs::builder()
                  .instrument_name("ETH-PERP".to_string())
                  .direction(Direction::Buy)
                  .order_type(OrderType::Limit)
                  .time_in_force(TimeInForce::Gtc)
                  .limit_price(BigDecimal::from(3100))
                  .amount(BigDecimal::from(1))
                  .build();

              let response = client.orders().place(order).await?;
              println!("{}", response.order.order_id);
              Ok(())
          }
          ```
        </CodeGroup>
      </div>
    </div>
  </div>
</div>

<div className="mx-auto max-w-6xl px-6 py-10">
  <h2 className="text-xl font-medium text-gray-900 dark:text-white">What are you building?</h2>

  <div className="mt-6 grid gap-5 md:grid-cols-3">
    <a className="derive-persona" href="/getting-started/depositing">
      <span className="derive-feature-icon">
        <Icon icon="layer-group" size={18} color="#F63E58" />
      </span>

      <h3 className="mt-4 font-medium text-gray-900 dark:text-white">Apps</h3>

      <p className="mt-1.5 text-sm leading-relaxed text-gray-600 dark:text-gray-400">
        Give your users direct access to vaults, lending, options and perps within minutes.
      </p>

      <span className="derive-persona-cta">Onboard your app →</span>
    </a>

    <a className="derive-persona" href="/getting-started/quickstart">
      <span className="derive-feature-icon">
        <Icon icon="chart-candlestick" size={18} color="#F63E58" />
      </span>

      <h3 className="mt-4 font-medium text-gray-900 dark:text-white">Market making & algo trading bots</h3>

      <p className="mt-1.5 text-sm leading-relaxed text-gray-600 dark:text-gray-400">
        Orderbook, RFQ, and market-maker protections over a low-latency and Deribit-equivalent API.
      </p>

      <span className="derive-persona-cta">Integrate the API →</span>
    </a>

    <a className="derive-persona" href="/vaults/create-a-vault">
      <span className="derive-feature-icon">
        <Icon icon="vault" size={18} color="#F63E58" />
      </span>

      <h3 className="mt-4 font-medium text-gray-900 dark:text-white">Vaults</h3>

      <p className="mt-1.5 text-sm leading-relaxed text-gray-600 dark:text-gray-400">
        Take deposits, trade options / perps, and earn management & performance fees within minutes.
      </p>

      <span className="derive-persona-cta">Launch a vault →</span>
    </a>
  </div>
</div>

<div className="mx-auto max-w-6xl px-6 py-10">
  <h2 className="text-xl font-medium text-gray-900 dark:text-white">SDKs</h2>

  <div className="mt-6 flex flex-wrap gap-4">
    <a className="derive-sdk" href="https://github.com/derivexyz/derive-ts">
      <Icon icon="square-js" size={22} color="#F63E58" />

      <span className="font-medium text-gray-900 dark:text-white">TypeScript</span>
    </a>

    <a className="derive-sdk" href="https://github.com/derivexyz/derive-py">
      <Icon icon="python" size={22} color="#F63E58" />

      <span className="font-medium text-gray-900 dark:text-white">Python</span>
    </a>

    <a className="derive-sdk" href="https://github.com/derivexyz/derive-rs">
      <Icon icon="rust" size={22} color="#F63E58" />

      <span className="font-medium text-gray-900 dark:text-white">Rust</span>
    </a>
  </div>
</div>

<div className="mx-auto max-w-6xl px-6 pt-8 pb-16">
  <h2 className="text-xl font-medium text-gray-900 dark:text-white">For your agent or LLM</h2>

  <div className="mt-4 flex flex-col gap-2">
    <a className="derive-mono text-sm text-gray-600 hover:underline dark:text-gray-400" href="https://docs.derive.xyz/skill.md">/SKILL.MD</a>
    <a className="derive-mono text-sm text-gray-600 hover:underline dark:text-gray-400" href="https://docs.derive.xyz/openapi.json">/openapi.json</a>
    <a className="derive-mono text-sm text-gray-600 hover:underline dark:text-gray-400" href="https://docs.derive.xyz/websocket.asyncapi.json">/websocket.asyncapi.json</a>
    <a className="derive-mono text-sm text-gray-600 hover:underline dark:text-gray-400" href="https://docs.derive.xyz/subscriptions.asyncapi.json">/subscriptions.asyncapi.json</a>
  </div>
</div>


## Related topics

- [Instrument Names](/trading/instrument-names.md)
- [Changelog](/changelog.md)
- [Connecting over WebSocket](/connecting.md)
