Repository navigation
[simplex]: leave a $10 fee reserve off the book for limit orders paying out the fee token - #1445
Merged
Merged
Conversation
…ng out the fee token A cross-chain fill pays the escrow-release dispatch fee in the fill chain's fee token from the same wallet. An order paying out that token and sized to the whole balance was matched against all of it, and every fill was then skipped for want of the fee. LimitOrderService.create now refuses such an order unless the wallet and vaults hold 10 tokens more than it pays out. The balance snapshot marks the fee token with limitOrderFeeReserve, and the create form's Max leaves it out.
seunlanlege
approved these changes
Oct 24, 2026
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.
A cross-chain fill pays the escrow-release dispatch fee in the fill chain's fee token, out of the wallet that pays the fill. The orderbook advertises
min(quoted, balance), so a limit order paying out the fee token and sized to everything held was matched against the whole balance, and the filler skipped each fill:Change
LimitOrderService.createrefuses an order paying out the fill chain's fee token unless the wallet plus vaults holdLIMIT_ORDER_FEE_RESERVE_TOKENS(10, i.e. $10) more than it pays out. The error states the most the order can pay out. Other payout tokens are unchanged. A fee token that cannot be read holds nothing back and logs a warning; the fill-time dispatch check still applies.BalanceProvidermarks the fee token's asset row withlimitOrderFeeReserve(boot passes afeeTokenlookup).availableis unchanged.limitOrderFeeReserveper fill chain.The reserve is checked at creation. A balance later drawn down by something other than the order's own fills (a withdrawal, another order paying the same token) can still let the book advertise all of it. Noted in
docs/ai/changelog/2026-10-24-limit-orders-leave-the-fee-reserve-off-the-book.md.Validation
biome lintclean on changed files; notscerrors in changed files.🤖 Generated with Claude Code