Copy of Buys, Sells, BuyVolume, SellVolume, Makers, TotalTradedVolume, PriceinUSD for a eth pair

Returns DEX trades by token on Solana, where currency mint address is EPjFWd…Dt1v, block time since 2024-11-10 and block time till 2024-12-10: currency name, currency mint address, currency symbol, price in USD, side currency symbol, side currency name, side currency mint address and 6 more fields.

By kirill · saved 12 December 2024 · run 3 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($token: String, $from_date_time: DateTime, $to_date_time: DateTime) {
  Solana(dataset: combined) {
    DEXTradeByTokens(
      where: {Transaction: {Result: {Success: true}}, Trade: {Currency: {MintAddress: {is: $token}}, PriceInUSD: {ne: 0}}, Block: {Time: {since: $from_date_time, till: $to_date_time}}}
    ) {
      Trade {
        TargetToken: Currency {
          Name
          MintAddress
          Symbol
        }
        current_price: PriceInUSD(maximum: Block_Time)
        PairedToken: Side {
          Currency {
            Symbol
            Name
            MintAddress
          }
        }
        Dex {
          ProtocolName
          ProtocolFamily
          ProgramAddress
        }
        Pool: Market {
          PoolAddress: MarketAddress
        }
      }
      traded_volume: sum(of: Trade_Side_AmountInUSD)
      buy_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}}
      )
      sell_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}}
      )
      buys: count(if: {Trade: {Side: {Type: {is: sell}}}})
      sells: count(if: {Trade: {Side: {Type: {is: buy}}}})
    }
  }
}

Variables

{
  "token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "from_date_time": "2024-11-10T03:20:00Z", "to_date_time": "2024-12-10T04:15:00Z"
}

Similar queries