Skip to main content

Orbic API

Need real-time Orbic data or anything from the last ~30 days?

For real-time + last ~30 days, use the Trading cube. Trading.Trades gives you clean, MEV-filtered Orbic swaps with USD price, market cap, and supply on every row across 10 chains in one API. Use this page when you need historical Orbic data older than ~30 days, raw per-swap detail, or call / event context.

Orbic Trades in Real-Time​

This streams a message for every new trade on the venue, carrying the buy and sell sides, the block and the transaction. You can run the query here

subscription {
Solana {
DEXTrades(
where: {
Trade: {
Dex: {
ProgramAddress: {
is: "obriQD1zbpyLz95G5n7nJe6a4DPjpFwa5XYPoNm113y"
}
}
}
}
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Currency {
Name
Symbol
MintAddress
}
Amount
Account {
Address
}
PriceAgainstSellCurrency: Price
}
Sell {
Account {
Address
}
Amount
Currency {
Name
Symbol
MintAddress
}
PriceAgainstBuyCurrency: Price
}
}
Block {
Time
}
}
}
}

Latest Price of a Token on Orbic​

This returns the most recent trade for a mint, with the price in the quote currency and in USD.

Open it in the Bitquery IDE: latest price.

{
Solana {
DEXTradeByTokens(
limit: {count: 1}
orderBy: {descending: Block_Time}
where: {Trade: {Dex: {ProgramAddress: {is: "obriQD1zbpyLz95G5n7nJe6a4DPjpFwa5XYPoNm113y"}}, Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
}
}
}
}

Realtime Price feed of a Token on Orbic​

The same filter as a subscription pushes a message on every new trade, giving a live price feed instead of a single reading.

Open it in the Bitquery IDE: realtime price feed.

subscription{
Solana {
DEXTradeByTokens(
where: {Trade: {Dex: {ProgramAddress: {is: "obriQD1zbpyLz95G5n7nJe6a4DPjpFwa5XYPoNm113y"}}, Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
}
}
}
}

Orbic OHLC API​

If you want to get OHLC data for any specific currency pair on Orbic, you can use this api. Only use this API as query and not subscription websocket as Aggregates and Time Intervals don't work well with subscriptions.

{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "Block_Timefield"}
where: {Trade: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}, Dex: {ProgramAddress: {is: "obriQD1zbpyLz95G5n7nJe6a4DPjpFwa5XYPoNm113y"}}, PriceAsymmetry: {lt: 0.1}}}
limit: {count: 10}
) {
Block {
Timefield: Time(interval: {in: minutes, count: 1})
}
volume: sum(of: Trade_Amount)
Trade {
high: Price(maximum: Trade_Price)
low: Price(minimum: Trade_Price)
open: Price(minimum: Block_Slot)
close: Price(maximum: Block_Slot)
}
count
}
}
}

Get the Top Traders of a specific Token on Orbic DEX​

This ranks the wallets trading one mint on the venue, USDC in the example. Run it as a plain request rather than a WebSocket subscription, because aggregates are recomputed per message on a subscription and the totals come back wrong. Open it in the Bitquery IDE: top traders on Orbic

query TopTraders($token: String) {
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "volumeUsd"}
limit: {count: 100}
where: {Trade: {Currency: {MintAddress: {is: $token}}, Dex: {ProgramAddress: {is: "obriQD1zbpyLz95G5n7nJe6a4DPjpFwa5XYPoNm113y"}}}, Transaction: {Result: {Success: true}}}
) {
Trade {
Account {
Owner
}
Side {
Account {
Address
}
Type
}
}
bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}})
sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}})
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
{
"token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}

Get trading volume, buy volume, sell volume of a token​

This sums traded, buy and sell volume for a mint on the venue. It reads the archive dataset because this program's trading is historical rather than current; run the latest-trade query above to see how recent the newest row is. Note that Solana archive and combined return about a fifth fewer trades than realtime over a window both cover, so treat these totals as a floor. Open it in the Bitquery IDE: trade volume.

query MyQuery {
Solana(dataset: archive) {
DEXTradeByTokens(
where: {Block: {Time: {since: "2025-03-10T07:00:00Z"}}, Transaction: {Result: {Success: true}}, Trade: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}, Dex: {ProgramAddress: {is: "obriQD1zbpyLz95G5n7nJe6a4DPjpFwa5XYPoNm113y"}}}}
) {
Trade {
Currency {
MintAddress
Decimals
}
Side {
Currency {
Name
MintAddress
}
}
}
traded_volume_USD: sum(of: Trade_Side_AmountInUSD)
traded_volume: sum(of: Trade_Amount)
buy_volume: sum(
of: Trade_Side_AmountInUSD
if: {Trade: {Side: {Type: {is: buy}}}}
)
sell_volume: sum(
of: Trade_Side_AmountInUSD
if: {Trade: {Side: {Type: {is: sell}}}}
)
}
}
}
Build with Bitquery

Ready to run this in production?

Get an API key and run these queries in minutes, or talk to us about plans and enterprise delivery.