Adjustment workflow
Adjustments are position lifecycle operations such as adding/removing legs, moving a leg, or updating strategy/position variables.
High-level flow:
- Prepare adjustment (async job) →
ExecPlanId, order legs, leg groups, and (optionally) anAdjustmentAllowedgate - Execute (paper fills or live orders) unless the operation is server-side only
- Reconcile via Control Hub reads and Event Hub updates
Operations
PreparePositionAdjustmentArgs.Operation selects the adjustment type. Common values include:
AddLegs,RemoveLegs,MoveLeg: requires execution (orders or paper fills)UpdateVars: applied server-side (no orders)
Minimal runnable example
Use the runnable example:
# Prepare only
python -m mesolive_sdk_examples.positions_example adjust --position-id 789 --operation UpdateVars --condition "my-adjustment-condition"
# Prepare + execute (when the operation requires orders / paper fills)
python -m mesolive_sdk_examples.positions_example adjust --position-id 789 --operation AddLegs --condition "my-adjustment-condition" --execute --paper-fill-price mid
Automation notes
- Use the
Conditionfield to align with your strategy’s adjustment logic (often taken from anAdjustmentSignalEvent). - Not all operations require orders. Treat
UpdateVarsas “server-side apply”. - Subscribe to Event Hub to observe
OnPositionAdjustmentPreparationCompleted/Failedand subsequentOnOrderUpdate/OnPositionUpdate/OnLegUpdate.