DEX Market pairs

Returns 200 DEX trades by token on Solana, where DEX protocol family is Raydium and block time after 2024-09-02, sorted by USD, highest first: currency symbol, currency name, currency mint address, fungible, side currency symbol, side currency name, side currency mint address and 4 more fields.

By Aleksey · saved 2 September 2024 · run 7 times · Bitquery API v2

What it returns

Filters

The query

query ($market: String, $time_10min_ago: DateTime, $time_1h_ago: DateTime, $time_3h_ago: DateTime) {
  Solana(aggregates: only) {
    DEXTradeByTokens(
      orderBy: {descendingByField: "usd"}
      where: {Trade: {Dex: {ProtocolFamily: {is: $market}}}, Transaction: {Result: {Success: true}}, Block: {Time: {after: $time_3h_ago}}}
      limit: {count: 200}
    ) {
      Trade {
        Currency {
          Symbol
          Name
          MintAddress
          Fungible
        }
        Side {
          Currency {
            Symbol
            Name
            MintAddress
          }
        }
        price_usd: PriceInUSD(maximum: Block_Slot)
        price_last: Price(maximum: Block_Slot)
        price_10min_ago: Price(
          maximum: Block_Slot
          if: {Block: {Time: {before: $time_10min_ago}}}
        )
        price_1h_ago: Price(
          maximum: Block_Slot
          if: {Block: {Time: {before: $time_1h_ago}}}
        )
        price_3h_ago: PriceInUSD(minimum: Block_Slot)
      }
      usd: sum(of: Trade_AmountInUSD)
      count
    }
  }
}

Variables

{
  "market": "Raydium",
  "time_10min_ago": "2024-09-02T12:52:15Z",
  "time_1h_ago": "2024-09-02T12:02:15Z",
  "time_3h_ago": "2024-09-02T10:02:15Z"
}

Similar queries