Dynamic Gas Fee Calculation for Mobile Wallets: Save Time and Money

When sending a transaction, users face a dilemma: which fee to choose? Too low — the transaction can get stuck for hours; too high — overpaying several times. Many wallets use fixed values, leading to losses or delays. Our team, with 5 years of experience, develops algorithms that analyze current ne

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1734 services
Dynamic Gas Fee Calculation for Mobile Wallets: Save Time and Money
Medium
~2-3 days

Our competencies:

Frequently Asked Questions

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    898
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    784
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1219
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1081
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    1004
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    600

When sending a transaction, users face a dilemma: which fee to choose? Too low — the transaction can get stuck for hours; too high — overpaying several times. Many wallets use fixed values, leading to losses or delays. Our team, with 5 years of experience, develops algorithms that analyze current network load and offer optimal fees in three modes. This saves users money and time.

For example, one of our clients — a crypto wallet with 100,000 users — after implementation reduced average confirmation time by 40% (compared to static fee wallets) and decreased the number of stuck transactions by 80%. Fee savings reached up to 30% for active traders. Our integration typically costs between $2,000 and $5,000, and clients often save over $1,000 per month in overpaid fees.

Why Dynamic Transaction Fee Calculation Matters

Network fee directly affects user experience. If the wallet shows too high a fee, the user leaves. If too low — the transaction stalls. The key tools are eth_feeHistory (EIP-1559) and eth_gasPrice for legacy networks. Without them, accurate calculation is impossible.

For Ethereum Mainnet, we use eth_feeHistory with percentiles 10, 50, 90 over the last 10 blocks. This gives a realistic picture of network load. Below is an example request in Kotlin/Android via web3j:

val feeHistory = web3j.ethFeeHistory(10, DefaultBlockParameterName.LATEST, listOf(10.0, 50.0, 90.0)).send() val baseFee = feeHistory.feeHistory.baseFeePerGas.last() val slowPriorityFee = feeHistory.feeHistory.reward[0][0] val avgPriorityFee = feeHistory.feeHistory.reward[0][1] val fastPriorityFee = feeHistory.feeHistory.reward[0][2] 

For iOS, similar logic on web3swift:

let feeHistory = try await web3.eth.feeHistory(blockCount: 10, newestBlock: .latest, rewardPercentiles: [10, 50, 90]) let baseFee = feeHistory.baseFeePerGas.last! let slowPriority = feeHistory.reward[0][0] let avgPriority = feeHistory.reward[0][1] let fastPriority = feeHistory.reward[0][2] 

For Polygon, we use the Gas Station API — it adapts to local gas spikes.

How the Three Modes Work: Slow / Average / Fast

The user selects a confirmation speed. The app automatically calculates maxFeePerGas = baseFee * multiplier + priorityFee. The multiplier and priority fee percentile define the mode:

Mode Base Fee Priority Fee Expected Time
Slow base + 0% 10th percentile 3–5 minutes
Average base + 10% 50th percentile ~30 seconds
Fast base + 20% 90th percentile ~15 seconds

The final cost is converted to USD at the current ether price. For ETH-transfer, gasLimit is fixed at 21000. For contracts — eth_estimateGas with a 20% buffer. For complex smart contracts, we execute eth_estimateGas in each block, adding a 20% buffer for unforeseen opcodes. The result is multiplied by the elevated baseFee for Fast mode to guarantee execution.

Choosing the Optimal Provider for Gas Fee Calculation

The choice of provider (Infura, Alchemy, QuickNode) affects speed and accuracy of data. We recommend Alchemy for mainnet — their API returns eth_feeHistory with low latency. For testnets, Infura is sufficient. It's important to set up polling feeHistory with an interval of 10–15 seconds to keep data up-to-date.

What Is Manual Tuning and How to Implement It?

Custom mode — fields maxFeePerGas and maxPriorityFeePerGas in Gwei. Validation:

  • maxPriorityFeePerGas cannot exceed maxFeePerGas
  • maxFeePerGas must be at least current baseFee (otherwise the transaction will stall)
  • Warning for very low values

Input in Gwei is more convenient: 1 Gwei = 10^9 Wei.

Testing Gas Fee Correctness

We test on mainnet and testnets (Goerli, Sepolia). We simulate different network loads, check confirmation time for each mode. We monitor transactions on Etherscan. All calculations are compared with real data. Results are documented in a report.

What Results We Guarantee

In 5 years on the market, we have completed over 50 projects related to crypto wallets, including gas fee integration for Ethereum, Polygon, BNB Chain, and other networks. Our clients save up to 30% on fees thanks to accurate calculation. Users get transparent fees and predictable confirmation times.

What's Included in the Work

Deliverable Description
Network analysis and integration Web3 provider connection, polling feeHistory, documentation
Fee calculation algorithms SDK with Slow/Average/Fast modes, USD conversion
Speed selection UI Custom slider + manual input, gas fee UI components
Access and training API keys, integration guide, code samples for Android/iOS
Testing and validation Mainnet and testnet verification, Etherscan monitoring
Post-deployment support 1 month free support, troubleshooting

Work Process and Timelines

  1. Analytics — study current wallet architecture, select provider (Infura, Alchemy).
  2. Design — blockchain interaction protocol, speed UI/UX.
  3. Implementation — calculation code, API integration, custom settings interface.
  4. Testing — simulation of various network loads.
  5. Deployment — upload to App Store/Google Play.

Estimated time: 2 to 5 days, depending on complexity. Cost is calculated individually. Contact us to evaluate your project. Order gas fee calculation integration into your wallet — users will appreciate transparent fees. Get a consultation on integration today.

Source: Ethereum Documentation on Gas