Skip to main content

DeepBookV3 Indexer

DeepBookV3 Indexer provides streamlined, real-time access to order book and trading data from the DeepBookV3 protocol. It acts as a centralized service to aggregate and expose critical data points for developers, traders, and analysts who interact with DeepBookV3.

DeepBookV3 Indexer simplifies data retrieval by offering endpoints that enable:

  • Viewing pool information: Retrieve detailed metadata about all available trading pools, including base and quote assets, tick sizes, and lot sizes.
  • Historical volume analysis: Fetch volume metrics for specific pools or balance managers over custom time ranges, with support for interval-based breakdowns.
  • User-specific volume tracking: Provide insights into individual trader activities by querying their balance manager-specific volumes.
  • OHLCV candlestick data: Access candlestick chart data for technical analysis with configurable intervals.
  • DeepBook Margin data: Query margin trading events including loans, liquidations, and margin pool operations.

You can either use a publicly available indexer or spin up your own service. The choice you make depends on a few factors.

Use the public service if:

  • You have standard data needs.
  • Latency and availability provided by the public endpoint meet your requirements.
  • You want to avoid the operational overhead of running your own service.

Run your own indexer if:

  • You require guaranteed uptime and low latency.
  • You have specific customization needs.
  • Your application depends on proprietary features or extended data sets.

Public DeepBookV3 Indexer

Mysten Labs provides public indexers for DeepBookV3.

Mainnet

https://deepbook-indexer.mainnet.mystenlabs.com/

Testnet

https://deepbook-indexer.testnet.mystenlabs.com/

Asset conversions

Volumes returned by the following endpoints are expressed in the smallest unit of the corresponding asset.

  • /all_historical_volume
  • /historical_volume
  • /historical_volume_by_balance_manager_id
  • /historical_volume_by_balance_manager_id_with_interval

Following are the decimal places (scalars) used to determine the base unit for each asset.

AssetScalar
ALKIMI9
AUSD6
Bridged Eth (BETH)8
DEEP6
DRF6
IKA9
LayerZero WBTC (LZWBTC)8
Native USDC6
NS6
SEND6
SUI9
TYPUS9
WAL9
Wormhole USDC (WUSDC)6
Wormhole USDT (WUSDT)6
xBTC8

To convert the returned volume to the standard asset unit, divide the value by 10^SCALAR. For example:

If the volume returned in the base asset for the SUI/USDC pool is 1,000,000,000 SUI UNIT, the correct volume in SUI is 1,000,000,000 / 10^(SUI_SCALAR) = 1 SUI. Similarly, if the volume returned in the quote asset for the SUI/USDC pool is 1,000,000,000 USDC UNIT, the correct volume is 1,000,000,000 / 10^(USDC_SCALAR) = 1,000 USDC.

Use these conversions to interpret the volumes correctly across all pools and assets.

API endpoints

You can perform the following tasks using the endpoints that the indexer API for DeepBookV3 provides.

Click to open
Get all pool information
/get_pools

Returns a list of all available pools, each containing detailed information about the base and quote assets, as well as pool parameters like minimum size, lot size, and tick size.

Response

[
{
"pool_id": "string",
"pool_name": "string",
"base_asset_id": "string",
"base_asset_decimals": integer,
"base_asset_symbol": "string",
"base_asset_name": "string",
"quote_asset_id": "string",
"quote_asset_decimals": integer,
"quote_asset_symbol": "string",
"quote_asset_name": "string",
"min_size": integer,
"lot_size": integer,
"tick_size": integer
},
...
]

Each pool object in the response includes the following fields:

  • pool_id: ID for the pool.
  • pool_name: Name of the pool.
  • base_asset_id: ID for the base asset.
  • base_asset_decimals: Number of decimals for the base asset.
  • base_asset_symbol: Symbol for the base asset.
  • base_asset_name: Name of the base asset.
  • quote_asset_id: ID for the quote asset.
  • quote_asset_decimals: Number of decimals for the quote asset.
  • quote_asset_symbol: Symbol for the quote asset.
  • quote_asset_name: Name of the quote asset.
  • min_size: Minimum trade size for the pool, in smallest units of the base asset.
  • lot_size: Minimum increment for trades in this pool, in smallest units of the base asset.
  • tick_size: Minimum price increment for trades in this pool.

Example

A successful request to the following endpoint

/get_pools

produces a response similar to

[
{
"pool_id": "0xb663828d6217467c8a1838a03793da896cbe745b150ebd57d82f814ca579fc22",
"pool_name": "DEEP_SUI",
"base_asset_id": "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",
"base_asset_decimals": 6,
"base_asset_symbol": "DEEP",
"base_asset_name": "DeepBook Token",
"quote_asset_id": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
"quote_asset_decimals": 9,
"quote_asset_symbol": "SUI",
"quote_asset_name": "Sui",
"min_size": 100000000,
"lot_size": 10000000,
"tick_size": 10000000
},
{
"pool_id": "0xf948981b806057580f91622417534f491da5f61aeaf33d0ed8e69fd5691c95ce",
"pool_name": "DEEP_USDC",
"base_asset_id": "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",
"base_asset_decimals": 6,
"base_asset_symbol": "DEEP",
"base_asset_name": "DeepBook Token",
"quote_asset_id": "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
"quote_asset_decimals": 6,
"quote_asset_symbol": "USDC",
"quote_asset_name": "USDC",
"min_size": 100000000,
"lot_size": 10000000,
"tick_size": 10000
}
]
Click to open
Get historical volume for pool in a specific time range
/historical_volume/:pool_names?start_time=<UNIX_TIMESTAMP_SECONDS>&end_time=<UNIX_TIMESTAMP_SECONDS>&volume_in_base=<BOOLEAN>

Use this endpoint to get historical volume for pools for a specific time range. Delimit the pool_names with commas, and use Unix timestamp seconds for start_time and end_time values.

By default, this endpoint retrieves the last 24-hour trading volume in the quote asset for specified pools. If you want to query the base asset instead, set volume_in_base to true.

Response

Returns the historical volume for each specified pool within the given time range.

{
"pool_name_1": total_pool1_volume,
"pool_name_2": total_pool2_volume,
...
}

Example

A successful request to the following endpoint

/historical_volume/DEEP_SUI,SUI_USDC?start_time=1731260703&end_time=1731692703&volume_in_base=true

produces a response similar to

{
"DEEP_SUI": 22557460000000,
"SUI_USDC": 19430171000000000
}
Click to open
Get historical volume for all pools
/all_historical_volume?start_time=<UNIX_TIMESTAMP_SECONDS>&end_time=<UNIX_TIMESTAMP_SECONDS>&volume_in_base=<BOOLEAN>

Use this endpoint to get historical volume for all pools. Include the optional start_time and end_time values as Unix timestamp seconds to retrieve the volume within that time range.

By default, this endpoint retrieves the last 24-hour trading volume in the quote asset. If you want to query the base asset instead, set volume_in_base to true.

Response

Returns the historical volume for all available pools within the time range (if provided).

{
"pool_name_1": total_pool1_volume,
"pool_name_2": total_pool2_volume
}

Example

A successful request to the following endpoint

/all_historical_volume?start_time=<UNIX_TIMESTAMP_SECONDS>&end_time=<UNIX_TIMESTAMP_SECONDS>&volume_in_base=<BOOLEAN>

produces a response similar to

{
"DEEP_SUI": 22557460000000,
"WUSDT_USDC": 10265000000,
"NS_USDC": 4399650900000,
"NS_SUI": 6975475200000,
"SUI_USDC": 19430171000000000,
"WUSDC_USDC": 23349574900000,
"DEEP_USDC": 130000590000000
}
Click to open
Get historical volume by balance manager
/historical_volume_by_balance_manager_id/:pool_names/:balance_manager_id?start_time=<UNIX_TIMESTAMP_SECONDS>&end_time=<UNIX_TIMESTAMP_SECONDS>&volume_in_base=<BOOLEAN>

Get historical volume by balance manager for a specific time range. Delimit the pool_names with commas, and use Unix timestamp seconds for the optional start_time and end_time values.

By default, this endpoint retrieves the last 24-hour trading volume for the balance manager in the quote asset for specified pools. If you want to query the base asset instead, set volume_in_base to true.

Response

{
"pool_name_1": [maker_volume, taker_volume],
"pool_name_2":
}

Example

A successful request to the following endpoint

/historical_volume_by_balance_manager_id/SUI_USDC,DEEP_SUI/0x344c2734b1d211bd15212bfb7847c66a3b18803f3f5ab00f5ff6f87b6fe6d27d?start_time=1731260703&end_time=1731692703&volume_in_base=true

produces a response similar to

{
"DEEP_SUI": [
14207960000000,
3690000000
],
"SUI_USDC": [
2089300100000000,
17349400000000
]
}
Click to open
Get historical volume by balance manager within a specific time range and intervals
/historical_volume_by_balance_manager_id_with_interval/:pool_names/:balance_manager_id?start_time=<UNIX_TIMESTAMP_SECONDS>&end_time=<UNIX_TIMESTAMP_SECONDS>&interval=<UNIX_TIMESTAMP_SECONDS>&volume_in_base=<BOOLEAN>

Get historical volume by BalanceManager for a specific time range with intervals. Delimit pool_names with commas and use Unix timestamp seconds for the optional start_time and end_time values. Use number of seconds for the interval value. As a simplified interval example, if start_time is 5, end_time is 10, and interval is 2, then the response includes volume from 5 to 7 and 7 to 9, with start time of the periods as keys.

By default, this endpoint retrieves the last 24-hour trading volume for the balance manager in the quote asset for specified pools. If you want to query the base asset instead, set volume_in_base to true.

Response

{
"[time_1_start, time_1_end]": {
"pool_name_1": [maker_volume, taker_volume],
"pool_name_2":
},
"[time_2_start, time_2_end]": {
"pool_name_1": [maker_volume, taker_volume],
"pool_name_2":
}
}

Example

A successful request to the following endpoint with an interval of 24 hours

/historical_volume_by_balance_manager_id_with_interval/USDC_DEEP,SUI_USDC/0x344c2734b1d211bd15212bfb7847c66a3b18803f3f5ab00f5ff6f87b6fe6d27d?start_time=1731460703&end_time=1731692703&interval=86400&volume_in_base=true

produces a response similar to

{
"[1731460703, 1731547103]": {
"SUI_USDC": [
505887400000000,
2051300000000
]
},
"[1731547103, 1731633503]": {
"SUI_USDC": [
336777500000000,
470600000000
]
}
}
Click to open
Get summary
/summary

Returns a summary in JSON for all trading pairs in DeepBookV3.

Response

Each summary object has the following form. The order of fields in the JSON object is not guaranteed.

{
"trading_pairs": "string",
"quote_currency": "string",
"last_price": float,
"lowest_price_24h": float,
"highest_bid": float,
"base_volume": float,
"price_change_percent_24h": float,
"quote_volume": float,
"lowest_ask": float,
"highest_price_24h": float,
"base_currency": "string"
}

Example

A successful request to

/summary

produces a response similar to

[
{
"trading_pairs": "AUSD_USDC",
"quote_currency": "USDC",
"last_price": 1.0006,
"lowest_price_24h": 0.99905,
"highest_bid": 1.0006,
"base_volume": 1169.2,
"price_change_percent_24h": 0.07501125168773992,
"quote_volume": 1168.961637,
"lowest_ask": 1.0007,
"highest_price_24h": 1.00145,
"base_currency": "AUSD"
},
{
"quote_volume": 4063809.55231,
"lowest_price_24h": 0.9999,
"highest_price_24h": 1.009,
"base_volume": 4063883.6,
"quote_currency": "USDC",
"price_change_percent_24h": 0.0,
"base_currency": "WUSDC",
"trading_pairs": "WUSDC_USDC",
"last_price": 1.0,
"highest_bid": 1.0,
"lowest_ask": 1.0001
},
{
"price_change_percent_24h": 0.0,
"quote_currency": "USDC",
"lowest_price_24h": 0.0,
"quote_volume": 0.0,
"base_volume": 0.0,
"highest_price_24h": 0.0,
"lowest_ask": 1.04,
"last_price": 1.04,
"base_currency": "WUSDT",
"highest_bid": 0.90002,
"trading_pairs": "WUSDT_USDC"
},
...
]
Click to open
Get ticker information
/ticker

Returns all trading pairs volume (already scaled), last price, and isFrozen value. Possible values for isFrozen is either:

  • 0: Pool is active
  • 1: Pool is inactive

Response

{
"TRADING_PAIR": {
"base_volume": float,
"quote_volume": float,
"last_price": float,
"isFrozen": integer (0 | 1)
}
}

Example

A successful request to

/ticker

produces a response similar to

{
"DEEP_USDC": {
"last_price": 0.07055,
"base_volume": 43760440.0,
"quote_volume": 3096546.9161,
"isFrozen": 0
},
"NS_SUI": {
"last_price": 0.08323,
"base_volume": 280820.8,
"quote_volume": 23636.83837,
"isFrozen": 0
},
...
}
Click to open
Get trades
/trades/:pool_name?limit=<INTEGER>&start_time=<UNIX_TIMESTAMP_SECONDS>&end_time=<UNIX_TIMESTAMP_SECONDS>&maker_balance_manager_id=<ID>&taker_balance_manager_id=<ID>

Returns the most recent trades in the pool.

Response

[
{
"event_digest": "string",
"digest": "string",
"trade_id": "string",
"maker_order_id": "string",
"taker_order_id": "string",
"maker_balance_manager_id": "string",
"taker_balance_manager_id": "string",
"price": float,
"base_volume": float,
"quote_volume": float,
"timestamp": integer,
"type": "string",
"taker_is_bid": boolean,
"taker_fee": float,
"maker_fee": float,
"taker_fee_is_deep": boolean,
"maker_fee_is_deep": boolean
}
]

The timestamp value is in Unix milliseconds. The type value is either "buy" or "sell" based on the taker's direction.

Example

A successful request to

trades/SUI_USDC?limit=2&start_time=1738093405&end_time=1738096485&maker_balance_manager_id=0x344c2734b1d211bd15212bfb7847c66a3b18803f3f5ab00f5ff6f87b6fe6d27d&taker_balance_manager_id=0x47dcbbc8561fe3d52198336855f0983878152a12524749e054357ac2e3573d58

produces a response similar to

[
{
"event_digest": "abc123...",
"digest": "def456...",
"trade_id": "136321457151457660152049680",
"maker_order_id": "68160737799100866923792791",
"taker_order_id": "170141183460537392451039660509112362617",
"maker_balance_manager_id": "0x344c2734b1d211bd15212bfb7847c66a3b18803f3f5ab00f5ff6f87b6fe6d27d",
"taker_balance_manager_id": "0x47dcbbc8561fe3d52198336855f0983878152a12524749e054357ac2e3573d58",
"price": 3.695,
"base_volume": 405.0,
"quote_volume": 1499.0,
"timestamp": 1738096392913,
"type": "sell",
"taker_is_bid": false,
"taker_fee": 0.001,
"maker_fee": 0.0005,
"taker_fee_is_deep": true,
"maker_fee_is_deep": true
},
...
]
Click to open
Get order updates
/order_updates/:pool_name?limit=<INTEGER>&start_time=<UNIX_TIMESTAMP_SECONDS>&end_time=<UNIX_TIMESTAMP_SECONDS>&status=<"Placed" or "Canceled">&balance_manager_id=<ID>

Returns the orders that were recently placed or canceled in the pool

Response

[
{
"order_id": "string",
"balance_manager_id": "string",
"timestamp": integer,
"original_quantity": integer,
"remaining_quantity": integer,
"filled_quantity": integer,
"price": integer,
"status": "string",
"type": "string"
}
]

The timestamp value is in Unix milliseconds.

Example

A successful request to

/order_updates/DEEP_USDC?start_time=1738703053&end_time=1738704080&limit=2&status=Placed&balance_manager_id=0xd335e8aa19d6dc04273d77e364c936bad69db4905a4ab3b2733d644dd2b31e0a

produces a response similar to

[
{
"order_id": "170141183464610341308794360958165054983",
"balance_manager_id": "0xd335e8aa19d6dc04273d77e364c936bad69db4905a4ab3b2733d644dd2b31e0a",
"timestamp": 1738704071994,
"original_quantity": 8910,
"remaining_quantity": 8910,
"filled_quantity": 0,
"price": 22449,
"status": "Placed",
"type": "sell"
},
...
]
Click to open
Get order book information
/orderbook/:pool_name?level={1|2}&depth={integer}

Returns the bids and asks for the relevant pool. The bids and asks returned are each sorted from best to worst. There are two optional query parameters in the endpoint:

  • level: The level value can be either 1 or 2.
    • 1: Only the best bid and ask.
    • 2: Arranged by best bids and asks. This is the default value.
  • depth: The depth value can be 0 or greater than 1. A value of 0 returns the entire order book, and a value greater than 1 returns the specified number of both bids and asks. In other words, if you provide depth=100, then your response includes 50 bids and 50 asks. If the depth value is odd, it's treated as the next lowest even value. Consequently, depth=101 also returns 50 bids and 50 asks. If you do not provide a depth parameter, the response defaults to all orders in the order book.

Response

{
"timestamp": "string",
"bids": [
[
"string",
"string"
],
[
"string",
"string"
]
],
"asks": [
[
"string",
"string"
],
[
"string",
"string"
]
]
}

The timestamp returned is a string that represents a Unix timestamp in milliseconds.

Example

A successful request to

/orderbook/SUI_USDC?level=2&depth=4

produces a response similar to

{
"timestamp": "1733874965431",
"bids": [
[
"3.715",
"2.7"
],
[
"3.713",
"2294.8"
]
],
"asks": [
[
"3.717",
"0.9"
],
[
"3.718",
"1000"
]
]
}
Click to open
Get asset information
/assets

Returns asset information for all coins being traded on DeepBookV3.

Response

Each asset object has the following form:

"ASSET_NAME": {
"unified_cryptoasset_id": "string",
"name": "string",
"contractAddress": "string",
"contractAddressUrl": "string",
"can_deposit": "string (true | false)",
"can_withdraw": "string (true | false)"
}

Example

A successful request to

/assets

produces a response similar to

{
"NS": {
"unified_cryptoasset_id": "32942",
"name": "Sui Name Service",
"contractAddress": "0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178",
"contractAddressUrl": "https://suiscan.xyz/mainnet/object/0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178",
"can_deposit": "true",
"can_withdraw": "true"
},
"AUSD": {
"unified_cryptoasset_id": "32864",
"name": "AUSD",
"contractAddress": "0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2",
"contractAddressUrl": "https://suiscan.xyz/mainnet/object/0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2",
"can_deposit": "true",
"can_withdraw": "true"
},
...
}
Click to open
Get orders by balance manager
/orders/:pool_name/:balance_manager_id?limit=<INTEGER>&status=<STATUS>

Returns orders for a specific balance manager in a pool. The status parameter can filter by order status (e.g., Placed, Canceled, Filled). Multiple statuses can be provided as comma-separated values.

Response

[
{
"order_id": "string",
"balance_manager_id": "string",
"type": "string",
"current_status": "string",
"price": float,
"placed_at": integer,
"last_updated_at": integer,
"original_quantity": float,
"filled_quantity": float,
"remaining_quantity": float
}
]
Click to open
Get trade count
/trade_count?start_time=<UNIX_TIMESTAMP_SECONDS>&end_time=<UNIX_TIMESTAMP_SECONDS>

Returns the total number of trades across all pools within the specified time range.

Response

integer
Click to open
Get OHLCV candlestick data
/ohclv/:pool_name?interval=<INTERVAL>&start_time=<UNIX_TIMESTAMP_SECONDS>&end_time=<UNIX_TIMESTAMP_SECONDS>&limit=<INTEGER>

Returns OHLCV (Open, High, Low, Close, Volume) candlestick data for a pool. Valid intervals are: 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w.

Response

{
"candles": [
[timestamp, open, high, low, close, volume],
...
]
}

Example

A successful request to

/ohclv/SUI_USDC?interval=1h&limit=10

produces a response similar to

{
"candles": [
[1738000000, 3.5, 3.6, 3.4, 3.55, 1000000],
[1738003600, 3.55, 3.7, 3.5, 3.65, 1500000],
...
]
}
Click to open
Get net deposits
/get_net_deposits/:asset_ids/:timestamp

Returns the net deposits (deposits minus withdrawals) for specified assets up to a given timestamp. Asset IDs should be comma-separated.

Response

{
"asset_id_1": integer,
"asset_id_2": integer,
...
}
Click to open
Get DEEP supply
/deep_supply

Returns the total supply of DEEP tokens.

Response

{
"total_supply": "string"
}
Click to open
Get deposited assets
/deposited_assets/:balance_manager_ids

Returns the list of assets that have been deposited into the specified balance managers. Balance manager IDs should be comma-separated.

Response

[
{
"balance_manager_id": "string",
"assets": ["string", ...]
}
]
Click to open
Get indexer status
/status?max_checkpoint_lag=<INTEGER>&max_time_lag_seconds=<INTEGER>

Returns the health status of the indexer, including checkpoint lag information for each pipeline. The optional parameters set thresholds for determining healthy status (defaults: max_checkpoint_lag=100, max_time_lag_seconds=60).

Response

{
"status": "OK" | "UNHEALTHY",
"latest_onchain_checkpoint": integer,
"current_time_ms": integer,
"earliest_checkpoint": integer,
"max_lag_pipeline": "string",
"max_checkpoint_lag": integer,
"max_time_lag_seconds": integer,
"pipelines": [
{
"pipeline": "string",
"indexed_checkpoint": integer,
"indexed_epoch": integer,
"indexed_timestamp_ms": integer,
"checkpoint_lag": integer,
"time_lag_seconds": integer,
"latest_onchain_checkpoint": integer
}
]
}
Click to open
Get points
/get_points?addresses=<ADDRESS1>,<ADDRESS2>,...

Returns the total points accumulated for the specified addresses. Points are earned through trading activity on DeepBookV3. Provide addresses as comma-separated values.

Response

[
{
"address": "0x1234...",
"total_points": 1000000
},
{
"address": "0x5678...",
"total_points": 500000
}
]

Example

A successful request to

/get_points?addresses=0x344c2734b1d211bd15212bfb7847c66a3b18803f3f5ab00f5ff6f87b6fe6d27d,0x47dcbbc8561fe3d52198336855f0983878152a12524749e054357ac2e3573d58

produces a response similar to

[
{
"address": "0x344c2734b1d211bd15212bfb7847c66a3b18803f3f5ab00f5ff6f87b6fe6d27d",
"total_points": 1250000
},
{
"address": "0x47dcbbc8561fe3d52198336855f0983878152a12524749e054357ac2e3573d58",
"total_points": 750000
}
]
Click to open
Get referral fee events
/referral_fee_events?pool_id=<ID>&referral_id=<ID>

Returns events for referral fees earned during trading. These events track fees earned by referrals across different pools.

Response

[
{
"event_digest": "0xabc123...",
"digest": "0xdef456...",
"sender": "0x1111...",
"checkpoint": 12345678,
"checkpoint_timestamp_ms": 1738000000000,
"package": "0x2222...",
"pool_id": "0x1234...",
"referral_id": "0x5678...",
"base_fee": 1000000,
"quote_fee": 500000,
"deep_fee": 250000
}
]
DeepBookV3 repository

The DeepBookV3 repository on GitHub.