Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/server/config/config-fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ const feeConfig = (
profit,
});

// IMPORTANT: `profit` defaults to configDefaults.transactionFees.profitMargin,
// but a default parameter is resolved the moment this function is CALLED,
// not read live afterwards. Default network fee configs are built once, at
// module load time in config-networks.ts, using whatever profitMargin holds
// at that point (the built-in default). If you override profitMargin later
// in MY-CONFIG.ts, the fee config already built for a network is NOT
// retroactively updated - setting profitMargin alone silently does nothing
// to fees computed before the override ran. To actually apply a new margin,
// call setFeesForNetworkEVM(chain, feeConfigL1(ratio)) (or feeConfigL2)
// again, AFTER setting profitMargin, so it re-reads the current value.
export const feeConfigL1 = (
gasEstimateLimitToActualRatio: number,
gasEstimateVarianceBuffer = 0.1,
Expand Down