Token pairs

Returns 100 DEX trades by token on Solana, sorted by USD, highest first: currency symbol, currency name, currency mint address, side currency symbol, side currency name, side currency mint address, price in USD and 4 more fields.

By Aleksey · saved 14 August 2024 · run 2 times · Bitquery API v2

What it returns

The query

query($time_10min_ago: DateTime, $time_1h_ago: DateTime) {
  Solana(aggregates: only) {
    DEXTradeByTokens(
    orderBy: {descendingByField: "usd"}
    limit: {count: 100}) {
      Trade {
        Currency {
          Symbol
          Name
          MintAddress
        }
        
        Side {
          Currency {
         		Symbol
          	Name
          	MintAddress
          }
        }
        price_last: PriceInUSD(maximum: Block_Slot)
        price_10min_ago: PriceInUSD(maximum: Block_Slot if: {Block: {Time: {before: $time_10min_ago}}})
        price_1h_ago: PriceInUSD(maximum: Block_Slot if: {Block: {Time: {before: $time_1h_ago}}})
      }
      
    
      dexes: uniq(of: Trade_Dex_ProgramAddress)
      amount: sum(of: Trade_Side_Amount)
      usd: sum(of: Trade_Side_AmountInUSD)
      count(selectWhere: {ge: "100"})
    }
  }
}

Variables

{"time_10min_ago": "2024-08-14T12:00:00Z",
  "time_1h_ago": "2024-08-14T11:00:00Z"
}

Similar queries