Pool Liquidity Map
Retrieves the distribution of net liquidity across price ticks for a specific Orca Whirlpool. Returns liquidity values at representative tick intervals based on the specified resolution, so you can see how liquidity is concentrated across the price curve. Note: the pool must have been created after 2025-02-27.
GET
https://api.cambrian.org/solana/orca/pools/liquidity-map
Parameters
pool_address* (string)
The public key address of the Orca Whirlpool.
resolution* (integer)
The approximate number of data points (tick intervals) desired in the output map. Higher values mean finer granularity.
Responses
Code
Description
200
Successful response
Media type: application/vnd.cambrian.table.v1.0.0+json
[
{
"columns": [
{
"name": "mapTick",
"type": "Int64"
},
{
"name": "liquidity",
"type": "Int256"
}
],
"data": [
[
-443632,
"1388308015"
],
[
-439200,
"1388308015"
],
[
-434768,
"1388308015"
],
[
-430336,
"1388308015"
],
[
-425904,
"1388308015"
],
[
-421472,
"1388308015"
],
[
-417040,
"1388308015"
],
[
-412608,
"1388308015"
],
[
-408176,
"1388308015"
],
[
-403744,
"1388308015"
]
],
"rows": 201
}
]
400
Bad Request: Invalid request parameters or malformed request.
401
Unauthorized: Missing or invalid API key. Include X-API-Key header with your request.
403
Forbidden: Invalid API key or insufficient permissions to access this resource.
404
Not Found: Endpoint or resource does not exist.
408
Request Timeout: Request took too long to process. Try again.
500
Internal Server Error: An unexpected error occurred while processing your request.
503
Service Unavailable: The server is temporarily unable to handle the request. Please try again later.
Examples
1. Retrieve the liquidity map for an Orca Whirlpool
This example fetches the liquidity distribution for a specific pool with a resolution of 200 tick intervals, useful for rendering a liquidity depth chart.
curl
curl -X GET "https://api.cambrian.org/solana/orca/pools/liquidity-map?pool_address=DYFk5yvux4mkuQcxkA7H6FWgRQHc1Z7JUb42SJVxnhgG&resolution=200" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
JSON
1[
2 {
3 "columns": [
4 {
5 "name": "mapTick",
6 "type": "Int64"
7 },
8 {
9 "name": "liquidity",
10 "type": "Int256"
11 }
12 ],
13 "data": [
14 [
15 -443632,
16 "1388308015"
17 ],
18 [
19 -439200,
20 "1388308015"
21 ],
22 [
23 -434768,
24 "1388308015"
25 ],
26 [
27 -430336,
28 "1388308015"
29 ],
30 [
31 -425904,
32 "1388308015"
33 ],
34 [
35 -421472,
36 "1388308015"
37 ],
38 [
39 -417040,
40 "1388308015"
41 ],
42 [
43 -412608,
44 "1388308015"
45 ],
46 [
47 -408176,
48 "1388308015"
49 ],
50 [
51 -403744,
52 "1388308015"
53 ]
54 ],
55 "rows": 201
56 }
57]
2 {
3 "columns": [
4 {
5 "name": "mapTick",
6 "type": "Int64"
7 },
8 {
9 "name": "liquidity",
10 "type": "Int256"
11 }
12 ],
13 "data": [
14 [
15 -443632,
16 "1388308015"
17 ],
18 [
19 -439200,
20 "1388308015"
21 ],
22 [
23 -434768,
24 "1388308015"
25 ],
26 [
27 -430336,
28 "1388308015"
29 ],
30 [
31 -425904,
32 "1388308015"
33 ],
34 [
35 -421472,
36 "1388308015"
37 ],
38 [
39 -417040,
40 "1388308015"
41 ],
42 [
43 -412608,
44 "1388308015"
45 ],
46 [
47 -408176,
48 "1388308015"
49 ],
50 [
51 -403744,
52 "1388308015"
53 ]
54 ],
55 "rows": 201
56 }
57]
x402 Payment Option
This endpoint supports pay-per-use access via the x402 payment protocol (v2): pay $0.05 USDC per request using blockchain micropayments. No API key required.
Quickstart (Typescript)
bash
npm install @x402/fetch @x402/evm viem
TypeScript
1import { x402Client } from "@x402/core/client";
2import { ExactEvmScheme } from "@x402/evm/exact/client";
3import { wrapFetchWithPayment } from "@x402/fetch";
4import { privateKeyToAccount } from "viem/accounts";
5const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
6const client = new x402Client();
7client.register("eip155:*", new ExactEvmScheme(signer));
8const fetchWithPayment = wrapFetchWithPayment(fetch, client);
9const response = await fetchWithPayment(
10 "https://x402.cambrian.org/solana/orca/pools/liquidity-map"
11);
12const data = await response.json();
2import { ExactEvmScheme } from "@x402/evm/exact/client";
3import { wrapFetchWithPayment } from "@x402/fetch";
4import { privateKeyToAccount } from "viem/accounts";
5const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
6const client = new x402Client();
7client.register("eip155:*", new ExactEvmScheme(signer));
8const fetchWithPayment = wrapFetchWithPayment(fetch, client);
9const response = await fetchWithPayment(
10 "https://x402.cambrian.org/solana/orca/pools/liquidity-map"
11);
12const data = await response.json();
Quickstart (Python)
bash
pip install "x402[httpx]"
Python
1import asyncio, os
2from eth_account import Account
3from x402 import x402Client
4from x402.http.clients import x402HttpxClient
5from x402.mechanisms.evm import EthAccountSigner
6from x402.mechanisms.evm.exact.register import register_exact_evm_client
7async def main():
8 client = x402Client()
9 account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
10 register_exact_evm_client(client, EthAccountSigner(account))
11 async with x402HttpxClient(client) as http:
12 response = await http.get("https://x402.cambrian.org/solana/orca/pools/liquidity-map")
13 print(response.json())
14asyncio.run(main())
2from eth_account import Account
3from x402 import x402Client
4from x402.http.clients import x402HttpxClient
5from x402.mechanisms.evm import EthAccountSigner
6from x402.mechanisms.evm.exact.register import register_exact_evm_client
7async def main():
8 client = x402Client()
9 account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
10 register_exact_evm_client(client, EthAccountSigner(account))
11 async with x402HttpxClient(client) as http:
12 response = await http.get("https://x402.cambrian.org/solana/orca/pools/liquidity-map")
13 print(response.json())
14asyncio.run(main())
Payment Flow
- Send a normal request to the endpoint (no API key needed)
- Server returns 402 Payment Required with payment details
- The x402 SDK automatically signs a payment authorization with your wallet
- The SDK resubmits the request with the signed payment
- Server verifies payment and returns the API response
The x402 SDK handles steps 2 through 5 automatically.
Network: Base (chain ID 8453) | Currency: USDC | Price: $0.05 per request