Skip to content

server/dex: assign live swap fee rates to dynamic-tx-fee assets#3616

Open
peterzen wants to merge 1 commit into
decred:masterfrom
peterzen:evm-live-swap-feerate
Open

server/dex: assign live swap fee rates to dynamic-tx-fee assets#3616
peterzen wants to merge 1 commit into
decred:masterfrom
peterzen:evm-live-swap-feerate

Conversation

@peterzen

@peterzen peterzen commented Jul 6, 2026

Copy link
Copy Markdown
Member

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 maxFeeRate config 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

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant