Understanding Gas Fees
Learn how gas fees work on Tetreum Testnet and how to optimize your transaction costs.
Gas is the unit that measures the computational effort required to execute operations on the Tetreum Test network.
Key Concepts:
- • Gas Limit: Maximum gas you're willing to spend
- • Gas Price: Amount you pay per unit of gas (in TET)
- • Gas Used: Actual gas consumed by the transaction
- • Transaction Fee: Gas Used × Gas Price
Transaction fees are calculated using this formula:
Transaction Fee = Gas Used × Gas PriceExample: Simple Transfer
- Gas Limit: 21,000
- Gas Price: 20 Gwei
- Gas Used: 21,000
- Fee: 0.00042 TET
Example: Contract Call
- Gas Limit: 150,000
- Gas Price: 25 Gwei
- Gas Used: 120,000
- Fee: 0.003 TET
Follow these best practices to minimize gas fees:
1. Choose Optimal Gas Price
Monitor network congestion and adjust gas price accordingly. Higher gas price = faster confirmation.
2. Batch Transactions
Combine multiple operations into a single transaction when possible to save on base transaction costs.
3. Time Your Transactions
Execute transactions during off-peak hours when network congestion is lower.
4. Optimize Smart Contracts
Write efficient code, use appropriate data types, and minimize storage operations.
Typical gas limits for common operations:
| Operation | Gas Limit | Typical Cost (20 Gwei) |
|---|---|---|
| TET Transfer | 21,000 | 0.00042 TET |
| Token Transfer (ERC-20) | 65,000 | 0.0013 TET |
| Token Approval | 45,000 | 0.0009 TET |
| Swap (DEX) | 150,000 | 0.003 TET |
| Contract Deployment | 1,000,000+ | 0.02+ TET |
Ready to Save on Gas?
Apply these optimization techniques to reduce your transaction costs on Tetreum.