TRON - Estimate Fee and FeeLimit for TRX, TRC10 and TRC20

Transaction fees on the TRON network are calculated based on energy, bandwidth, and transaction type.

How Tron Transaction fees Are Calculated

TRX Transfers

  • Cost: Bandwidth only.
  • Free Bandwidth: Each account receives 5,000 points per day.
  • Paid Bandwidth: If points are exhausted, the sender pays 1 byte = 10 SUN (1 TRX = 1,000,000 SUN).
  • Bandwidth consumption = size of transaction in bytes × 10 SUN

Smart Contract Interactions (e.g. TRC10, TRC20 transfers)

  • Cost: Energy + Bandwidth (+ Activation, if missing)
  • Bandwidth is still consumed as above.
  • Energy is required to execute contract logic.
  • If the sender lacks enough energy, TRX will be consumed instead:
    • energyRequired × energyFeePerUnit (in SUN)

Query Transactions

  • Free. No energy or bandwidth consumed.

“FAILED - Out of Energy” When Sending TRC-10 / TRC-20 Tokens

Transferring tokens like USDT (TRC-20) can fail if:

  • The wallet has insufficient TRX.
  • The sender lacks energy and bandwidth.
  • The account is not activated (new accounts require a flat TRX activation fee).

Example TRC-20 Fee Calculation Flow

When transferring USDT (TRC-20) from wallets with no TRX, you’ll need to pre-fund the account with enough TRX to cover:

  1. Energy cost
  2. Bandwidth cost
  3. Account activation fee (if missing)

Step-by-step Calculation Flow

  1. Get account resource stats:
    • Current TRX balance, energy, and bandwidth
    • Use Tatum APIs, TronScan or other sources
  2. Fetch energy fee per unit:
    • Example: 280 SUN per unit (retrieved via Tatum)
      curl --location 'https://tron-mainnet.gateway.tatum.io/wallet/getchainparameters' \
      --header 'x-api-key: {YOUR_API_KEY}'
      //look for:
              {
                  "key": "getEnergyFee",
                  "value": 280
              },
      ...
      
  3. Estimate energy needed:
    • Apply an overall estimate: 90,000 energy units
    • Subtract existing energy from step 1

      📘

      Note

      The USDT TRC-20 contract, one of the most widely used on TRON, usually consumes ~85,000–95,000 SUN as energy to perform a transfer() function.

  4. Calculate energy cost:
    • missingEnergy × energyFeePerUnit → in SUN
  5. Estimate bandwidth usage:
    • Typical assumed size: ~300 bytes
    • Subtract available net bandwidth (if available)
    • missingBytes × 1000 SUN
  6. Add activation fee (if account is unactivated):
    • Example of a flat: 14 TRX = 14,000,000 SUN
  7. Sum total cost in SUN:
    • totalFee = energyCost + bandwidthCost + activationFee (if needed)
  8. Subtract existing TRX balance (non-frozen!):
    • missingTRX = totalFeeInSUN / 1,000,000 - currentTRX
  9. This should provide the minimum TRX required to fund the wallet before sending the token.