Copy of Copy of market cap of token

Returns DEX trades by token on Solana, where side currency mint address is So1111…1112 and block time since 2025-01-12: count, unique of trade account address, sum of trade side amount, sum of trade side amount in USD, price in USD, currency symbol, currency name and 4 more fields.

By kingery · saved 16 January 2025 · run 3 times · Bitquery API v2

What it returns

Filters

The query

query ($baseTokenAddresses: [String!], $time_5min_ago: DateTime!, $time_15min_ago: DateTime!, $time_30min_ago: DateTime!, $time_1h_ago: DateTime!, $time_4h_ago: DateTime!, $time_24h_ago: DateTime!) {
            Solana {
              DEXTradeByTokens(
                where: {Transaction: {Result: {Success: true}}, Trade: {Currency: {MintAddress: {in: $baseTokenAddresses}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}, Block: {Time: {since: $time_24h_ago}}}
              ) {
                buys_m5: count(
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_5min_ago}}, Transaction: {Result: {Success: true}}}
                )
                sells_m5: count(
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_5min_ago}}, Transaction: {Result: {Success: true}}}
                )
                buyers_m5: uniq(
                  of: Trade_Account_Address
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_5min_ago}}, Transaction: {Result: {Success: true}}}
                )
                sellers_m5: uniq(
                  of: Trade_Account_Address
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_5min_ago}}, Transaction: {Result: {Success: true}}}
                )
                buy_volume_m5: sum(
                  of: Trade_Side_Amount
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_5min_ago}}, Transaction: {Result: {Success: true}}}
                )
                sell_volume_m5: sum(
                  of: Trade_Side_Amount
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_5min_ago}}, Transaction: {Result: {Success: true}}}
                )
                buy_volume_in_usd_m5: sum(
                  of: Trade_Side_AmountInUSD
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_5min_ago}}, Transaction: {Result: {Success: true}}}
                )
                sell_volume_in_usd_m5: sum(
                  of: Trade_Side_AmountInUSD
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_5min_ago}}, Transaction: {Result: {Success: true}}}
                )
                buys_m15: count(
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_15min_ago}}, Transaction: {Result: {Success: true}}}
                )
                sells_m15: count(
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_15min_ago}}, Transaction: {Result: {Success: true}}}
                )
                buyers_m15: uniq(
                  of: Trade_Account_Address
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_15min_ago}}, Transaction: {Result: {Success: true}}}
                )
                sellers_m15: uniq(
                  of: Trade_Account_Address
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_15min_ago}}, Transaction: {Result: {Success: true}}}
                )
                buy_volume_m15: sum(
                  of: Trade_Side_Amount
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_15min_ago}}, Transaction: {Result: {Success: true}}}
                )
                sell_volume_m15: sum(
                  of: Trade_Side_Amount
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_15min_ago}}, Transaction: {Result: {Success: true}}}
                )
                buy_volume_in_usd_m15: sum(
                  of: Trade_Side_AmountInUSD
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_15min_ago}}, Transaction: {Result: {Success: true}}}
                )
                sell_volume_in_usd_m15: sum(
                  of: Trade_Side_AmountInUSD
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_15min_ago}}, Transaction: {Result: {Success: true}}}
                )
                buys_m30: count(
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_30min_ago}}, Transaction: {Result: {Success: true}}}
                )
                sells_m30: count(
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_30min_ago}}, Transaction: {Result: {Success: true}}}
                )
                buyers_m30: uniq(
                  of: Trade_Account_Address
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_30min_ago}}, Transaction: {Result: {Success: true}}}
                )
                sellers_m30: uniq(
                  of: Trade_Account_Address
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_30min_ago}}, Transaction: {Result: {Success: true}}}
                )
                buy_volume_m30: sum(
                  of: Trade_Side_Amount
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_30min_ago}}, Transaction: {Result: {Success: true}}}
                )
                sell_volume_m30: sum(
                  of: Trade_Side_Amount
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_30min_ago}}, Transaction: {Result: {Success: true}}}
                )
                buy_volume_in_usd_m30: sum(
                  of: Trade_Side_AmountInUSD
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_30min_ago}}, Transaction: {Result: {Success: true}}}
                )
                sell_volume_in_usd_m30: sum(
                  of: Trade_Side_AmountInUSD
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_30min_ago}}, Transaction: {Result: {Success: true}}}
                )
                buys_h1: count(
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_1h_ago}}, Transaction: {Result: {Success: true}}}
                )
                sells_h1: count(
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_1h_ago}}, Transaction: {Result: {Success: true}}}
                )
                buyers_h1: uniq(
                  of: Trade_Account_Address
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_1h_ago}}, Transaction: {Result: {Success: true}}}
                )
                sellers_h1: uniq(
                  of: Trade_Account_Address
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_1h_ago}}, Transaction: {Result: {Success: true}}}
                )
                buy_volume_h1: sum(
                  of: Trade_Side_Amount
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_1h_ago}}, Transaction: {Result: {Success: true}}}
                )
                sell_volume_h1: sum(
                  of: Trade_Side_Amount
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_1h_ago}}, Transaction: {Result: {Success: true}}}
                )
                buy_volume_in_usd_h1: sum(
                  of: Trade_Side_AmountInUSD
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_1h_ago}}, Transaction: {Result: {Success: true}}}
                )
                sell_volume_in_usd_h1: sum(
                  of: Trade_Side_AmountInUSD
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_1h_ago}}, Transaction: {Result: {Success: true}}}
                )
                buys_h4: count(
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_4h_ago}}, Transaction: {Result: {Success: true}}}
                )
                sells_h4: count(
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_4h_ago}}, Transaction: {Result: {Success: true}}}
                )
                buyers_h4: uniq(
                  of: Trade_Account_Address
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_4h_ago}}, Transaction: {Result: {Success: true}}}
                )
                sellers_h4: uniq(
                  of: Trade_Account_Address
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_4h_ago}}, Transaction: {Result: {Success: true}}}
                )
                buy_volume_h4: sum(
                  of: Trade_Side_Amount
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_4h_ago}}, Transaction: {Result: {Success: true}}}
                )
                sell_volume_h4: sum(
                  of: Trade_Side_Amount
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_4h_ago}}, Transaction: {Result: {Success: true}}}
                )
                buy_volume_in_usd_h4: sum(
                  of: Trade_Side_AmountInUSD
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_4h_ago}}, Transaction: {Result: {Success: true}}}
                )
                sell_volume_in_usd_h4: sum(
                  of: Trade_Side_AmountInUSD
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_4h_ago}}, Transaction: {Result: {Success: true}}}
                )
                buys_h24: count(
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_24h_ago}}, Transaction: {Result: {Success: true}}}
                )
                sells_h24: count(
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_24h_ago}}, Transaction: {Result: {Success: true}}}
                )
                buyers_h24: uniq(
                  of: Trade_Account_Address
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_24h_ago}}, Transaction: {Result: {Success: true}}}
                )
                sellers_h24: uniq(
                  of: Trade_Account_Address
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_24h_ago}}, Transaction: {Result: {Success: true}}}
                )
                buy_volume_h24: sum(
                  of: Trade_Side_Amount
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_24h_ago}}, Transaction: {Result: {Success: true}}}
                )
                sell_volume_h24: sum(
                  of: Trade_Side_Amount
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_24h_ago}}, Transaction: {Result: {Success: true}}}
                )
                buy_volume_in_usd_h24: sum(
                  of: Trade_Side_AmountInUSD
                  if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_24h_ago}}, Transaction: {Result: {Success: true}}}
                )
                sell_volume_in_usd_h24: sum(
                  of: Trade_Side_AmountInUSD
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_24h_ago}}, Transaction: {Result: {Success: true}}}
                )
                sell_volume_in_usd_h24: sum(
                  of: Trade_Side_AmountInUSD
                  if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_24h_ago}}, Transaction: {Result: {Success: true}}}
                )
                Trade {
                  open_in_usd_m5: PriceInUSD(
                    minimum: Block_Time
                    if: {Block: {Time: {after: $time_5min_ago}}}
                  )
                  close_in_usd_m5: PriceInUSD(
                    maximum: Block_Time
                    if: {Block: {Time: {after: $time_5min_ago}}}
                  )
                  open_in_usd_m15: PriceInUSD(
                    minimum: Block_Time
                    if: {Block: {Time: {after: $time_15min_ago}}}
                  )
                  close_in_usd_m15: PriceInUSD(
                    maximum: Block_Time
                    if: {Block: {Time: {after: $time_15min_ago}}}
                  )
                  open_in_usd_m30: PriceInUSD(
                    minimum: Block_Time
                    if: {Block: {Time: {after: $time_30min_ago}}}
                  )
                  close_in_usd_m30: PriceInUSD(
                    maximum: Block_Time
                    if: {Block: {Time: {after: $time_30min_ago}}}
                  )
                  open_in_usd_h1: PriceInUSD(
                    minimum: Block_Time
                    if: {Block: {Time: {after: $time_1h_ago}}}
                  )
                  close_in_usd_h1: PriceInUSD(
                    maximum: Block_Time
                    if: {Block: {Time: {after: $time_1h_ago}}}
                  )
                  open_in_usd_h4: PriceInUSD(
                    minimum: Block_Time
                    if: {Block: {Time: {after: $time_4h_ago}}}
                  )
                  close_in_usd_h4: PriceInUSD(
                    maximum: Block_Time
                    if: {Block: {Time: {after: $time_4h_ago}}}
                  )
                  open_in_usd_h24: PriceInUSD(
                    minimum: Block_Time
                    if: {Block: {Time: {after: $time_24h_ago}}}
                  )
                  close_in_usd_h24: PriceInUSD(
                    maximum: Block_Time
                    if: {Block: {Time: {after: $time_24h_ago}}}
                  )
                  Currency {
                    Symbol
                    Name
                    MintAddress
                  }
                  Side {
                    Currency {
                      Symbol
                      Name
                      MintAddress
                    }
                  }
                }
              }
            }
          }

Variables

{
  "token":["9yBr75m6TBZzQqHeh1ztfv454pmqAiAvHUHdpPQcpump", "CNx1LrMuYCQx6hdfUDdWUE537sgkMj9kYb355cHZpump"],
  "side_token": "So11111111111111111111111111111111111111112",
  "pair_address": "4AZRPNEfCJ7iw28rJu5aUyeQhYcvdcNm8cswyL51AY9i",
	"time_5min_ago": "2025-01-13T07:43:10Z",
  "time_15min_ago": "2025-01-13T07:33:10Z",
  "time_30min_ago": "2025-01-13T07:18:10Z",
  "time_1h_ago": "2025-01-13T06:48:10Z",
  "time_4h_ago": "2025-01-13T03:48:10Z",
  "time_24h_ago": "2025-01-12T07:43:10Z"
}

Similar queries