fix(trading): pass order_id as object to Alpaca getOrder #14
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
pregno/polymarket-screener!14
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/alpaca-getorder-arg-shape"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Root cause
The Alpaca SDK's
getOrderdestructures{ order_id }from its argument, butAlpacaBrokercalled it with a bare string, so every Reconciler tick failed withorder_id is missing. The mismatch was hidden by theas unknown as AlpacaClientcast increate-broker.tsand the interface wrongly declaringgetOrder(id: string).Fix
alpaca-broker.ts: call site →getOrder({ order_id: orderId }); interface signature correctedalpaca-broker.test.ts: assert the call shape (the old test ignored the argument, which is why this slipped through)Checked the other methods routed through the same cast (
createOrder,closePosition,getPositions) — all already match the SDK.Verification
Note: requires container rebuild/redeploy for compiled
dist/to pick up the fix.The Alpaca SDK's getOrder destructures { order_id } from its argument, but AlpacaBroker called it with a bare string, so every Reconciler tick failed with "order_id is missing". The mismatch was hidden by the `as unknown as AlpacaClient` cast in create-broker.ts and the interface wrongly declaring getOrder(id: string). Fix the call site and interface, and assert the call shape in the test (it previously ignored the argument).