Back
Challenge 10 - Price Time Priority
MediumOrderbookPriority10 / 12

Challenge 10: Price Time Priority

Orderbooks usually use price-time priority.

Task

Implement sort_by_priority.

Rules

For bids:

  1. higher price first
  2. earlier timestamp first at the same price

For asks:

  1. lower price first
  2. earlier timestamp first at the same price

This is what makes matching deterministic and fair among same-price 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 10 - Price Time Priority · ORDERBOOK Exercise | learn.sol