server/dex: assign live swap fee rates to dynamic-tx-fee assets#3616
Open
peterzen wants to merge 1 commit into
Open
server/dex: assign live swap fee rates to dynamic-tx-fee assets#3616peterzen wants to merge 1 commit into
peterzen wants to merge 1 commit into
Conversation
Since 6e18f18, assets supporting dynamic tx fees (EIP-1559) were assigned the configured maxFeeRate verbatim as the match swap fee rate, on the grounds that an overshooting fee cap is refunded on-chain and a maximal cap is immune to fee movement during settlement. But the cap has off-chain costs that grow with the configured value: clients reserve funds per lot at this rate, gate order placement on it, and lock it into resting orders. This pressures operators to configure maxFeeRate low, and a network fee spike above the configured value renders every swap transaction unminable. Assign the live market estimate, capped at maxFeeRate, as was already the case for static-fee assets, restoring maxFeeRate to its documented role as a reserve bound. Fee movement after match time is handled client-side, where the wallet may raise its fee cap above the assigned rate up to its order reserves (ValidateFeeRate only enforces the assigned rate as a floor). Also log a rate-limited operator warning when the live estimate exceeds half of maxFeeRate, signaling that the configured bound is eroding. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Server half of the fee-pipeline fix #3615: EVM matches are now assigned a live fee-rate estimate capped at maxFeeRate, instead of the static
maxFeeRateconfig value verbatim.This restores maxFeeRate to its documented role as a reserve bound (spec/fundamentals.mediawiki), so operators can set it high as pure insurance without inflating client reserves, order gating, or orphaning resting orders on config changes. Adds a rate-limited operator warning when the live estimate exceeds half of
maxFeeRate.Related issue: #3608