Skip to content

Commit

Permalink
feat(alchemy): modify fee defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
dancoombs committed Aug 12, 2023
1 parent 40be05f commit 0a0a65c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/alchemy/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export type AlchemyProviderConfig = {
account?: BaseSmartContractAccount;
opts?: SmartAccountProviderOpts;
feeOpts?: {
/** this adds a percent buffer on top of the base fee estimated (default 25%)
/** this adds a percent buffer on top of the base fee estimated (default 50%)
* NOTE: this is only applied if the default fee estimator is used.
*/
baseFeeBufferPercent?: bigint;
Expand All @@ -45,7 +45,7 @@ export type AlchemyProviderConfig = {
maxPriorityFeeBufferPercent?: bigint;
/** this adds a percent buffer on top of the preVerificationGasEstimated
*
* Default 10% on Arbitrum and Optimism, 0% elsewhere
* Defaults 5% on Arbitrum and Optimism, 0% elsewhere
*
* This is only useful on Arbitrum and Optimism, where the preVerificationGas is
* dependent on the gas fee during the time of estimation. To improve chances of
Expand Down Expand Up @@ -87,7 +87,7 @@ export class AlchemyProvider extends SmartAccountProvider<HttpTransport> {
this.alchemyClient = this.rpcClient as ClientWithAlchemyMethods;
withAlchemyGasFeeEstimator(
this,
feeOpts?.baseFeeBufferPercent ?? 25n,
feeOpts?.baseFeeBufferPercent ?? 50n,
feeOpts?.maxPriorityFeeBufferPercent ?? 5n
);

Expand All @@ -101,7 +101,7 @@ export class AlchemyProvider extends SmartAccountProvider<HttpTransport> {
optimismGoerli.id,
]).has(this.chain.id)
) {
this.pvgBuffer = 10n;
this.pvgBuffer = 5n;
} else {
this.pvgBuffer = 0n;
}
Expand Down

0 comments on commit 0a0a65c

Please sign in to comment.