Transaction fees
Every Toncoin (TON) user should keep in mind that fees depend on many factors.
Gas
All computation is measured in gas units; each operation has a fixed gas cost.
The price of gas units is determined by the chain configuration and may be changed only by consensus of validators. Note that, unlike in some other systems, the user cannot set their own gas price, and there is no fee market. Users can cap spend via the attached value and bounce
.
Current settings in the Basechain are as follows: 1 unit of gas costs 400 nanotons.
1 gas = 26214400 / 2^16 nanotons = 0.0000004 TON
Current settings in the Masterchain are as follows: 1 unit of gas costs 10000 nanotons.
1 gas = 655360000 / 2^16 nanotons = 0.00001 TON
Average transaction cost
TL;DR: A basic transaction typically costs approximately 0.003 TON
Gas price is defined in Network Config: param 20 and 21.
Gas price voting process
The gas fee, like many other parameters of TON, is configurable and may be changed by a special vote made in the mainnet.
Changing configuration parameters requires approval via configuration proposals, generally more than 3/4 (75%) of validators by weight, confirmed across rounds. See Changing the parameters and Governance: config.
Could gas cost more?
Does it mean that one day gas prices could rise by 1,000 times or even more?
Technically, yes; but in fact, no.
Validators receive a small fee for processing transactions, and charging higher commissions would lead to a decrease in the number of transactions, making the validation process less beneficial.
How are fees calculated?
Fees on TON are difficult to calculate in advance, as their amount depends on transaction run time, account status, message content and size, blockchain network settings, and a number of other variables that cannot be calculated until the transaction is sent.
Some NFT marketplaces over‑provision funds and refund the remainder; amounts vary by marketplace.
Each contract should check incoming messages for the amount of TON attached to ensure it is enough to cover the fees.
Check the low-level fees overview to learn more about the formulas for calculating commissions and fees calculation to learn how to calculate fees in FunC contracts using the new TVM opcodes.
The following sections describe how fees work on TON.
Basic fees formula
Fees on TON are calculated by this formula:
transaction_fee = storage_fees
+ in_fwd_fees // also called import fee
+ computation_fees
+ action_fees
+ out_fwd_fees
// Welcome to LIVE editor! // feel free to change any variables // Check https://retracer.ton.org/?tx=b5e14a9c4a4e982fda42d6079c3f84fa48e76497a8f3fca872f9a3737f1f6262 function FeeCalculator() { // Config param 25 (fees): https://tonviewer.com/config#25 — names mirror config fields const lump_price = 400000; const bit_price = 26214400; const cell_price = 2621440000; const ihr_price_factor = 98304; const first_frac = 21845; const nano = 10 ** -9; const bit16 = 2 ** 16; const ihr_disabled = 0; // First, define whether IHR will be counted let fwd_fee = lump_price + Math.ceil((bit_price * 0 + cell_price * 0) / bit16); let ihr_fee; if (ihr_disabled) { ihr_fee = 0; } else { ihr_fee = Math.ceil((fwd_fee * ihr_price_factor) / bit16); } let total_fwd_fees = fwd_fee + ihr_fee; let gas_fees = 0.0011976; // Gas fees out of scope here let storage_fees = 0.000000003; // And storage fees as well let total_action_fees = +((fwd_fee * first_frac) / bit16).toFixed(9); let import_fee = lump_price + Math.ceil((bit_price * 528 + cell_price * 1) / bit16); let total_fee = gas_fees + storage_fees + // total_action_fees * nano + <- already included in total_fwd_fees import_fee * nano + total_fwd_fees * nano; // <- not included in explorer's total fee return ( <div> <p> Total fee: {+total_fee.toFixed(9)} TON</p> <p> Action fee: {+(total_action_fees * nano).toFixed(9)} TON </p> <p> Fwd fee: {+(total_fwd_fees * nano).toFixed(9)} TON </p> <p> Import fee: {+(import_fee * nano).toFixed(9)} TON </p> <p> IHR fee: {+(ihr_fee * nano).toFixed(9)} TON </p> </div> ); }
Note: The constants above are defined in nanotons; the displayed outputs are in TON. Variable names mirror configuration fields in param 25 (fees).
Elements of the transaction fee
storage_fees
is the amount you pay for storing a smart contract in the blockchain. In fact, you pay for every second the smart contract is stored on the blockchain.- Example: your TON wallet is also a smart contract, and it pays a storage fee every time you receive or send a transaction. Read more about how storage fees are calculated.
in_fwd_fees
is a charge for importing messages only from outside the blockchain, e.g.,external
messages. Every time you make a transaction, it must be delivered to the validators who will process it. For ordinary messages from contract to contract, this fee is not applicable. Read the TON Blockchain paper to learn more about inbound messages.- Example: each transaction you make with your wallet app (like Tonkeeper) requires first to be distributed among validators.
computation_fees
is the amount you pay for executing code in the virtual machine. Computation fees depend on executed operations (gas used), not code size.- Example: each time you send a transaction with your wallet (which is a smart contract), you execute the code of your wallet contract and pay for it.
action_fees
is a charge for sending outgoing messages made by a smart contract, updating the smart contract code, updating the libraries, etc.out_fwd_fees
is a charge for forwarding outgoing internal messages within TON between shardchains; it depends on message size and routing via HR/IHR.
FAQ
Here are the most frequently asked questions about TON:
Fees for sending Toncoin?
The average fee for sending any amount of Toncoin is 0.0055 TON (source: fee calculator).
Fees for sending Jettons?
The average fee for sending any amount of custom Jettons is 0.037 TON (source: fee calculator).
Cost of minting NFTs?
The average fee for minting one NFT is 0.08 TON (source: fee calculator).
Cost of saving data in TON?
Saving 1 MB of data for one year on TON will cost approximately 6.01 TON. Note that you usually don't need to store large amounts of data on-chain. Consider using TON Storage if you need decentralized storage. For a calculation method, see the calculator example.
Is it possible to send a gasless transaction?
Gasless transactions can be implemented with wallet v5 and a relayer that pays fees.
How to calculate fees?
There is an article about fee calculation in TON Blockchain.
References
- Based on “Commissions on TON” (The Daily TON, 2022‑07‑22) — contributed by @menschee. Source: telegra.ph
See also
- Low-level fees overview—read about the formulas for calculating commissions.
- Reference FunC snippet for computing forward fees: https://github.com/ton-blockchain/token-contract/blob/5046bca227c08497e83e0ad4992337a309176341/misc/forward-fee-calc.fc