total bought and total sold of a specific token by a wallet

Returns 10 DEX trades by token on Solana, where currency mint address is 6jTQCF…pump, account owner is GwyG5F…DQDT and block time since 2025-06-25, sorted by buy amount USD, highest first: account owner, currency name, currency mint address, side currency name, side currency symbol, side currency mint address, sum of trade amount and 2 more fields.

By gaurav · saved 16 July 2025 · run 2 times · Bitquery API v2

What it returns

Filters

The query

query ArchiveFrequentTokens {
  Solana(dataset: combined) {
    DEXTradeByTokens(
      orderBy: {descendingByField: "buy_amount_usd"}
      limit: {count: 10}
      where: {Block: {Time: {since: "2025-06-25T00:00:00Z"}}, Trade: {Currency: {MintAddress: {is: "6jTQCFZR8JwvvenVGa3RzGM3a5YEagk9kQXDpHHdpump"}}, Account: {Owner: {is: "GwyG5FQRNtY1faXYWdTLbcDNZTyW5d2Z63o1UiMUDQDT"}}}}
    ) {
      Trade {
        Account {
          Owner
        }
        Currency {
          Name
          MintAddress
        }
        Side{
          Currency{
            Name
            Symbol
            MintAddress
          }
        }
      }
      buy_amount: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}})
      buy_amount_usd: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}}
      )
      sell_amount: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}})
      sell_amount_usd: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}}
      )
      trade_count_buy: count(if: {Trade: {Side: {Type: {is: buy}}}})
      trade_count_sell: count(if: {Trade: {Side: {Type: {is: sell}}}})
    }
  }
}

Similar queries