[BUG]: Dashboard auto-matches expired orders, so the match always reverts with OrderExpired

Open
#142 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@kansalakshat is already working on this.

Since Nov 17, 2026.

  • #143 by @kansalakshat — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript

Research direction

Start in app/dashboard/page.tsx and inspect matchablePairs, which currently checks order activity and prices. Compare its expiry rule with the contract behavior described in the issue: zero means no expiry, and otherwise an order is matchable through its expiry time. Keep expired orders visible in the order lists; done means they no longer trigger an automatic match. Pull request #143 is already open for this issue.

Written by the indexing model from the issue text.

Description

Bug Description

The dashboard keeps trying to match orders that have expired.

When an order passes its expiry, the contract doesn't flip it to inactive. It stays active until the maker cancels it, but matchOrders reverts with OrderExpired() (WindmillExchange.sol, if (buy.expiry != 0 && ts > buy.expiry) revert OrderExpired();). matchablePairs in app/dashboard/page.tsx only looks at active and the prices, never at expiry, so an expired order that crosses another order counts as a match.

The dashboard then auto-executes it. Anyone with a wallet connected on /dashboard gets a matchOrders popup that can only revert, which costs them gas if they confirm. Then they get "Match transaction error: ... 0xc56873ba", and the card stays on "Auto-Match In Progress".

Suggested fix

Leave expired orders out of matchablePairs, using the contract's rule (expiry == 0 means never, otherwise matchable while now <= expiry). They should stay in the order lists, so the maker still has the Cancel button to get their funds back.

Steps to Reproduce
  1. Create a buy order with an expiry a minute out, and a crossing sell order from another account
  2. Wait for the buy to expire (don't open the dashboard before then, or it gets matched first)
  3. Open /dashboard with a third account connected
  4. "Crossing Match Opportunity Detected (1)" shows up, the wallet asks to sign matchOrders, and it fails with OrderExpired
Logs and Screenshots

Sepolia fork (anvil), main @ 5548ba9. Order 1 is a buy that expired, order 2 is a crossing sell:

before expiry:  eth_estimateGas matchOrders(1, 2)  OK
after expiry:   getOrder(1).active = true
                eth_estimateGas matchOrders(1, 2)  reverts 0xc56873ba (OrderExpired())
dashboard:      Crossing Match Opportunity Detected (1)
                wallet popup: matchOrders -> reverts 0xc56873ba
                Match transaction error: execution reverted: custom error 0xc56873ba
                Auto-Match In Progress (stays)
Environment Details
  • main @ 5548ba9
  • Sepolia fork via anvil, injected test wallet
Impact

Medium - Feature works but has issues

Code of Conduct
  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates
Dominant language
TypeScript
Stars
7
Forks
21
Avg merge
3d 21h
Merged PRs (30d)
9

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from StabilityNexus/Windmill-EVM-WebUI

All issues in StabilityNexus/Windmill-EVM-WebUI

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.