Skip to content

[simplex]: leave a $10 fee reserve off the book for limit orders paying out the fee token - #1445

Merged
Wizdave97 merged 1 commit into
mainfrom
claude/simplex-limit-order-fees-380c28
Oct 24, 2026
Merged

Wizdave97 merged 1 commit into
mainfrom
claude/simplex-limit-order-fees-380c28

Conversation

@Wizdave97

Copy link
Copy Markdown
Member

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:

Skipping order: fill leaves too little of the fee token to dispatch the escrow release {"feeToken":"0xa0b8…eb48","residual":"5","dispatchFee":"0.014117","required":"5.014117"}

Change

  • LimitOrderService.create refuses an order paying out the fill chain's fee token unless the wallet plus vaults hold LIMIT_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.
  • BalanceProvider marks the fee token's asset row with limitOrderFeeReserve (boot passes a feeToken lookup). available is unchanged.
  • The create form's Max button and "held" figure subtract limitOrderFeeReserve per 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

  • Orderbook, limit-order core and UI suites: 457 passed, 1 skipped. New tests cover the creation check, the balance-row marker (including a failed fee-token read) and the Max button.
  • biome lint clean on changed files; no tsc errors in changed files.

🤖 Generated with Claude Code

…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.
@Wizdave97
Wizdave97 merged commit a75a932 into main Oct 24, 2026
4 checks passed
@Wizdave97
Wizdave97 deleted the claude/simplex-limit-order-fees-380c28 branch October 24, 2026 15:15
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.

2 participants