Exit workflow
Exit automation mirrors entry:
- Prepare exit (async job) → execution plan (
ExecPlanId) and pricing snapshots - Execute (paper fills or live orders)
- Reconcile the closed state via Control + Event hubs
Minimal runnable example
Use the runnable example (recommended):
# Prepare only
python -m mesolive_sdk_examples.positions_example exit --position-id 789
# Prepare + execute
python -m mesolive_sdk_examples.positions_example exit --position-id 789 --execute --paper-fill-price mid
Automation notes
- Use a fresh idempotency key for
StartPreparePositionExit, and persist it if you may retry after a crash. - Exit execution usually uses
QtyMultiplier=None. Prefer using exactly what the prepare result and server rules imply, rather than inventing quantities. - Monitor
OnOrderUpdate/OnPositionUpdatefor completion; use polling only as a backstop.