10 min read
|
Published
|
Updated

TRON Fees: Ultimate Guide + Free Calculator

How TRON fees work: bandwidth and energy, the 600 free daily bandwidth, burn rates in sun, a worked USDT example and ways to reduce the cost.

Chapters
C
Chaingateway Team
Blockchain Experts

Reviewed by Maurice Sobiera

TRON fees are the resources a transaction consumes on the TRON network. Bandwidth pays for the transaction’s size in bytes. Energy pays for the work of executing a smart contract, such as a TRC20 transfer. If your account lacks either resource, the network burns TRX to cover the difference. This guide shows how to calculate both costs.

To estimate the fees of a specific transaction, use the Chaingateway Tron Fee Calculator.

What are TRON network fees?

TRON charges for two resources instead of a single gas price. The TRON resource model defines them as follows.

ResourceMeasuresUsed byFree allowance
BandwidthSize of the transaction in bytesEvery transaction except queries600 per account per day
EnergyComputation in the TRON Virtual MachineDeploying or calling a smart contractNone

A plain TRX transfer or a TRC10 token transfer needs bandwidth only. A TRC20 transfer is a contract call, so it needs bandwidth and energy. If you do not have enough of a resource, TRX is burned at a fixed rate. Both resources recover over 24 hours.

You obtain resources in three ways: by staking TRX, by receiving delegated resources from another account, or, for bandwidth, from the daily free allowance. These values are network parameters that governance proposals can change. You can read the current prices with GET /api/v2/tron/chainparameters in the Chaingateway API. The response contains getTransactionFee (the bandwidth price in sun per byte) and getEnergyFee (the energy price in sun per unit). One TRX is 1,000,000 sun.

How do I calculate the bandwidth fee?

The bandwidth fee is the transaction size in bytes multiplied by the bandwidth price. The resource model document gives a price of 1,000 sun, or 0.001 TRX, per byte when TRX is burned. The deduction order is staked bandwidth first, then the free daily allowance, then burned TRX.

To get the size, build the transaction without broadcasting it and measure its raw_data_hex. The java-tron client adds fixed parts to the serialized transaction: a result allowance of 64 bytes (MAX_RESULT_SIZE_IN_TX in java-tron) and the signature. A signature is 65 bytes (PER_SIGN_LENGTH) plus 2 bytes of protobuf framing. The raw_data field also needs a tag and a length prefix. According to the protobuf encoding rules, the length takes two bytes when raw_data is 128 bytes or longer, so the wrapper is 3 bytes.

raw_data_hex length: 262 hex characters
raw_data bytes: 262 / 2 = 131
wrapper (tag+length) 1 + 2 = 3
signature 65 + 2 = 67
result allowance = 64
bandwidth = 131 + 3 + 67 + 64 = 265 bytes

A TRX transfer of this shape consumes 265 bandwidth. The free allowance of 600 covers two such transfers per day. A third transfer would burn 265 × 1,000 sun, which is 0.265 TRX, unless the account has staked bandwidth.

How do I calculate the energy fee?

The energy fee is the energy a contract call uses multiplied by the energy price. When TRX is burned, the resource model document gives a price of 100 sun, or 0.0001 TRX, per unit. Staked or delegated energy is used first. There is no free daily energy.

The energy a call needs depends on the contract and on the state it changes. For a USDT transfer, our calculator uses about 64,000 energy when the recipient already holds the token and about 134,000 when the recipient does not, because writing a new balance entry costs more than updating one. At 100 sun per unit, that is about 6.4 TRX and 13.4 TRX.

To measure a specific call instead of using a rule of thumb, use the node’s estimateenergy method. It simulates the call and returns the energy it would use, but the node must run with vm.estimateEnergy=true. You can also run the call in the Tron Fee Calculator, which needs no node.

Older screenshot of the Tron Fee Calculator showing energy consumed, bandwidth consumed and the TRX cost of staking versus burning for a TRC20 transfer

The screenshot shows an earlier version of the calculator. Its Paymaster result refers to Chaingateway’s legacy Paymaster, which is deprecated. See the section on reducing fees below.

What limits the cost of a contract call?

The fee_limit caps the TRX that a contract call can burn. It is an integer in sun, with an upper bound set by the network. The same resource model document gives the maximum as 15,000 TRX (15,000,000,000 sun), and the Chaingateway chain parameters call returns it as getMaxFeeLimit.

If a call needs more energy than your staked energy and the fee_limit cover, the execution fails, and the energy used so far is not refunded. A call that crashes or times out consumes all the energy allowed for that transaction. Set a fee_limit slightly above your estimate and no higher than you are willing to lose.

How can I reduce TRON fees?

You can reduce fees by staking TRX for resources, by renting energy, or by batching work so that fewer contract calls are needed. Staking removes the burn cost for as long as your resources cover the transfers. The energy a transfer needs does not depend on the amount sent, so one transfer of 5,000 USDT costs far less than fifty transfers of 100 USDT.

TronFuel rents energy from stakers, so the sending wallet does not need TRX. It is a separate service with its own documentation. Chaingateway’s legacy Paymaster endpoints remain available for existing integrations, but new integrations should use TronFuel. The article on saving on TRC20 transaction fees compares the options. Chaingateway has a 7-day free trial if you want to try the API.

How we write these articles

Ready to build this yourself? Get your API key — 7-day trial, no card required — or see the Tron API for the full endpoint reference.

C
Chaingateway Team
Blockchain Experts

The Chaingateway team is dedicated to simplifying blockchain integration for developers worldwide.