Skip to content

Commit

Permalink
fix: return scaled prio fee as max fee per gas (#27)
Browse files Browse the repository at this point in the history
There was a bug in this code where it wasn't correctly returning the scaled prio fee as maxPriorityForGas
  • Loading branch information
moldy530 authored Jun 16, 2023
1 parent d792f06 commit 56bc34b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/alchemy/src/middleware/gas-fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ export const withAlchemyGasFeeEstimator = (
return (baseFeeScaled * feeMode.value) / 100n;
case GasFeeStrategy.PRIORITY_FEE_PERCENTAGE:
// add 10% to required priority fee to ensure mine
return (maxPriorityFeePerGas * (110n + feeMode.value)) / 100n;
return (maxPriorityFeePerGas * (100n + feeMode.value)) / 100n;
default:
throw new Error("fee mode not supported");
}
})();

return {
maxPriorityFeePerGas,
maxPriorityFeePerGas: prioFee,
maxFeePerGas: baseFeeScaled + prioFee,
};
});
Expand Down

0 comments on commit 56bc34b

Please sign in to comment.