GoonFi API: Solana Trades, Prices, OHLC and Volume
For real-time + last ~30 days, use the Trading cube. Trading.Trades gives you clean, MEV-filtered GoonFi swaps with USD price, market cap, and supply on every row across 10 chains in one API. Use this page when you need historical GoonFi data older than ~30 days, raw per-swap detail, or call / event context.
GoonFi Trades in Real-Time
This streams a message for every new GoonFi trade, carrying the buy and sell sides, the block and the transaction. Open it in the Bitquery IDE: realtime GoonFi trades.
subscription {
Solana {
DEXTrades(
where: {
Trade: {
Dex: {
ProgramAddress: {
is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE"
}
}
}
}
) {
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
}
}
}
}
Market cap (Trading API)
Use Trading Pairs with Market.Program goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE (GoonFi v2 DEX program) for aggregated market cap, FDV, supply, price, and volume. Replace solana:<mint> in Token.Id with your token.
Get latest market cap for a specific GoonFi v2 token
limit: { count: 1 }, orderBy: { descending: Block_Time }, Token.Id with includesCaseInsensitive, interval duration > 1 second, Market.Program matching GoonFi v2.
Open it in the Bitquery IDE: GoonFi token market cap.
Click to expand GraphQL query
{
Trading {
Trades(
where: {
Pair: {
Market: {
Program: { is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE" }
Network: { is: "Solana" }
}
Token: { Address: { is: "So11111111111111111111111111111111111111112" } }
QuoteToken: {
Address: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" }
}
}
Block: { Time: { since_relative: { days_ago: 1 } } }
}
) {
volumeUsd: sum(of: AmountsInUsd_Base)
buy_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
sell_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Sell" } })
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
}
}
}
Stream GoonFi v2 tokens with market cap above $10K
Subscribe when the token is on Solana, Market.Program is GoonFi v2, 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: {
Token: { Id: { includesCaseInsensitive: "solana" } }
Interval: { Time: { Duration: { gt: 1 } } }
Supply: { MarketCap: { gt: 10000 } }
Market: { Program: { is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE" } }
}
) {
Currency {
Name
Id
Symbol
}
Token {
Name
Symbol
Id
Address
Network
}
Market {
Protocol
ProtocolFamily
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
}
}
}
Latest Price of a Token on GoonFi
This returns the most recent trade for a token on GoonFi, with the price in the quote token and in USD.
Open it in the Bitquery IDE: latest price of a GoonFi token.
{
Solana {
DEXTradeByTokens(
limit: {count: 1}
orderBy: {descending: Block_Time}
where: {Trade: {Dex: {ProgramAddress: {is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE"}}, Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
Currency{
Name
Symbol
MintAddress
}
}
}
}
}
Realtime Price feed of a Token on GoonFi
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: GoonFi realtime price feed.
subscription{
Solana {
DEXTradeByTokens(
where: {Trade: {Dex: {ProgramAddress: {is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE"}}, Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
Currency{
Name
Symbol
MintAddress
}
}
}
}
}
GoonFi OHLC API - query
For OHLC candles on a GoonFi pair, use this endpoint 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: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE"}}, 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
}
}
}
GoonFi Realtime OHLC, Price, Volume API - Crypto Price API
Below API will give you realtime prices, OHLC, and volume data for all GoonFi trading pairs. We have selected 1 sec as the interval for the OHLC, volume or moving average calculation. You can select any other interval as well like 5 sec, 30 sec, 60 sec, 3600 sec, etc.
Try the API here.
subscription MyQuery {
Trading {
Pairs(
where: {Market: {Program: {is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE"}, Network: {is: "Solana"}}, Interval: {Time: {Duration: {eq: 1}}}}
) {
Interval {
Time {
Duration
Start
End
}
}
Market {
Name
Address
Program
}
Token {
Name
Symbol
Address
}
Price {
Average {
Estimate
ExponentialMoving
Mean
SimpleMoving
WeightedSimpleMoving
}
Ohlc {
Open
High
Low
Close
}
}
Volume {
Base
Quote
Usd
}
QuoteToken {
Name
Symbol
Address
}
}
}
}
Get the Top Traders of a specific Token on GoonFi DEX
This ranks the wallets trading a given token on GoonFi, here USDC (EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v). Run it as a plain request, not a WebSocket subscription: aggregates are recomputed per message on a subscription, so the totals come back wrong. Open it in the Bitquery IDE: GoonFi top traders.
query TopTraders($token: String) {
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "volumeUsd"}
limit: {count: 100}
where: {Trade: {Currency: {MintAddress: {is: $token}}, Dex: {ProgramAddress: {is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE"}}}, 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 on GoonFi
This uses the Trading cube rather than the chain-level DEXTradeByTokens. Every Trading row carries a vetted USD price, and the cube covers roughly the last 30 days in full. For older ranges, DEXTradeByTokens aggregates on the archive and combined datasets are available from June 2024.
Side is the trader's own side. The pair is written WSOL/USDC because that is how the Trading cube orients this market; the USD total is the same either way, but the buy and sell split follows the base token. Widen days_ago for longer windows, and for spans beyond a few days prefer Trading.Pairs with sum(of: Volume_Usd) over hourly intervals, which is pre-aggregated and much cheaper than scanning every trade.
{
Trading {
Trades(
where: {
Pair: {
Market: {
Program: { is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE" }
Network: { is: "Solana" }
}
Token: { Address: { is: "So11111111111111111111111111111111111111112" } }
QuoteToken: {
Address: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" }
}
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
) {
volumeUsd: sum(of: AmountsInUsd_Base)
buy_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
sell_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Sell" } })
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
traders: count(distinct: Trader_Address)
}
}
}
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.