Cambrian OHLCV (Pool) API
GET /api/v1/solana/ohlcv/pool
Pool OHLCV Data
Retrieve OHLCV (Open, High, Low, Close, Volume) data for individual pool contracts enabling pair-specific price analysis and liquidity venue performance tracking. Essential for liquidity providers analyzing their specific pool performance and traders focusing on particular trading venues.
Business Value
- Pool-Specific Analytics: Track price movements and trading activity for specific liquidity pools to understand venue performance
- Liquidity Provider Insights: Monitor OHLCV metrics for pools where you provide liquidity to optimize returns and assess risk
- Venue Comparison: Compare trading patterns across different pools for the same token pair to identify optimal trading venues
- Historical Price Analysis: Access granular time-series price data with customizable intervals for technical analysis and backtesting
- Volume Tracking: Monitor both base and quote token volumes to understand trading intensity and market depth dynamics
Endpoint Details
URL:
https://opabinia.cambrian.network/api/v1/solana/ohlcv/pool
Method: GET
Authentication: Required via X-API-Key header
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| pool_address | string | Yes | - | Pool/pair contract address (base58 format) |
| after_time | integer | Yes | - | Unix timestamp - start time for data range |
| before_time | integer | Yes | - | Unix timestamp - end time for data range |
| interval | string | Yes | - | Time interval for OHLCV data aggregation. Available values: 1m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w |
Response Field Descriptions
| Response Field | Type | Description |
|---|---|---|
| openPrice | Float64 | Opening price for the time interval |
| highPrice | Float64 | Highest price during the time interval |
| lowPrice | Float64 | Lowest price during the time interval |
| closePrice | Float64 | Closing price for the time interval |
| volumeQuote | Float64 | Trading volume in quote token |
| volumeBase | Float64 | Trading volume in base token |
| unixTime | Nullable(Float64) | Unix timestamp for the interval start |
| interval | String | Time interval (e.g., "1h") |
| poolAddress | FixedString(44) | Pool contract address |
| baseTokenAddress | FixedString(44) | Base token mint address |
| quoteTokenAddress | FixedString(44) | Quote token mint address |
Examples
1. Hourly OHLCV Data for Specific Pool
Retrieve hourly OHLCV data for a Solana pool over a 24-hour period to analyze recent trading patterns and price movements.
curl -X GET "https://opabinia.cambrian.network/api/v1/solana/ohlcv/pool?pool_address=5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6&after_time=1735689600&before_time=1735776000&interval=1h" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
{
"columns": [
{
"name": "openPrice",
"type": "Float64"
},
{
"name": "highPrice",
"type": "Float64"
},
{
"name": "lowPrice",
"type": "Float64"
},
{
"name": "closePrice",
"type": "Float64"
},
{
"name": "volumeQuote",
"type": "Float64"
},
{
"name": "volumeBase",
"type": "Float64"
},
{
"name": "unixTime",
"type": "Nullable(Float64)"
},
{
"name": "interval",
"type": "String"
},
{
"name": "poolAddress",
"type": "FixedString(44)"
},
{
"name": "baseTokenAddress",
"type": "FixedString(44)"
},
{
"name": "quoteTokenAddress",
"type": "FixedString(44)"
}
],
"data": [
[
188.91000369631612,
192.27155639417393,
188.75311778120638,
192.03411242234174,
406283.8498599997,
2129.8661412569995,
1735689600.0,
"1h",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
],
[
192.03412720298522,
192.1959156621166,
189.9735973570173,
190.18832858249917,
451140.73497299955,
2362.9692631860007,
1735693200.0,
"1h",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
],
[
190.18832802245518,
191.5766668691956,
190.04950427631093,
191.1935695373037,
879581.7627479995,
4612.637865911005,
1735696800.0,
"1h",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
],
[
191.04063318392232,
191.0406341282193,
189.61195276700667,
190.12644541964147,
604837.0177969999,
3176.215211070001,
1735700400.0,
"1h",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
],
[
189.9739863001899,
189.97400341153914,
188.98306775870205,
189.0641139332444,
644987.213074,
3404.781868914003,
1735704000.0,
"1h",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
]
],
"rows": 5
// ... additional rows omitted for brevity
}
Returns hourly OHLCV data for the specified pool between SOL (base token) and USDC (quote token). Each data row shows the price range and trading volumes for one-hour intervals, with prices denominated in USDC per SOL.
2. Daily OHLCV Data for Weekly Analysis
Retrieve daily OHLCV data for a pool over a week-long period to understand longer-term price trends and trading patterns.
curl -X GET "https://opabinia.cambrian.network/api/v1/solana/ohlcv/pool?pool_address=5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6&after_time=1735689600&before_time=1736294400&interval=1d" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
{
"columns": [
{
"name": "openPrice",
"type": "Float64"
},
{
"name": "highPrice",
"type": "Float64"
},
{
"name": "lowPrice",
"type": "Float64"
},
{
"name": "closePrice",
"type": "Float64"
},
{
"name": "volumeQuote",
"type": "Float64"
},
{
"name": "volumeBase",
"type": "Float64"
},
{
"name": "unixTime",
"type": "Nullable(Float64)"
},
{
"name": "interval",
"type": "String"
},
{
"name": "poolAddress",
"type": "FixedString(44)"
},
{
"name": "baseTokenAddress",
"type": "FixedString(44)"
},
{
"name": "quoteTokenAddress",
"type": "FixedString(44)"
}
],
"data": [
[
188.91000369631612,
194.89997440963336,
187.6222526066206,
193.8883696079013,
15500000.0,
80000.0,
1735689600.0,
"1d",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
]
],
"rows": 1
}
Returns daily aggregated OHLCV data showing the full day's price range and total trading volume for the pool, useful for identifying multi-day trends and major price movements.
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.
Quick Start (TypeScript)
npm install @x402/fetch @x402/evm viem
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";
const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(signer));
const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const response = await fetchWithPayment(
"https://deep42.cambrian.network/api/v1/solana/ohlcv/pool"
);
const data = await response.json();
Quick Start (Python)
pip install "x402[httpx]"
import asyncio, os
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
async def main():
client = x402Client()
account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
register_exact_evm_client(client, EthAccountSigner(account))
async with x402HttpxClient(client) as http:
response = await http.get("https://deep42.cambrian.network/api/v1/solana/ohlcv/pool")
print(response.json())
asyncio.run(main())
Payment Flow
- Send a normal request to the endpoint (no API key needed)
- Server returns
402 Payment Requiredwith 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–5 automatically.
Network: Base (chain ID 8453) | Currency: USDC | Price: $0.05 per request
Related Endpoints
/api/v1/solana/ohlcv/base-quote- Retrieve granular OHLCV data with separate base and quote token volumes for detailed trading analysis between any two SPL tokens/api/v1/solana/ohlcv/token- Retrieve Open, High, Low, Close, and Volume data for any SPL token/api/v1/solana/tokens- Returns a paginated list of known tokens for the Solana chain/api/v1/solana/tokens/holders- Returns a list of accounts currently holding a specific Solana token/api/v1/solana/tokens/holder-distribution-over-time- This endpoint returns the distribution of token holders over a certain block range