ton dexmarket

Returns 200 DEX trades by token on TON, where DEX protocol family is StonFi and block time after 2024-10-19, sorted by USD, highest first: currency symbol, currency name, smart contract address, workchain, fungible, side currency symbol, side currency name and 6 more fields.

By Nadia · saved 22 October 2024 · Bitquery API v2

What it returns

Filters

The query

query ($market: String, $time_10min_ago: DateTime, $time_1h_ago: DateTime, $time_3h_ago: DateTime, $time_ago: DateTime) {
            Ton {
              DEXTradeByTokens(
                orderBy: {descendingByField: "usd"}
                where: {Trade: {Dex: {ProtocolFamily: {is: $market}}}, Transaction:  {Success: true}, Block: {Time: {after: $time_ago}}}
                limit: {count: 200}
              ) {
                Trade {
                  Currency {
                    Symbol
                    Name
                    SmartContract{Address Workchain}
                    Fungible
                  }
                  Side {
                    Currency {
                      Symbol
                      Name
                      SmartContract{Address Workchain}
                    }
                  }
                  price_usd: PriceInUSD(maximum: Block_Number)
                  price_last: Price(maximum: Block_Number)
                  price_10min_ago: Price(
                    maximum: Block_Number
                    if: {Block: {Time: {before: $time_10min_ago}}}
                  )
                  price_1h_ago: Price(
                    maximum: Block_Number
                    if: {Block: {Time: {before: $time_1h_ago}}}
                  )
                  price_3h_ago: Price(
                    maximum: Block_Number
                    if: {Block: {Time: {before: $time_3h_ago}}}
                  )
                }
                usd: sum(of: Trade_AmountInUSD)
                count
              }
            }
          }

Variables

{"market":"StonFi",
  "time_10min_ago": "2024-10-22T11:32:21Z",
  "time_1h_ago": "2024-10-22T10:42:21Z",
  "time_3h_ago": "2024-10-22T08:42:21Z",
  "time_ago": "2024-10-19T11:42:21Z",
  "usdc": "EQB-MPwrd1G6WKNkLz_VnV6WqBDd142KMQv-g1O-8QUA3728",
  "usdt": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
  "pton": "EQAyvcnP0RexLvnsQMXfKYnk18Bzl3Y-iGt6bXqFB75ugXmE",
  "min_count": "10"
}

Similar queries