Most TRON fee code I see handles energy carefully and treats bandwidth as noise. That is mostly fair: energy is the expensive line. But bandwidth has one rule that surprises people, and it decides whether the second transfer of the day is free or not.
This post reads both resources from code, shows how big a USDT transaction is in bytes, and explains the all-or-nothing rule.
Two resources, two meters
A TRC-20 transfer is a smart-contract call, so it pays twice:
- Energy pays for execution inside the TVM. A USDT
transferto an address that already holds USDT uses 64,285 energy. - Bandwidth pays for the size of the transaction in bytes. One byte = one bandwidth point.
They are independent. Renting or staking energy does nothing for bandwidth, and the other way round. You can sit on 1,000,000 energy and still burn TRX on bandwidth.
Read the network parameters, do not hard-code them
Both prices are chain parameters set by vote. Read them:
const { TronWeb } = require('tronweb'); const tronWeb = new TronWeb({ fullHost: 'https://api.trongrid.io', headers: { 'TRON-PRO-API-KEY': process.env.TRONGRID_KEY }, }); async function feeParams() { const params = await tronWeb.trx.getChainParameters(); const get = (k) => params.find((p) => p.key === k)?.value; return { sunPerByte: get('getTransactionFee'), // 1000 today sunPerEnergy: get('getEnergyFee'), // 100 today freeBandwidthPerDay: get('getFreeNetLimit'), // 600 today }; } At the time of writing mainnet returns 1000 sun per byte, 100 sun per energy unit and 600 free bandwidth points per account per day.
How many bytes is a USDT transfer?
I pulled five recent USDT transfers and read their receipts with gettransactioninfobyid. Every one of them had a 211-byte raw_data, one signature and the same bandwidth bill: net_usage: 345 when it was paid from bandwidth, or net_fee: 345000 (sun) when it was burned.
You can estimate the size before you broadcast. Build the transaction, take the raw bytes, add the signature and the framing:
const USDT = 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t'; async function estimateBandwidth(from, to, amount) { const { transaction } = await tronWeb.transactionBuilder.triggerSmartContract( USDT, 'transfer(address,uint256)', { feeLimit: 30_000_000 }, [ { type: 'address', value: to }, { type: 'uint256', value: amount }, ], from ); const rawBytes = transaction.raw_data_hex.length / 2; const signatures = 1; // more for a multisig permission // 65 bytes per signature, ~70 bytes of protobuf framing and result space return rawBytes + 65 * signatures + 70; } For a plain USDT transfer that gives 346, within a byte of what the node charges. It moves by a few bytes with a longer feeLimit varint, a memo in data, or extra signatures on a multisig account. That is why rental packages and wallet UIs round it to about 360.
Read what the account has left
getAccountResources returns both pools. Fields that are zero are often missing, so default them:
async function bandwidthLeft(address) { const r = await tronWeb.trx.getAccountResources(address); const free = (r.freeNetLimit || 0) - (r.freeNetUsed || 0); const staked = (r.NetLimit || 0) - (r.NetUsed || 0); // own stake + delegated to you return { free, staked }; } tronpy has the same call:
from tronpy import Tron from tronpy.providers import HTTPProvider client = Tron(HTTPProvider(api_key="YOUR_TRONGRID_KEY")) def bandwidth_left(address: str) -> dict: r = client.get_account_resource(address) free = r.get("freeNetLimit", 0) - r.get("freeNetUsed", 0) staked = r.get("NetLimit", 0) - r.get("NetUsed", 0) return {"free": free, "staked": staked} Used bandwidth recovers gradually over a 24-hour window, so free depends on when the last transactions went out, not on the calendar day.
The all-or-nothing rule
This is the part that breaks naive estimates. The node does not top up a shortfall. For each transaction it tries, in order:
- Staked bandwidth (yours or delegated to you). If it covers the whole transaction, it is used.
- Free daily bandwidth. Same condition: the whole transaction or nothing.
- Otherwise it burns TRX for all the bytes at
getTransactionFee.
So with 600 free points and 345-byte transfers:
| Transfer today | Free points left before | Paid with | Cost |
|---|---|---|---|
| 1st | 600 | free bandwidth | 0 TRX |
| 2nd | 255 | burned | 0.345 TRX |
| 3rd | 255 | burned | 0.345 TRX |
The 255 points left over never get used by a USDT transfer. Having 300 bandwidth does not halve the fee, it changes nothing.
In code:
async function bandwidthBurnTrx(from, bytes) { const { free, staked } = await bandwidthLeft(from); if (staked >= bytes || free >= bytes) return 0; const { sunPerByte } = await feeParams(); return (bytes * sunPerByte) / 1e6; } The full fee for one transfer
Put both meters together and you get the number to show a user or to set feeLimit against:
async function transferCostTrx(from, to, amount) { const { sunPerEnergy } = await feeParams(); const sim = await tronWeb.transactionBuilder.triggerConstantContract( USDT, 'transfer(address,uint256)', {}, [{ type: 'address', value: to }, { type: 'uint256', value: amount }], from ); const r = await tronWeb.trx.getAccountResources(from); const energyLeft = (r.EnergyLimit || 0) - (r.EnergyUsed || 0); const energyBurn = Math.max(0, sim.energy_used - energyLeft) * sunPerEnergy / 1e6; const bytes = await estimateBandwidth(from, to, amount); return { energyBurn, bandwidthBurn: await bandwidthBurnTrx(from, bytes) }; } Unlike bandwidth, energy does cover a partial shortfall: available energy is used first and only the rest is burned. feeLimit caps the energy side only; bandwidth burn is charged outside it.
What actually matters for the bill
With no resources at all, one regular USDT transfer costs about 6.43 TRX for energy and 0.345 TRX for bandwidth. Energy is roughly 95 % of it. Optimise that first. A transfer to an address with zero USDT doubles the energy side, which I covered in an earlier post.
Bandwidth starts to matter in two cases: a hot wallet that sends dozens of transactions a day (every one after the first burns 0.345 TRX), and a fresh address whose free pool is already spent. The original bandwidth vs energy guide walks through those profiles without code.
Where renting fits
Both resources can be delegated to an address for a short window instead of staked. At Overtron a 65K energy package for one transfer costs 2.26 TRX against about 6.5 TRX burned, and 360 bandwidth for an hour costs 0.22 TRX against 0.36 TRX. Delegation goes to a public address, no private keys, and lands in 10 to 60 seconds. There is also a Telegram bot.
Whatever you use, check staked >= bytes before you assume a transaction is free.
Originally published at overtron.io.

