From a0ec412ccbea4d94157f867e8c3bf1ae8290b415 Mon Sep 17 00:00:00 2001 From: Webster Swift Date: Tue, 28 Oct 2025 16:11:45 +0300 Subject: [PATCH] fix: remove gas tip cap from total gas price calculation --- pkg/walletsdk/evm/estimate.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/walletsdk/evm/estimate.go b/pkg/walletsdk/evm/estimate.go index b4d48e9..2e33eec 100644 --- a/pkg/walletsdk/evm/estimate.go +++ b/pkg/walletsdk/evm/estimate.go @@ -44,7 +44,7 @@ func (s *EVM) EstimateTransfer(ctx context.Context, fromAddress, toAddress, asse gasAmount = decimal.NewFromUint64(estimatedGas) gasTipCap = estimate.SuggestGasTipCap - totalGasPrice = estimate.MaxFeePerGas.Add(gasTipCap) + totalGasPrice = estimate.MaxFeePerGas totalFeeAmount = totalGasPrice.Mul(gasAmount) } else { amount = amount.Mul(decimal.NewFromInt(1).Mul(decimal.NewFromInt(10).Pow(decimal.NewFromInt(decimals)))) @@ -65,7 +65,7 @@ func (s *EVM) EstimateTransfer(ctx context.Context, fromAddress, toAddress, asse gasAmount = decimal.NewFromUint64(estimatedGas) gasTipCap = estimate.SuggestGasTipCap - totalGasPrice = estimate.MaxFeePerGas.Add(gasTipCap) + totalGasPrice = estimate.MaxFeePerGas totalFeeAmount = totalGasPrice.Mul(gasAmount) } @@ -135,6 +135,10 @@ func (s *EVM) EstimateFee(ctx context.Context) (*EstimateFeeResult, error) { fee.MaxFeePerGas = GetBaseFeeMultiplier(fee.SuggestGasPrice) + if fee.MaxFeePerGas.LessThan(fee.SuggestGasPrice.Add(fee.SuggestGasTipCap)) { + fee.MaxFeePerGas = fee.SuggestGasPrice.Add(fee.SuggestGasTipCap) + } + return fee, nil }