ton pair latest trades

Returns the latest 50 DEX trades by token on TON, where side smart contract address is EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs, smart contract address is EQCvxJy4eG8hyHBFsZ7eePxrRsUQSFE_jpptRAYBmcG_DOGS and block time since 2024-10-18: block time, transaction hash, protocol family, protocol name, currency symbol, smart contract address, workchain and 11 more fields.

By Srdjan Stankovic · saved 21 October 2024 · Bitquery API v2

What it returns

Filters

The query

query LatestTrades($token: String, $base: String, $time_ago: DateTime) {
  Ton {
    DEXTradeByTokens(
      orderBy: { descending: Block_Time }
      limit: { count: 50 }
      where: {
        Trade: {
          Side: {
            Amount: { gt: "0" }
            Currency: { SmartContract: { Address: { is: $token } } }
          }
          Currency: { SmartContract: { Address: { is: $base } } }
        }
        Block: { Time: { since: $time_ago } }
      }
    ) {
      Block {
        allTime: Time
      }
      Transaction {
        Hash
      }
      Trade {
        Dex {
          ProtocolFamily
          ProtocolName
        }
        Currency {
          Symbol
          SmartContract {
            Address
            Workchain
          }
          Name
        }
        PriceInUSD
        AmountInUSD
        Amount
        Side {
          Type
          Currency {
            Symbol
            SmartContract {
              Address
              Workchain
            }
            Name
          }
          AmountInUSD
          Amount
        }
      }
    }
  }
}

Variables

{
  "token": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
  "base": "EQCvxJy4eG8hyHBFsZ7eePxrRsUQSFE_jpptRAYBmcG_DOGS",
	"time_ago": "2024-10-18T18:14:15Z"
}

Similar queries