본문으로 건너뛰기

Transaction Fees

Every TOS user should keep in mind that commission depends on many factors.

Gas

All fees are calculated in Gas. It's a special currency for fees in TOS.

All fees are nominated and fixed in a certain gas amount, but the gas price itself is not fixed. Today the price for gas is:

1 gas = 1000 nanotoss = 0,000 001 TOS

Average transaction cost

TLDR: Today, every transaction costs around ~0.005 TOS

Even if TOS price increases 100 times, transactions will remain ultra-cheap; less than $0.01. Moreover, validators may lower this value if they see commissions have become expensive read why they're interested.

정보

The current gas amount is written in the Network Config param 20.

Gas changing voting process

The gas fee, like many other parameters of TOS, is configurable and may be changed by a special vote made in the mainnet.

Changing any parameter requires getting 66% of the validator votes.

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 will lead to a decrease in the number of transactions which will make the validating process less beneficial.

How to calculate fees?

Fees on TOS 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. Read about computation fees in low-level article overview.

That is why even NFT marketplaces usually take an extra amount of TOS (~1 TOS) and return (1 - transaction_fee) later.

However, let's read more about how fees are supposed to function on TOS.

Basic Fees Formula

According to the low-level fees overview, fees on TOS are calculated by this formula:

transaction_fee = storage_fees
+ in_fwd_fees
+ computation_fees
+ action_fees
+ out_fwd_fees

Elements of 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 TOS 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 from outside the blockchain. Every time you make a transaction, it must be delivered to the validators who will process it.
    • Example: each transaction you make with your wallet app (like Toskeeper) requires first to be distributed among validation nodes.
  • computation_fees is the amount you pay for executing code in the virtual machine. The larger the code, the more fees must be paid.
    • 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.
  • out_fwd_fees stands for a charge for sending messages outside from TOS Blockchain to interact with off-chain services (e.g., logs) and external blockchains.
    • Not used because it's not implemented. So today is equal to 0.

Storage fee

TOS validators collect storage fees from smart contracts.

Storage fees are collected from the smart contract balance at the Storage phase of any transaction. Read more about phases and how TVM works here.

It’s important to keep in mind that on TOS you pay for both the execution of a smart contract and for the used storage:

bytes * second

It means you have to pay a storage fee for having TOS Wallet (even if it's very-very small).

If you have not used your TOS Wallet for a significant period of time (1 year), you will have to pay a significantly larger commission than usual because the wallet pays commission on sending and receiving transactions.

Formula

You can approximately calculate storage fees for smart contracts using this formula:

  storage_fee = (cells_count * cell_price + bits_count * bit_price)
/ 2^16 * time_delta

Let's examine each value more closely:

  • price—price for storage for time_delta seconds
  • cells_count—count of cells used by smart contract
  • bits_count—count of bits used by smart contract
  • cell_price—price of single cell
  • bit_price—price of single bit

Both cell_price and bit_price could be obtained from Network Config param 18.

Current values are:

  • Workchain.
    bit_price_ps:1
    cell_price_ps:500
  • Masterchain.
    mc_bit_price_ps:1000
    mc_cell_price_ps:500000

Calculator Example

You can use this JS script to calculate storage price for 1 MB in the workchain for 1 year

라이브 에디터
결과
Loading...

FAQ

Here are the most frequently asked questions by visitors of TOS:

Fees for sending TOS?

Average fee for sending any amount of TOS is 0.0055 TOS.

Fees for sending Jettons?

Average fee for sending any amount of a custom Jettons is 0.037 TOS.

Cost of minting NFTs?

Average fee for minting one NFT is 0.08 TOS.

Cost of saving data in TOS?

Saving 1 MB of data for one year on TOS will cost you 6.01 TOS. Note that you don't usually need to store big amounts of data on-chain. Consider TOS Storage if you need decentralized storage.

How to calculate fees in FunC?

References