Get Pools
Retrieve metadata for all available Deepbook trading pools. This endpoint returns essential information about each pool including base and quote asset details, decimals, and trading parameters like tick size and lot size.
Endpoint
GET /deepbook/get_pools
Use Cases
- Pool Discovery — List all available trading pairs for a trading interface
- Trading Configuration — Fetch decimals and parameters needed to format prices and quantities
- Market Overview — Display all active pools with their base/quote assets
- Client Initialization — Configure trading bots with accurate pool metadata
Parameters
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api-key | string | Yes | Your Surflux API key for authentication |
Response
Returns an array of pool objects. Each pool contains:
| Field | Type | Description |
|---|---|---|
pool_id | string | Unique identifier for the pool on-chain |
pool_name | string | Human-readable pool name (e.g., "SUI_USDC") |
base_asset_id | string | Full type identifier of the base asset |
base_asset_decimals | number | Decimal places for the base asset |
base_asset_symbol | string | Ticker symbol of the base asset |
base_asset_name | string | Full name of the base asset |
quote_asset_id | string | Full type identifier of the quote asset |
quote_asset_decimals | number | Decimal places for the quote asset |
quote_asset_symbol | string | Ticker symbol of the quote asset |
quote_asset_name | string | Full name of the quote asset |
min_size | number | Minimum order size for the pool |
lot_size | number | Minimum quantity increment |
tick_size | number | Minimum price increment |
Example Response
[
{
"pool_id": "0x27c4fdb3b846aa3ae4a65ef5127a309aa3c1f466671471a806d8912a18b253e8",
"pool_name": "NS_SUI",
"base_asset_id": "0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS",
"base_asset_decimals": 6,
"base_asset_symbol": "NS",
"base_asset_name": "NS Token",
"quote_asset_id": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
"quote_asset_decimals": 9,
"quote_asset_symbol": "SUI",
"quote_asset_name": "Sui",
"min_size": 1000000,
"lot_size": 100000,
"tick_size": 10000000
},
{
"pool_id": "0x0c0fdd4008740d81a8a7d4281322aee71a1b62c449eb5b142656753d89ebc060",
"pool_name": "NS_USDC",
"base_asset_id": "0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS",
"base_asset_decimals": 6,
"base_asset_symbol": "NS",
"base_asset_name": "NS Token",
"quote_asset_id": "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
"quote_asset_decimals": 6,
"quote_asset_symbol": "USDC",
"quote_asset_name": "Native USDC Token",
"min_size": 1000000,
"lot_size": 100000,
"tick_size": 10000
}
]
Example Request
curl "https://api.surflux.dev/deepbook/get_pools?api-key=YOUR_API_KEY"
const apiKey = 'YOUR_API_KEY';
const url = `https://api.surflux.dev/deepbook/get_pools?api-key=${apiKey}`;
const response = await fetch(url);
const pools = await response.json();
console.log(`Found ${pools.length} pools`);
pools.forEach(pool => {
console.log(`${pool.pool_name}: ${pool.base_asset_symbol}/${pool.quote_asset_symbol}`);
});
Understanding Pool Parameters
Decimals
Asset decimals determine how to convert between human-readable amounts and on-chain values.
For example, if base_asset_decimals is 6, then 1 token = 1,000,000 base units on-chain.
Tick Size
The tick_size represents the minimum price increment for orders in this pool. All order prices must be multiples of the tick size.
Example: If tick_size is 10000, valid prices would be 10000, 20000, 30000, etc.
Lot Size
The lot_size represents the minimum quantity increment for orders. All order quantities must be multiples of the lot size.
Example: If lot_size is 100000, valid quantities would be 100000, 200000, 300000, etc.
Minimum Size
The min_size is the absolute minimum order quantity. Orders smaller than this will be rejected.
Best Practices
- Cache Pool Metadata — Pool configurations rarely change. Cache this data locally and refresh periodically rather than querying on every operation.
- Use pool_name for Routing — Most other endpoints accept
poolNameas a path parameter. Use thepool_namefield from this response. - Validate Orders Client-Side — Use
min_size,lot_size, andtick_sizeto validate orders before submission to avoid rejected transactions. - Format Prices Correctly — Always account for
base_asset_decimalsandquote_asset_decimalswhen displaying prices to users.