Skip to main content

Tron Network API

The SQD Network provides high-performance access to Tron blockchain data through optimized gateways. This eliminates the need for running your own Tron node while providing faster sync times than direct RPC access.
The Tron API of SQD Network is currently in beta. Breaking changes may be introduced in future releases.

Gateway Endpoint

Mainnet

processor.setGateway("https://v2.archive.subsquid.io/network/tron-mainnet");

Full API Documentation

Complete reference for the Tron SQD Network API

How It Works

SQD Network distributes requests over a network of workers that specialize in serving specific block ranges:
  1. Router: The main gateway URL points to a router that coordinates access
  2. Workers: Multiple workers handle the actual data retrieval for different block ranges
  3. Efficient sync: Parallel data retrieval from multiple workers for faster indexing

Basic Usage

main.ts
import { TronBatchProcessor } from "@subsquid/tron-processor";
import { TypeormDatabase } from "@subsquid/typeorm-store";

const processor = new TronBatchProcessor()
  .setGateway("https://v2.archive.subsquid.io/network/tron-mainnet")
  .setRpcEndpoint("https://api.trongrid.io")
  .setBlockRange({ from: 50000000 })
  .addLog({
    address: ["TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"], // USDT
  });

processor.run(new TypeormDatabase(), async (ctx) => {
  for (let block of ctx.blocks) {
    for (let log of block.logs) {
      // Process USDT transfer events
    }
  }
});

Benefits

Fast Sync

Retrieve historical data 10-100x faster than RPC

Cost Effective

No need to run your own archive node

Reliable

High availability with automatic failover

Optimized

Batch processing and parallel data retrieval

Supported Data

The Tron SQD Network API provides access to:
  • Transactions: All transaction data including smart contract calls
  • Logs: Event logs from smart contracts
  • Internal Transactions: Traces of internal contract-to-contract calls
  • Blocks: Block headers and metadata
  • Account State: Balance and state changes
For real-time data, the processor automatically falls back to RPC endpoints after syncing historical data from SQD Network.

Next Steps

The SQD Network is particularly beneficial for indexing large amounts of historical data, such as all TRC-20 token transfers or complex DeFi protocol interactions.