Back
Challenge 2 - Crossing Logic
EasyOrderbookMatching2 / 12

Challenge 2: Crossing Logic

A match can happen only when prices cross.

Task

Implement crosses.

Rules

  • Buy/taker bid crosses maker ask if bid_price >= ask_price.
  • Sell/taker ask crosses maker bid if ask_price <= bid_price.

This is the central predicate used by limit orders, post-only orders, and IOC orders.

LanguageRust
Loading editor...
Run works without login. Submit requires sign-in so completion can be saved.
Run cases to compare your output against each configured input. Submit saves progress only when every case passes.
    Challenge 2 - Crossing Logic · ORDERBOOK Exercise | learn.sol