trade1

Returns DEX trades by token on Solana, where currency mint address is 4DMdMa…pump and block time since 2024-11-21: currency name, currency mint address, currency symbol, decimals, token standard, URI, price in USD and 16 more fields.

By yinxi · saved 22 November 2024 · run 2 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($token_address: String, $start_time: DateTime) {
  Solana {
    DEXTradeByTokens(
      where: {Transaction: {Result: {Success: true}}, Trade: {Currency: {MintAddress: {is: $token_address}}}, Block: {Time: {since: $start_time}}}
    ) {
      Trade {
        Currency {
          Name
          MintAddress
          Symbol
          Decimals
          TokenStandard
          Uri
        }
        end: PriceInUSD
        Dex {
          ProtocolName
          ProtocolFamily
          ProgramAddress
        }
        Market {
          MarketAddress
        }
        Side {
          Currency {
            Symbol
            Name
            MintAddress
          }
        }
        Account {
          Address
        }
        Amount
        AmountInUSD
        Price
        PriceAsymmetry
      }
      makers: count(distinct: Transaction_Signer)
      makers_5min: count(
        distinct: Transaction_Signer
        if: {Block: {Time: {after: $start_time}}}
      )
      buyers: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: buy}}}}
      )
      buyers_5min: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $start_time}}}
      )
      sellers: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: sell}}}}
      )
      sellers_5min: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $start_time}}}
      )
      trades: count
      trades_5min: count(if: {Block: {Time: {after: $start_time}}})
      traded_volume: sum(of: Trade_Side_AmountInUSD)
      traded_volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {after: $start_time}}}
      )
      buy_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}}
      )
      buy_volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $start_time}}}
      )
      sell_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}}
      )
      sell_volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $start_time}}}
      )
      buys: count(if: {Trade: {Side: {Type: {is: buy}}}})
      buys_5min: count(
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $start_time}}}
      )
      sells: count(if: {Trade: {Side: {Type: {is: sell}}}})
      sells_5min: count(
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $start_time}}}
      )
      Block {
        Time
      }
      ChainId
    }
  }
}

Variables

{"token_address":"4DMdMa1vaPLRrvJQW5EJty7tGzfYVVUCop22faN5pump","start_time":"2024-11-21T09:05:00Z"}

Similar queries