Copy of traded pairs of a token NOT working

Returns 200 DEX trades by token on Solana, where side currency symbol is USDT and currency symbol is BONK, 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 Emmanuel Chappat · saved 8 December 2024 · Bitquery API v2

What it returns

Filters

The query

query ($token: String, $time_10min_ago: DateTime, $time_1h_ago: DateTime) {
  Solana {
    DEXTradeByTokens(
      orderBy: {descendingByField: "usd"}
        where: {Trade: {Side: {Currency: {Symbol: {in: ["USDT"]}}}, Currency: {Symbol: {is: $token}}}}
      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

{
  "token": "BONK",
  "time_10min_ago": "2024-09-19T12:02:23Z",
  "time_1h_ago": "2024-09-19T11:12:23Z",
  "time_3h_ago": "2024-09-19T09:12:23Z"
}

Similar queries