Base URLs
Decibel API supports two environments: Mainnet:Note about the API URL: The base URLs provide access to all Decibel
markets and trading functionality. This includes perpetual futures markets,
spot markets, and more.
Package Addresses
Each environment has its own package address: Mainnet Package Address:No authentication required: The endpoints in this guide are public and
don’t require authentication headers like OAuth or JWT. However, you do
still need a Decibel Node API key to access the node; simply pass it as
the
Authorization header on your requests, in the format:Authorization: Bearer <NODE_API_KEY>Base URL Variable: In the code examples below,
BASE_URL refers to
either: - https://api.mainnet.aptoslabs.com/decibel for Mainnet -
https://api.testnet.aptoslabs.com/decibel for Testnet Make sure to set this
variable in your code before making requests.Step 1: Get Available Markets
Let’s start by fetching the list of available markets. We’ll use the Get Markets endpoint to retrieve all active trading markets.Step 2: Get Perp Market Prices
After obtaining the list of markets, you can query perp price information for a specific market - including oracle price, mark price, mid price, funding rate, and open interest - using its market address. Spot markets do not publish/prices rows. For spot display prices, use /api/v1/spot/asset_contexts or the all_spot_mids WebSocket topic. For one market’s live book mid, use /api/v1/orderbook or depth:{marketAddr} and derive mid price from best bid and best ask.
Step 3: Get Order Book Data
Now let’s retrieve the order book for one market, which shows the current buy and sell orders with their prices and sizes. Pass a market address returned by/api/v1/markets. The same endpoint supports perp and spot market addresses, but each request resolves to one concrete market only. A BTC perp market and a BTC spot market are different markets with different addresses, so request the exact product-specific market address you want.
Step 4: Get Recent Trades
Finally, let’s fetch recent trades for one market address to see the latest trading activity. HTTP/api/v1/trades supports both perp and spot market addresses, but each request is still for one concrete market only. A spot BTC market and a perp BTC market have different addresses and are never combined. Spot rows are returned from the taker’s perspective; user-specific spot fills are available from /api/v1/trade_history.

