A resting order at the same price was posted first and has time priority, so it should count as ahead too (p <= r["price"], not p <). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>