Skip to main content
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
ParameterDescription
Base fee per gasThe minimum fee required to include a transaction in a block per gas unit used on the chain. It is dynamically adjusted based on network demand.
Priority fee per gasAn additional fee paid to miners/validators to prioritize the transaction per gas unit used on the chain (also known as a tip).
Gas limitThe maximum number of gas units you are willing to spend to execute the transaction or run the EVM. Different operations consume different amounts of gas.
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
ParameterDescription
Gas priceThe gas price, in wei, representing the amount of ETH that must be paid to validators per gas unit used to process the transaction.
Gas limitThe maximum number of gas units you are willing to spend to execute the transaction or run the EVM. Different operations consume different amounts of gas.
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
ParameterDescription
Fee rateThe fee rate, in sats/vByte, representing how many satoshis you are willing to pay per vByte of transaction data.
Transaction sizeThe total size of a transaction on-chain in bytes, which impacts the total fee in UTXO models.
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)
ParameterDescription
Base feeA fixed fee charged per signature (default 5,000 lamports per signature).
CU priceThe price paid per CU (compute unit) to increase transaction priority, in lamports.
CU limitThe maximum number of compute units your transaction is allowed to consume. A higher limit may increase priority but also increases the fee.
You can customize the following values:
  • CU price
  • CU 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.

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
ParameterDescription
Gas fee capThe maximum gas price you are willing to pay per unit.
Base feeThe minimum fee required for inclusion in a block. It is dynamically adjusted based on network congestion and is burned to reduce total FIL supply.
Gas premiumA user-defined tip to incentivize miner prioritization.
Gas limitThe maximum amount of gas your transaction can consume.
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%.

How Cobo estimate the fees

Below is how Cobo calculates the fees for each model:
Fee ModelEstimation Method
Legacy
  • Gas price: Calculated based on third-party nodes and self-managed nodes.
  • Gas limit: Queried from the corresponding node based on the source and destination.
EIP-1559
  • Maximum gas fee per gas unit: Calculated based on third-party nodes and self-managed nodes.
  • Maximum priority fee per gas unit: Calculated based on third-party nodes and self-managed nodes.
  • Gas limit: Queried from the corresponding node based on the source and destination.
UTXO
  • Fee rate: Calculated based on third-party nodes and self-managed nodes.
  • Transaction size: Calculated based on the source spendables (UTXOs) and destination.
Fixed
  • Fixed fee amount: Calculated based on self-managed nodes.
Feel free to share your feedback to improve our documentation!