Skip to main content
Try Cobo WaaS Skill in your AI coding assistant (Claude Code, Cursor, etc.). Describe your needs in natural language to auto-generate production-ready SDK code and debug faster ๐Ÿš€
Transaction fees are essential for processing and validating transactions on a blockchain network. They ensure network security, incentivize validators, and maintain efficiency. The method of calculating these fees depends on the blockchainโ€™s design and current network conditions. Cobo offers specific features to streamline transaction fee estimation for users.
  • When you make a transfer on Cobo Portal, you can see the estimated transaction fee on the UI.
  • You can call the Estimate transaction fee API operation.
The estimated transaction fee reflects current network conditions and may change by the time the actual transaction is processed.
When you call the Estimate transaction fee operation, you need to specify the following parameters:
  • request_type: The type of transaction, which can be a transfer or a contract call.
  • source: The transaction source.
  • destination: The transaction destination.
  • (Only required for transfers) token_id: The ID of the token being transferred.
  • (Only required for contract calls) chain_id: The ID of the chain on which the smart contract is deployed.
You will get the estimated transaction fee with different fee levels in the response, which varies based on the blockchain network and the fee model used.

Fee models

Each blockchain may employ multiple fee models to calculate transaction fees. For EVM chains, both the Legacy and EIP-1559 models are supported. Most transactions follow the blockchainโ€™s native fee model. However, transactions from Custodial Wallets (Asset Wallets) and Exchange Wallets always use the fixed fee model. If you specify a different fee model when initiating a transaction from these wallets, the API request will return an error.

EVM chains

EIP-1559 model

The following chains currently support EIP-1559:
  • Ethereum Mainnet
  • Sepolia Testnet
  • Scroll Mainnet
  • Base
  • BNB Smart Chain
  • Polygon
  • Sonic
  • Berachain
In the EIP-1559 model, the transaction fee is calculated as: (base fee per gas + priority fee per gas) * gas limit
For the Legacy and EIP-1559 fee models, an additional fee is charged for submitting transaction calldata to L1 (Layer 1). This fee is reflected in the API response under the reserved_fee field.
You can customize the following values:
  • Max fee per gas: The maximum fee per gas unit you are willing to pay.
  • Max priority fee per gas: The maximum priority fee per gas unit you are willing to pay.
  • Gas limit
Refer to the response of the Estimate transaction fee operation for details.

Legacy model

All EVM chains support the Legacy model. In the Legacy model, the transaction fee is calculated as: gas price * gas limit
For the Legacy and EIP-1559 fee models, an additional fee is charged for submitting transaction calldata to L1 (Layer 1). This fee is reflected in the API response under the reserved_fee field.
You can customize the following values:
  • Gas price
  • Gas limit
Refer to the response of the Estimate transaction fee operation for details.

UTXO-based chains

Currently supported chains include:
  • Bitcoin
  • Cardano
  • Nervos CKB
  • Handshake
In the UTXO-based model, the transaction fee is calculated as: fee rate * transaction size You can customize the following values:
  • Fee rate
  • Max fee amount
Refer to the response of the Estimate transaction fee operation for details.

Solana

On Solana, you can use either the native model or the Legacy model. In the native model, the transaction fee is calculated as: base fee + (CU price * CU limit) You can customize the following values:
  • CU price
  • CU limit
Refer to the response of the Estimate transaction fee operation for details.
Activating a Solana token sub-address (Associated Token Account) incurs a one-time rent paid by the source address, separate from the network transaction fee. For details, see Solana token account rent.
Solana and Filecoin both support two fee models: their native model and the Legacy model. When calling transaction API operations, you can choose which model to use. However, for Replace-By-Fee (RBF) transactions, you must use the same fee model as the original transaction.

Filecoin

On Filecoin, you can use either the native model or the Legacy model. In the native model, the transaction fee is calculated as: min(gas fee cap, base fee + gas premium) * gas limit You can customize the following values:
  • Gas fee cap
  • Gas premium
  • Gas limit
Refer to the response of the Estimate transaction fee operation for details.
Solana and Filecoin both support two fee models: their native model and the Legacy model. When calling transaction API operations, you can choose which model to use. However, for Replace-By-Fee (RBF) transactions, you must use the same fee model as the original transaction.

Chains using the fixed model

The following chains use a fixed fee model:
  • TRON
  • Algorand
  • Polkadot
  • Internet Computer and its ICRC assets (ckBTC, ckETH, ckUSDC, ckUSDT, DKP, GLDGOV, ICS, NICP, OC, OGY)
  • Stellar
  • Ripple
  • Tezos
  • Sui
  • Near
In the fixed model, the transaction fee is a fixed amount. You can customize the parameter Max fee amount to cap the maximum fee for a transaction.

Fee levels

Transaction fees are influenced by speed levels. Users can choose between slow, recommended, and fast transaction speeds, with faster speeds incurring higher fees. Cobo supports three fee levels for Legacy, EIP-1559, UTXO, Solana and Filecoin models:
  • Slow: Lower fee for slower processing.
  • Recommended: Balanced fee and confirmation time.
  • Fast: Higher fee for quicker processing.

Replace-By-Fee (RBF) transaction fee

Replace-By-Fee (RBF) is a feature that allows you to replace an unconfirmed transaction with a new version that typically pays a higher transaction fee. This functionality provides flexibility to modify transactions after they are broadcast but before they are confirmed by miners. For more details, refer to Replace-By-Fee (RBF) transactions. The logic for estimating RBF transaction fees is similar to that for normal transactions, with the addition of a fee increase for the RBF transaction. The key points to consider when estimating RBF transaction fees based on different fee models are as follows:
  • Legacy: Increase the gas price. The gas price for an RBF transaction must be higher than that of the transaction being replaced.
  • EIP-1559: Increase both the max fee per gas and max priority fee per gas.
  • UTXO: Increase the fee rate and ensure that the product of the fee rate and transaction size is greater than that of the original transaction. If not, the node might reject broadcasting the transaction.
  • Fixed: Increase the fee amount.
  • Filecoin: It is recommended to increase both gas premium and gas fee cap by 25%.

Fees on Layer 2 chains

On Layer 2 (L2) chains such as Arbitrum, network fees can change rapidly. If fees rise sharply after you submit a transaction, the transaction can remain in the PendingSignature or Broadcasting status longer than expected. How you unblock it depends on the status:
  • Broadcasting: The transaction is already broadcast. Use the Replace-By-Fee (RBF) speed-up operation to rebroadcast it with a higher fee. To raise the fee, use the Speed up transaction operation. For how RBF works end to end, see RBF (Replace-By-Fee) transaction lifecycle.
  • PendingSignature: The transaction is not yet broadcast, so RBF does not apply. The transaction must be signed within a limited signing window; if signing does not complete in time, it fails with the sub-status FailedSignerTimeout. In that case, submit a new transaction to try again. For details, see Transaction statuses and sub-statuses.

How Cobo estimate the fees

Below is how Cobo calculates the fees for each model: