Skip to main content
The Decibel REST API provides HTTP endpoints under /api/v1 for market data, account data, history, analytics, rewards, and referral workflows.

Authentication Scope

Most production traffic is expected to include:
  • Authorization: Bearer <KEY>
  • Origin: <your app origin>
See Authentication for credential setup. Implementation note: authentication and access control can be enforced at multiple layers (gateway and service). Treat endpoint-level access policy as deployment-configurable rather than assuming the same behavior in every environment.

Base URL

Request Format

  • Endpoints are rooted at /api/v1/...
  • Current public methods are GET and POST
  • Most endpoints use query/path parameters; no generic request body format applies globally

Spot and Perp Coverage

Some endpoints return both perpetual and spot rows. Mixed responses use asset_type with values perp or spot. Market-address filters never mean “all BTC products”. A spot BTC market and a perp BTC market are different markets with different addresses, so request the product-specific market you want. /api/v1/prices, /api/v1/funding_rate_history, /api/v1/asset_contexts, /api/v1/daily_stats, positions, and account-margin endpoints are perp-only. Spot markets do not have oracle price, mark price, funding, open interest, or positions; use /api/v1/spot/asset_contexts, /api/v1/orderbook, or the all_spot_mids / depth:{marketAddr} WebSocket topics for spot display prices.

Spot DTO Notes

  • Spot /api/v1/markets rows use asset_type="spot", sz_decimals from the base asset, and px_decimals from the quote asset. Perp-only fields such as max_leverage, max_open_interest, unrealized_pnl_haircut_bps, category, and is_isolated_only use neutral defaults.
  • Spot OrderDto rows use time_in_force for GTC, POST_ONLY, or IOC. Spot has no client_order_id, reduce-only flag, TP/SL, parent chain, or trigger condition, so those fields are empty, false, or null.
  • Spot TradeDto rows use action="Buy" or "Sell" from the row account’s perspective. Spot has no position PnL or funding, so realized_pnl_amount and realized_funding_amount are zero. fee_amount is the side’s actual fee, and fee_asset identifies whether that fee is denominated in the base or quote asset.
  • Spot bulk-order and bulk-order-fill DTOs share the perp response shape, carry asset_type="spot", and normalize prices/sizes with the spot market’s quote/base decimals.

Example Request

Example Response

Available Endpoints

The list below is aligned to runtime routes in rust/trading-api/src/http/routes.rs.

Market Data

Account and Trading

History

TWAP and Bulk Orders

Vaults

Analytics and Points

Referral and Affiliate

Backward-Compatible Aliases

SDK Alternative

For most application use cases, prefer the TypeScript SDK. See TypeScript SDK Overview.

Authentication

Credential setup and auth headers

Error Handling

Status codes and error payloads