Tasks: YU08-execution-algo-engine
Build order is bottom-up (schedule math → event store → HTTP client to order-matcher → fill tracking → REST API → VWAP volume profile → packaging → tests).
Schedule
- T01
TwapScheduleBuilder; equal-quantity buckets, remainder on the last bucket. - T02
VwapScheduleBuilder; buckets weighted byVolumeProfileSource.bucketWeights(...).
Event store (execution-algo-engine/eventstore)
- T10
AlgoEventStore: JetStream stream bootstrap (TRADERX_ALGO_ENGINE), append-before-apply. - T11 Durable pull consumer (
algo-engine-state,DeliverPolicy.All,AckPolicy.Explicit), replay-on-boot rebuildingAlgoOrderState. - T12 Explicit ack only after in-memory apply succeeds (crash-between-append-and-ack safety).
Child order submission (execution-algo-engine/orders)
- T20
PriceClient:GET /prices/{ticker}onprice-publisher. - T21
OrderMatcherClient:POST /orderswith a derived positivelimitPrice(last price ±ALGO_LIMIT_OFFSET_BPS). - T22
AlgoScheduler:@Scheduledloop submitting due buckets, retrying on failure without double-submitting.
Fill tracking (execution-algo-engine/fills)
- T30
OrderUpdateSubscriber:/accounts/*/orderswildcard subscription, correlated byorderIdagainst an in-memory submitted-child index. - T31 Parent-order completion detection (every bucket submitted and filled).
REST API (execution-algo-engine/api)
- T40
POST /algo/orders,GET /algo/orders/{parentOrderId},GET /algo/orders.
Volume profile (execution-algo-engine/volume)
- T50
SyntheticVolumeProfileSource; deterministic U-shaped curve. - T51
DuckDbVolumeProfileSource; DuckDB JDBC query over the unifiedticksstore, falls back to synthetic weights on zero matching rows.
Packaging
- T60
build.gradle,Dockerfileforexecution-algo-engine. - T61
execution-algo-engine-deployment.yaml+-service.yaml;kustomization.yamlextended from YU07's copy (append-only). - T62 Generation hook + render script; wire
generate-state.sh YU08-execution-algo-engine. - T63
scripts/{start,stop,status,test}-state-YU08-execution-algo-engine*.sh.
Tests
- T70 Unit tests: TWAP/VWAP bucket math (including remainder handling and weight normalization).
- T71 Unit tests:
AlgoEventStorereplay rebuilds identical state to the pre-crash model. - T72 Unit tests:
OrderUpdateSubscribercorrelation byorderId, ignoring unrelated orders. - T73 Unit tests:
DuckDbVolumeProfileSourceempty-result fallback to synthetic weights. - T74 End-to-end: TWAP parent order on a local kind cluster, children accepted by
order-matcher, progress visible viaGET /algo/orders/{id}(run-state-kind). - T75
bench-compareagainst theYU07-historical-tick-storebaseline.
Doc sync
- T80 Verify generation propagation empirically (
kustomization.yamlkeeps every ancestor entry alongside the two new ones). - T81 Doc sync (root
CLAUDE.md,specs/README.md,HANDOFF-FOR-TEAMMATE.md, catalog). - T82
generation/implementation-status.mdwith verification evidence.