ton token with workchain

Returns 100 DEX trades by token on TON, where block time since 2024-10-20, sorted by buy, highest first: currency symbol, currency name, smart contract address, workchain, price in USD and sum of trade side amount in USD.

By Nadia · saved 23 October 2024 · run 3 times · Bitquery API v2

What it returns

Filters

The query

query ($time_ago: DateTime) {
  Ton {
    DEXTradeByTokens(
      orderBy: {descendingByField: "buy"}
      limit: {count: 100}
      where: {Block: {Time: {since: $time_ago}}, Trade: {Success: true}}
    ) {
      Trade {
        Currency {
          Symbol
          Name
          SmartContract {
            Address
            Workchain
          }
        }
        price_last: PriceInUSD(maximum: Block_Number)
        price_1h_ago: PriceInUSD(minimum: Block_Number)
      }
      usd: sum(of: Trade_Side_AmountInUSD)
      buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}})
      sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}})
    }
  }
}

Variables

{
  "time_ago": "2024-10-20T05:27:19Z"
}

Similar queries