Skip to main content

Byreal API

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

Use the Trading cubeTrading.Trades for swap-level rows and Trading.Pairs for OHLC, volume, and market cap. Both include USD price and supply on every row. For historical data older than ~30 days and historical aggregates (OHLC, volume, top traders), see Historical Solana aggregate data.

Bitquery provides real-time and historical data APIs and streams for Byreal, a Solana trading protocol. For prices, OHLC, volume, market cap, and trader analytics over the last ~30 days, use the Crypto Price API (Trading.Pairs) and Crypto Trades API (Trading.Trades), filtering by Market.Program REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2.

For historical aggregates going back to May 2024 — OHLC candlesticks, volume, and time-bucketed analytics on DEXTradeByTokens with dataset: combined or dataset: archive — see Historical Solana aggregate data. Filter those queries by Trade.Dex.ProgramAddress REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2 for Byreal-specific history.

Need zero-latency Byreal data? Read about our Shred Streams and Contact us for a Trial.

note

To query or stream data via GraphQL outside the Bitquery IDE, you need to generate an API access token.

Follow the steps here to create one: How to generate Bitquery API token ➤

Byreal Trades in Real-Time — Crypto Trades API

Stream new Byreal swaps via Trading.Trades with USD price, market cap, FDV, supply, trader address, and transaction metadata on every row. Filter by Pair.Market.Program REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2.

For schema details, see the Crypto Trades API and Supply fields.

Run the subscription in the Bitquery IDE.

Click to expand GraphQL subscription
subscription {
Trading {
Trades(
where: {
Pair: {
Market: {
Network: { is: "Solana" }
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
}
}
) {
Side
Price
PriceInUsd
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
Trader {
Address
}
TransactionHeader {
Hash
Fee
FeePayer
}
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Block {
Time
Timestamp
}
Pair {
Market {
Address
Program
Protocol
ProtocolFamily
Network
}
Token {
Address
Id
Symbol
Network
}
QuoteToken {
Address
Id
Symbol
Network
}
}
}
}
}

Stream live prices for a specific Byreal token

Lock onto one token with Pair.Token.Id (e.g. bid:solana:<mint>) and the Byreal program address.

Run the subscription in the Bitquery IDE.

Click to expand GraphQL subscription
subscription {
Trading {
Trades(
where: {
Pair: {
Market: {
Network: { is: "Solana" }
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
Token: { Id: { is: "bid:solana:token Mint Address" } }
}
}
) {
Side
Price
PriceInUsd
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
Trader {
Address
}
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Block {
Time
}
Pair {
Token {
Address
Symbol
}
QuoteToken {
Address
Symbol
}
}
}
}
}

Market cap — Crypto Price API

Use Trading.Pairs with Market.Program REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2 for aggregated market cap, FDV, supply, price, and volume. Replace solana:<mint> in Token.Id with your token.

See the Pairs cube for full field reference.

Get latest market cap for a specific Byreal token

Run the query in the Bitquery IDE.

Click to expand GraphQL query
{
Trading {
Pairs(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Token: { Address: { is: "token address here" } }
Interval: { Time: { Duration: { gt: 1 } } }
Market: {
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
}
) {
Token {
Name
Id
Address
Symbol
}
Block {
Time
}
Market {
Program
Protocol
ProtocolFamily
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
}
}
}

Stream Byreal tokens with market cap above $10K

Subscribe when the token is on Solana, Market.Program is Byreal, Supply.MarketCap > 10,000 (USD), and interval duration > 1 second. Adjust gt to change the threshold.

Run the subscription in the Bitquery IDE.

Click to expand GraphQL subscription
subscription {
Trading {
Pairs(
where: {
Interval: { Time: { Duration: { gt: 1 } } }
Supply: { MarketCap: { gt: 10000 } }
Market: {
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
}
) {
Currency {
Name
Id
Symbol
}
Token {
Name
Symbol
Id
Address
Network
}
Market {
Protocol
ProtocolFamily
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
}
}
}

Latest Price of a Token on Byreal — Crypto Price API

Returns the latest OHLC close, average price, and volume for a Byreal pair via Trading.Pairs. Replace token Mint Address with your SPL mint. Adjust Interval.Time.Duration for the candle size (e.g. 60 for 1-minute bars).

Run the query in the Bitquery IDE.

Click to expand GraphQL query
{
Trading {
Pairs(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Market: {
Network: { is: "Solana" }
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
Token: { Address: { is: "token Mint Address" } }
Interval: { Time: { Duration: { eq: 60 } } }
}
) {
Block {
Time
}
Market {
Address
Program
Protocol
ProtocolFamily
}
Token {
Address
Name
Symbol
}
QuoteToken {
Address
Symbol
}
Price {
IsQuotedInUsd
Average {
Mean
}
Ohlc {
Open
High
Low
Close
}
}
Volume {
Base
Quote
Usd
}
Supply {
MarketCap
FullyDilutedValuationUsd
TotalSupply
}
}
}
}

Byreal OHLC API — Crypto Price API

Fetch historical OHLC candles for a Byreal pair. Set Interval.Time.Duration to your bar size in seconds (60 = 1 minute, 3600 = 1 hour). Use as a query for historical bars; use a subscription for live candle updates.

Run the query in the Bitquery IDE.

Click to expand GraphQL query
{
Trading {
Pairs(
limit: { count: 100 }
orderBy: { descending: Block_Time }
where: {
Market: {
Network: { is: "Solana" }
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
Token: { Address: { is: "token Mint Address" } }
Interval: { Time: { Duration: { eq: 60 } } }
}
) {
Block {
Time
}
Interval {
Time {
Start
End
Duration
}
}
Token {
Address
Symbol
}
QuoteToken {
Address
Symbol
}
Price {
IsQuotedInUsd
Ohlc {
Open
High
Low
Close
}
}
Volume {
Base
Quote
Usd
}
}
}
}

Get the Top Traders of a specific Token on Byreal — Crypto Trades API

Ranks wallets by quoted USD volume on Byreal for a given token. Use as a query only — aggregates do not work correctly over subscriptions.

Run the query in the Bitquery IDE.

Click to expand GraphQL query
{
Trading {
Trades(
limit: { count: 100 }
orderBy: { descendingByField: "Total_Volume" }
where: {
Block: { Time: { since_relative: { hours_ago: 24 } } }
Pair: {
Market: {
Network: { is: "Solana" }
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
Token: { Id: { is: "bid:solana:token Mint Address" } }
}
}
) {
Trades_count: count
Total_Volume: sum(of: AmountsInUsd_Quote)
buy_volume: sum(of: AmountsInUsd_Quote, if: { Side: { is: "Buy" } })
sell_volume: sum(of: AmountsInUsd_Quote, if: { Side: { is: "Sell" } })
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
Trader {
Address
}
}
}
}

Get Trading Volume, Buy Volume, Sell Volume of a Token on Byreal

Run the query in the Bitquery IDE.

Click to expand GraphQL query
{
Trading {
Trades(
where: {
Block: { Time: { since_relative: { hours_ago: 24 } } }
Pair: {
Market: {
Network: { is: "Solana" }
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
Token: { Id: { is: "bid:solana:token Mint Address" } }
}
}
) {
Trades_count: count
total_volume: sum(of: AmountsInUsd_Quote)
buy_volume: sum(of: AmountsInUsd_Quote, if: { Side: { is: "Buy" } })
sell_volume: sum(of: AmountsInUsd_Quote, if: { Side: { is: "Sell" } })
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
Pair {
Token {
Address
Symbol
}
QuoteToken {
Address
Symbol
}
}
}
}
}

Historical data and aggregates

The Trading APIs on this page cover real-time streams and roughly the last ~30 days of Byreal trades, prices, and OHLC.

For older Byreal history and historical aggregates — OHLC candlesticks, volume buckets, and time-series analytics from May 2024 onward — use chain-level queries on Solana(dataset: combined) or Solana(dataset: archive) with DEXTradeByTokens. Filter by Trade.Dex.ProgramAddress REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2.

See the full guide with working examples: Historical Solana aggregate data.

For a Byreal-specific historical OHLC starting point, try Byreal historical OHLC — DEXTradeByTokens in the IDE (uses Solana(dataset: combined) and Trade.Dex.ProgramAddress REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2).

note

Historical aggregate queries use query only — sum, count, and interval-based OHLC do not work reliably as subscription websockets.

Frequently Asked Questions

What is the Byreal program address on Solana?

REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2. Filter Trading.Trades and Trading.Pairs with Pair.Market.Program or Market.Program.

How do I get Byreal token prices with USD on every row?

Use Trading.Trades filtered by Pair.Market.Program REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2 for real-time and the last ~30 days. Each row includes PriceInUsd, market cap, and supply.

How do I get OHLC for a Byreal pair?

Use Trading.Pairs with Market.Program and Interval.Time.Duration — OHLC is in Price.Ohlc (Open, High, Low, Close). Subscribe for live candles or query for bars within the last ~30 days.

How do I get historical Byreal OHLC and volume older than ~30 days?

Use Solana(dataset: combined) or archive with DEXTradeByTokens, filtered by Trade.Dex.ProgramAddress REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2. See Historical Solana aggregate data for examples.

Do I need an API key outside the IDE?

Yes. Generate an OAuth token from your Bitquery account to run queries in your app or bot.