buy_sells_USD_cuenta

Returns DEX trades by token on Solana, where side currency mint address is So1111…1112 or 111111…1111, block time after 2025-02-13 and block time before 2026-02-09: currency symbol, currency name, currency mint address, count, sum of trade amount and sum of trade side amount in USD.

By min · saved 13 February 2025 · Bitquery API v2

What it returns

Filters

The query

query MyQuery($from: DateTime, $to: DateTime, $trader: String) {
  Solana(dataset: combined) {
    DEXTradeByTokens(
      where: {
        Block: { Time: {after: $from, before: $to} }
        Trade: {
          Side: {
            Currency: {
              MintAddress: {
                in: [
                  "So11111111111111111111111111111111111111112"
                  "11111111111111111111111111111111"
                ]
              }
            }
          }
        }
        any: [
          { Trade: { Account: { Address: { is: $trader } } } }
          { Trade: { Account: { Token: { Owner: { is: $trader } } } } }
        ]
      }
    ) {
      Trade {
        Currency {
          Symbol
          Name
          MintAddress
        }
      }
      buyAmount: count(if: { Trade: { Side: { Type: { is: buy } } } })
      sellAmount: count(if: { Trade: { Side: { Type: { is: sell } } } })
      buyValue: sum(
        of: Trade_Amount
        if: { Trade: { Side: { Type: { is: buy } } } }
      )
      sellValue: sum(
        of: Trade_Amount
        if: { Trade: { Side: { Type: { is: sell } } } }
      )      
      buyValueUSD: sum( 
        of: Trade_Side_AmountInUSD 
        if: { Trade: { Side: { Type: { is: buy } } } }
      )
      sellValueUSD: sum( 
        of: Trade_Side_AmountInUSD 
        if: { Trade: { Side: { Type: { is: sell } } } }
      )
    }
  }
}

Variables

{
  "from": "2025-02-13T00:00:00Z",
  "to":   "2026-02-09T20:00:00Z",
  "trader": "5mmGGdGcDyB14Gb2ixS54SDRrGQ9JBdhAuGMgBsWBEs3"
}

Similar queries