Historical tron token trades beyond 30 days

Historical data This query already reads history - it uses the archive dataset, which needs the historical data add-on for this chain. Without the add-on it fails with 'access restricted: your plan only allows realtime'. Drop the dataset argument to fall back to the recent window. Datasets: https:/

By Kshitij Mahajan · saved 25 June 2026 · Bitquery API v2

What it returns

Filters

The query

# Historical data
#   This query already reads history - it uses the archive dataset, which
#   needs the historical data add-on for this chain.
#
#   Without the add-on it fails with 'access restricted: your plan only allows
#   realtime'. Drop the dataset argument to fall back to the recent window.
#
# Datasets:  https://docs.bitquery.io/docs/graphql/dataset/archive/
# Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retention/
#
# For more info on the endpoint visit -
# https://docs.bitquery.io/docs/blockchain/Tron/
# For faster results try using indexed feilds in where and orderBy clause -
# https://docs.bitquery.io/docs/graphql/indexed-fields-reference/

query MyQuery {
  Tron(dataset: archive) {
    DEXTradeByTokens(
      orderBy: {descending: Block_Number}
      where: {Trade: {Currency: {SmartContract: {is: "TPFqcBAaaUMCSVRCqPaQ9QnzKhmuoLR6Rc"}}}, Block: {Date: {since_relative: {months_ago: 6}, till_relative: {months_ago: 4}}}}
    ) {
      Block {
        Time
        Number
      }
      Trade {
        Amount
        AmountInUSD
        Buyer
        Currency {
          Name
          Symbol
          SmartContract
          Decimals
        }
        Dex {
          ProtocolFamily
          ProtocolName
          SmartContract
        }
        Seller
        Side {
          Currency {
            Name
            Symbol
            SmartContract
            Decimals
          }
          Type
        }
      }
      Transaction {
        Hash
      }
    }
  }
}

Similar queries