Documentation Index Fetch the complete documentation index at: https://docs.codex.io/llms.txt
Use this file to discover all available pages before exploring further.
Confirmed vs. unconfirmed events: Use the commitmentLevel argument to choose which events you receive.
confirmed — receive events only after they’re confirmed on-chain. This is the default if commitmentLevel is not specified.
processed — receive events as soon as they’re observed on-chain (unconfirmed; may be reorged out). You must explicitly set commitmentLevel: processed to opt in. Currently available on Solana only.
This endpoint requires a Growth or Enterprise plan. Learn more . Returns See OnBarsUpdatedResponse The contract address for the pair.
The network ID the pair is deployed on.
The ID for the pair (pairAddress:networkId).
The unix timestamp for the new bar.
The sortKey for the bar (blockNumber#transactionIndex#logIndex, zero padded). For example, 0000000016414564#00000224#00000413.
Price data broken down by resolution. For processed updates, this is a confirmed-shaped compatibility projection.
See ResolutionBarData 1 second resolution.
See CurrencyBarData The timestamp for the bar.
Bar chart data in USD.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
Bar chart data in the network’s base token.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
5 second resolution.
See CurrencyBarData The timestamp for the bar.
Bar chart data in USD.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
Bar chart data in the network’s base token.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
15 second resolution.
See CurrencyBarData The timestamp for the bar.
Bar chart data in USD.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
Bar chart data in the network’s base token.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
30 second resolution.
See CurrencyBarData The timestamp for the bar.
Bar chart data in USD.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
Bar chart data in the network’s base token.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
1 minute resolution.
See CurrencyBarData The timestamp for the bar.
Bar chart data in USD.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
Bar chart data in the network’s base token.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
5 minute resolution.
See CurrencyBarData The timestamp for the bar.
Bar chart data in USD.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
Bar chart data in the network’s base token.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
15 minute resolution.
See CurrencyBarData The timestamp for the bar.
Bar chart data in USD.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
Bar chart data in the network’s base token.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
30 minute resolution.
See CurrencyBarData The timestamp for the bar.
Bar chart data in USD.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
Bar chart data in the network’s base token.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
60 minute resolution.
See CurrencyBarData The timestamp for the bar.
Bar chart data in USD.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
Bar chart data in the network’s base token.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
4 hour resolution.
See CurrencyBarData The timestamp for the bar.
Bar chart data in USD.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
Bar chart data in the network’s base token.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
12 hour resolution.
See CurrencyBarData The timestamp for the bar.
Bar chart data in USD.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
Bar chart data in the network’s base token.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
1 day resolution.
See CurrencyBarData The timestamp for the bar.
Bar chart data in USD.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
Bar chart data in the network’s base token.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
1 week resolution.
See CurrencyBarData The timestamp for the bar.
Bar chart data in USD.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
Bar chart data in the network’s base token.
See IndividualBarData The timestamp for the bar.
The volume with higher precision.
The volume in the network’s base token
The number of unique buyers
The number of unique sellers
The number of transactions
The USD value of pool fees collected
The USD value of base fees (gas) paid
The USD value of priority fees (tips) paid
The USD value of builder tips (MEV) paid
The USD value of L1 data posting fees (L2 rollups only)
The address of the token being quoted
Arguments The ID of the pair (address:networkId).
The token of interest within the pair. Can be token0 or token1.
See QuoteToken
subscription {
onBarsUpdated (
pairId : "BGm1tav58oGcsQJehL9WXBFXF7D27vZsKefj4xJKD5Y:1399811149"
quoteToken : token0
) {
pairAddress
pairId
networkId
timestamp
quoteToken
quoteTokenAddress
eventSortKey
statsType
aggregates {
r1 {
usd {
t
o
h
l
c
v
volume
buyers
sellers
buys
sells
buyVolume
sellVolume
liquidity
transactions
}
}
r5 {
usd {
t
o
h
l
c
v
}
}
r60 {
usd {
t
o
h
l
c
v
}
}
}
}
}
{
"data" : {
"onBarsUpdated" : {
"pairAddress" : "BGm1tav58oGcsQJehL9WXBFXF7D27vZsKefj4xJKD5Y" ,
"pairId" : "BGm1tav58oGcsQJehL9WXBFXF7D27vZsKefj4xJKD5Y:1399811149" ,
"networkId" : 1399811149 ,
"timestamp" : 1769559142 ,
"quoteToken" : "token0" ,
"quoteTokenAddress" : "So11111111111111111111111111111111111111112" ,
"eventSortKey" : "0000000396370575#00001095#00000000#00000012" ,
"statsType" : "UNFILTERED" ,
"aggregates" : {
"r1" : {
"usd" : {
"t" : 1769559120 ,
"o" : 126.91645786 ,
"h" : 126.91645786 ,
"l" : 126.906300653 ,
"c" : 126.906300653 ,
"v" : 16608 ,
"volume" : "16607.75618360923" ,
"buyers" : 5 ,
"sellers" : 0 ,
"buys" : 7 ,
"sells" : 0 ,
"buyVolume" : "16607" ,
"sellVolume" : "0" ,
"liquidity" : "1495261.94023" ,
"transactions" : 7
}
},
"r5" : {
"usd" : {
"t" : 1769559000 ,
"o" : 126.909482001 ,
"h" : 126.91645786 ,
"l" : 126.904001603 ,
"c" : 126.906300653 ,
"v" : 16727
}
},
"r60" : {
"usd" : {
"t" : 1769558400 ,
"o" : 127.033618681 ,
"h" : 127.035495596 ,
"l" : 126.78034421 ,
"c" : 126.906300653 ,
"v" : 52148
}
}
}
}
}
}
Usage Guidelines
Subscribe using pairId in the format pairAddress:networkId
Set quoteToken to token0 or token1 to specify which token in the pair is being priced
aggregates contains OHLCV bar data across multiple resolutions simultaneously (e.g., r1 for 1-minute, r5 for 5-minute, r60 for 1-hour, r1D for 1-day)
Each resolution provides both usd (USD-denominated) and token (native token-denominated) bars
Use o, h, l, c for open/high/low/close prices, and v for volume
Granular trade metrics like buyers, sellers, buyVolume, and sellVolume are available per bar for trade flow analysis
Updates are streamed in real-time with every on-chain swap event
Troubleshooting Tips
What resolutions are available?
Resolutions range from 1-second (r1S) up to 1-week (r1W): r1S, r5S, r15S, r30S, r1 (1 min), r5, r15, r30, r60, r240 (4h), r720 (12h), r1D, r1W. You only need to request the resolutions you need in your query.
What's the difference between usd and token bars?
usd bars are denominated in US dollars, while token bars are denominated in the paired token (e.g., USDC). Use usd for standard price charts and token for relative price analysis against the quote token.
How do I choose the right quoteToken?
quoteToken selects which token in the pair is being priced. For example, in a SOL/USDC pair where SOL is token0, setting quoteToken: token0 returns the price of SOL in terms of USDC, while token1 returns the price of USDC in terms of SOL. Check the pair metadata to confirm which token is token0 vs token1.
What does statsType: Filtered vs Unfiltered mean?
Filtered excludes suspected bot and sandwich attack transactions for cleaner price data. Unfiltered includes all transactions. Most charting use cases should use Filtered for more accurate price representation.
How often are updates sent?
Updates are sent in real-time with every swap event on the pair. High-volume pairs (e.g., SOL/USDC on Solana) may produce many updates per second, while low-volume pairs update less frequently.
Charts : Render token charts with OHLCV data and real-time updates