Executable strategies follow the Strategy API V2 contract. You define an initialize(context) function, declare universes/subscriptions, and provide logic via handle_data, on_rebalance, or scheduled callbacks. The Agent Gateway manages the source lifecycle through the following endpoints:
GET /strategy-sources/templates: List starter code.POST /strategy-sources/compile: Compile code.POST /strategy-sources: Save a private source./strategy-sources/{source_id}: Inspect or update a source./strategy-sources/{source_id}/versions: Review immutable snapshots.- Create deployments from saved source IDs.
To create a stopped deployment from a saved source, use POST /api/agent/v1/strategies. To update canonical fields of an existing deployment, use PATCH /api/agent/v1/strategies/{id}. Stopping a running deployment requires a T scope token via /strategies/{id}/stop.
curl -X POST http://localhost:8888/api/agent/v1/strategies \
-H "Authorization: Bearer $QUANTDINGER_AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "spy-trend", "sourceId": 12, "initialCapital": 10000, "executionMode": "signal", "leverageEnabled": false, "params": {"lookback": 50} }'