{"id":"stock-exchange-matching-produces-valid-trades","text":"The stock exchange correctly implements price-time priority matching (best price first, FIFO within price, execute at resting price), producing valid trades — but only when callers provide valid order fields, since the engine performs no input validation.","truth_value":"IN","source":"","source_url":"","source_hash":"","justifications":[{"type":"SL","antecedents":["stock-exchange-price-time-priority"],"outlist":["stock-exchange-no-input-validation"],"label":"price-time priority is correctly implemented but assumes valid quantity, price, and side; a negative quantity or missing price would propagate through matching and produce nonsensical trades"}],"dependents":["stock-exchange-validates-complex-write-correctness"],"metadata":{"last_reviewed":"2026-06-06T06:26:57","review_result":"pass"},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"stock-exchange-matching-produces-valid-trades","truth_value":"IN","reason":"SL justification valid","antecedents":["stock-exchange-price-time-priority"],"label":"price-time priority is correctly implemented but assumes valid quantity, price, and side; a negative quantity or missing price would propagate through matching and produce nonsensical trades","outlist":["stock-exchange-no-input-validation"]},{"node":"stock-exchange-price-time-priority","truth_value":"IN","reason":"SL justification valid","antecedents":["stock-exchange-aggressive-then-rest","stock-exchange-fifo-matching","stock-exchange-resting-price-execution"],"label":"Three beliefs compose into the canonical exchange matching semantic — aggressive-first + price-level FIFO + maker-price execution"},{"node":"stock-exchange-aggressive-then-rest","truth_value":"IN","reason":"premise"},{"node":"stock-exchange-fifo-matching","truth_value":"IN","reason":"premise"},{"node":"stock-exchange-resting-price-execution","truth_value":"IN","reason":"premise"}]}}