Pair DEX list

Returns DEX trades by token on Solana, where currency mint address is EKpQGS…zcjm, side currency mint address is JUPyiw…DvCN and side amount is above 0, sorted by amount, highest first: protocol family, protocol name, sum of trade amount, unique of trade side currency mint address and count.

By Aleksey · saved 14 August 2024 · Bitquery API v2

What it returns

Filters

The query

query($token: String, $base: String) {
  Solana(aggregates: only) {
    DEXTradeByTokens(
      orderBy: {
        descendingByField: "amount"
      }
      where: {
        Trade: {
          Currency: {
            MintAddress: {
              is: $token
            }
          }
          Side: {
            Amount: {gt: "0"},
            Currency: {
              MintAddress: {
              is: $base
            }
            }
          }
        }
        Transaction: {Result: {Success: true}}
      }
    	
    ) {
      Trade {

 				Dex {
          ProtocolFamily
          ProtocolName
          
        }
      }
			amount: sum(of: Trade_Amount)
			pairs: uniq(of: Trade_Side_Currency_MintAddress)      
      trades: count
    }
  }
}

Variables

{
  "token": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm",
    "base": "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN"
}

Similar queries