- 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.
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.
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
Parameter | Description |
---|---|
Base fee per gas | The 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 gas | An additional fee paid to miners/validators to prioritize the transaction per gas unit used on the chain (also known as a tip). |
Gas limit | The 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.- 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
Legacy model
All EVM chains support the Legacy model. In the Legacy model, the transaction fee is calculated as: gas price * gas limitParameter | Description |
---|---|
Gas price | The gas price, in wei, representing the amount of ETH that must be paid to validators per gas unit used to process the transaction. |
Gas limit | The 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.- Gas price
- Gas limit
UTXO-based chains
Currently supported chains include:- Bitcoin
- Cardano
- Nervos CKB
- Handshake
Parameter | Description |
---|---|
Fee rate | The fee rate, in sats/vByte, representing how many satoshis you are willing to pay per vByte of transaction data. |
Transaction size | The total size of a transaction on-chain in bytes, which impacts the total fee in UTXO models. |
- Fee rate
- Max fee amount
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)Parameter | Description |
---|---|
Base fee | A fixed fee charged per signature (default 5,000 lamports per signature). |
CU price | The price paid per CU (compute unit) to increase transaction priority, in lamports. |
CU limit | The maximum number of compute units your transaction is allowed to consume. A higher limit may increase priority but also increases the fee. |
- CU price
- CU limit
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 limitParameter | Description |
---|---|
Gas fee cap | The maximum gas price you are willing to pay per unit. |
Base fee | The 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 premium | A user-defined tip to incentivize miner prioritization. |
Gas limit | The maximum amount of gas your transaction can consume. |
- Gas fee cap
- Gas premium
- Gas limit
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
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 Model | Estimation Method |
---|---|
Legacy |
|
EIP-1559 |
|
UTXO |
|
Fixed |
|
Feel free to share your feedback to improve our documentation!