from __future__ import annotations """Toy broker adapter. Accepts PlanDelta-like dicts and records execution plan with per-order metadata. """ from typing import List, Dict, Any import time class BrokerAdapter: def __init__(self, venue_name: str = "venue-1") -> None: self.venue_name = venue_name self.executed: List[Dict[str, Any]] = [] def route(self, plan_delta: Dict[str, Any]) -> None: # naive simulated execution: record legs with venue assignment ts = time.time() for leg in plan_delta.get("legs", []): self.executed.append({ "venue": self.venue_name, "leg": leg, "ts": ts, }) def history(self) -> List[Dict[str, Any]]: return list(self.executed)