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

# Developer Hub

> Build automated trading systems on Decibel

<Tip>
  **Building with AI tools?** Every page on this site is available as plain Markdown. Append `.md` to any URL, or grab the full site map from [llms.txt](https://docs.decibel.trade/llms.txt). You can also use the contextual menu on any page to copy as Markdown or open directly in Claude, ChatGPT, or Perplexity.
</Tip>

## What is Decibel?

Decibel is a decentralized perpetuals exchange with a fully on-chain order book and clearinghouse. Every order is placed, matched, and settled directly on the Aptos blockchain. There's no off-chain matching engine.

|                    | Decibel                                                                                               | Centralized Exchange                             |
| ------------------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| **Builder Codes**  | [Permissionlessly earn fees](/quickstart/builder-codes) from trades through your app, service, or bot | Requires broker agreements or affiliate approval |
| **Custody**        | You hold your keys                                                                                    | Exchange holds your funds                        |
| **Order matching** | On-chain, transparent                                                                                 | Off-chain, opaque                                |
| **Settlement**     | On-chain, verifiable                                                                                  | Internal ledger                                  |
| **Ecosystem**      | Composable with Aptos DeFi                                                                            | Isolated                                         |

Unlike other DEXes that run on app-specific chains, Decibel lives on Aptos, a general-purpose L1. Your assets aren't locked in a bridge or roll-up. You can move them anywhere in the Aptos ecosystem.

## Why Aptos?

Decibel needs a blockchain fast enough to run an on-chain order book:

* **Parallel execution via Block-STM.** Block times under 20ms.
* **Sub-second finality.** Settlement in roughly 0.125 seconds.
* **Move VM** for type-safe contracts with formal verification support.
* **Global validator set**, not a handful of nodes run by one team.

Aptos is one of the few L1s that can deliver the throughput and latency needed for high-frequency trading without off-chain components.

For a deeper look at how these pieces fit together - accounts, the orderbook, perps, vaults, and API keys - see [Core Concepts](/quickstart/concepts).

## Choose Your Integration Path

<CardGroup cols={3}>
  <Card title="TypeScript SDK" icon="code" href="/typescript-sdk/overview">
    Read market data, submit transactions, and manage positions with a typed
    interface.
  </Card>

  <Card title="REST + WebSocket APIs" icon="globe" href="/api-reference/rest/overview">
    Direct API access for any language. HTTP for queries, WebSocket for
    streaming.
  </Card>

  <Card title="On-Chain (Move)" icon="link" href="/developer-hub/on-chain/overview/index">
    Build Move modules that interact with Decibel contracts directly.
  </Card>
</CardGroup>

## Key Concepts for Developers

### Trading Account Model

Decibel uses a three-tier account model:

<img src="https://mintcdn.com/aptoslabs/canlJUnLiLpjMoUM/images/tssk/three-account.png?fit=max&auto=format&n=canlJUnLiLpjMoUM&q=85&s=bf69c920ffcf0782cea59f72f9d45dfa" alt="Three-tier account model" width="800" height="533" data-path="images/tssk/three-account.png" />

1. **Login Wallet**: Your main Aptos wallet
2. **API Wallet**: A delegated wallet for signing transactions
3. **Trading Account**: Isolated accounts for margin and positions

Each user can have multiple Trading Accounts to isolate strategies.

<Tip>
  **"Trading Account" = `subaccount` in code.** Throughout the SDK, API, and Move contracts, Trading Accounts are called `subaccount`. The function to create one is `create_new_subaccount`, the SDK method is `createSubaccount`, and the API routes use `/subaccounts`. When you see `subaccount` in code, it means Trading Account.
</Tip>

### Builder Codes

Applications can include a Builder Code in transactions to earn a share of trading fees. If you're building a trading interface or bot, [register a Builder Code](/quickstart/builder-codes) to monetize your integration.

### Vault System

Vaults are on-chain smart contracts that pool capital under a single manager. Contributors deposit USDC and receive fungible share tokens. Managers trade with pooled funds and earn interval-based performance fees (0–10%, crystallized every 30–365 days). See the [Vault Integration Guide](/developer-hub/guides/vaults) for the full walkthrough.

### Bulk Orders for Market Makers

Other decentralized exchanges require you to cancel orders before replacing them. On Decibel, bulk orders are stateful updates. Send your new desired order state and it overwrites the previous one. No cancel transaction. No waiting. This cuts latency for market makers and saves gas.

## Quick Start

<CardGroup cols={2}>
  <Card title="TypeScript Starter Kit" icon="rocket" href="/quickstart/typescript-starter-kit">
    Place your first order using REST API and WebSocket in under 10 minutes.
  </Card>

  <Card title="Get API Keys" icon="key" href="/quickstart/node-api-key">
    Create API wallet and get your bearer token
  </Card>
</CardGroup>

## Architecture Overview

Decibel has three main components developers interact with:

### 1. On-Chain Contracts

All trading happens on the Aptos blockchain through Move modules. Use the TypeScript SDK's `DecibelWriteDex` to submit transactions.

### 2. REST API

The REST API provides read-only access to aggregated data. Good for dashboards, analytics, and low-frequency polling.

### 3. WebSocket API

The WebSocket API streams real-time updates. Essential for market making and time-sensitive strategies.

## Guides

<CardGroup cols={2}>
  <Card title="Vault Integration" href="/developer-hub/guides/vaults">
    Programmatic onchain strategy with Vaults: create, fund, activate, and
    trade on behalf of contributors. Includes TypeScript and Python examples.
  </Card>

  <Card title="Bulk Orders" href="/developer-hub/guides/bulk-orders">
    Efficient order management for market makers
  </Card>

  <Card title="Builder Codes" href="/quickstart/builder-codes">
    Earn fees by routing trades through your application or bot
  </Card>
</CardGroup>

## On-Chain Reference

Detailed documentation for each transaction type:

| Category                                                                             | Description                                         |
| ------------------------------------------------------------------------------------ | --------------------------------------------------- |
| [Account Management](/developer-hub/on-chain/overview/index)                         | Create accounts, delegate trading, deposit/withdraw |
| [Order Management](/developer-hub/on-chain/order-management/place-order)             | Place, cancel, and manage orders                    |
| [Position Management](/developer-hub/on-chain/position-management/place-tp-sl-order) | Take-profit and stop-loss orders                    |
| [Vault Operations](/developer-hub/on-chain/vault/create-and-fund)                    | Create and manage vaults                            |

## Support

<Card title="Discord" icon="discord" href="https://discord.com/invite/decibel">
  Developer community and support
</Card>
