Skip to content

[2.7] match_orders: crank-fill, partial/full match, fee calc, self-match guard - #51

Merged
0xfave merged 4 commits into
mainfrom
feature/match-orders-27
Jun 17, 2026
Merged

[2.7] match_orders: crank-fill, partial/full match, fee calc, self-match guard#51
0xfave merged 4 commits into
mainfrom
feature/match-orders-27

Conversation

@Harshbhargav45

Copy link
Copy Markdown
Collaborator

What

Implements match_orders (Ticket 2.7) — the crank-operated order fill instruction.

Changes

  • src/processor.rs — full match_orders implementation (~267 lines)
  • tests/flux_dex_tests.rs — 5 integration tests (+424 lines)

Acceptance Criteria

  • Only crank authority can match
  • Price match enforced (opposing price must be equal)
  • Partial fills update filled amount correctly
  • Full fills set status = Filled
  • Fee: (price × qty × fee_bps) / 10_000 — checked math throughout
  • Self-match rejected (buyer != seller)
  • Non-matching price rejected
  • CU < 30,000 ✅ (actual: 6,898 CU)

@0xfave
0xfave merged commit 5341b48 into main Jun 17, 2026
3 checks passed
@0xfave 0xfave linked an issue Jun 17, 2026 that may be closed by this pull request
8 tasks
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.7] match_orders()

2 participants