query_dex_

Returns DEX trades on Solana, where DEX protocol name is raydium_amm, block time after 2025-05-06 and buy amount in USD is above 10: buy currency symbol, buy currency mint address, sell currency symbol, sell currency mint address, average of trade buy price, sum of trade buy amount and sum of trade sell amount.

By Omkar_BQ · saved 7 May 2025 · run 1 time · Bitquery API v2

What it returns

Filters

The query

query Pairs($exchangeName: String!, $programAddress: [String!], $from: DateTime!, $minTradeAmount: String!, $fromPrice: DateTime!) {
  Solana(network: solana) {
    DEXTrades(
      where: {Trade: {Buy: {AmountInUSD: {gt: $minTradeAmount}}, Dex: {ProtocolName: {is: $exchangeName}, ProgramAddress: {in: $programAddress}}}, Block: {Time: {after: $from}}, Transaction: {Result: {Success: true}}}
    ) {
      Trade {
        Buy {
          Currency {
            Symbol
            MintAddress
          }
        }
        Sell {
          Currency {
            Symbol
            MintAddress
          }
        }
      }
      buyPrice: average(of: Trade_Buy_Price, if: {Block: {Time: {after: $fromPrice}}})
      buyAmount: sum(of: Trade_Buy_Amount)
      sellAmount: sum(of: Trade_Sell_Amount)
    }
  }
}

Variables

{"exchangeName":"raydium_amm","from":"2025-05-06T09:22:12.184Z","fromPrice":"2025-05-07T09:17:12.184Z","minTradeAmount":"10"}

Similar queries