Trader pairs

Returns 200 DEX trades by token on Solana, where account owner is 38hKur…9QRq, side type is buy 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 3 times · Bitquery API v2

What it returns

Filters

The query

query ($trader: String, $time_10min_ago: DateTime, $time_1h_ago: DateTime, $time_3h_ago: DateTime) {
  Solana(aggregates: only) {
    DEXTradeByTokens(
      orderBy: {descendingByField: "usd"}
      where: {Trade: {
        Side: {
          Type: {is: buy}
        }
        Account: {Owner: {is: $trader}}}, 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

{
  "trader": "38hKurCp1vqoT381gU9SixT3RXWWMigzEr7RjF9W9QRq",
  "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