The pattern
A skill should run as a heartbeat-driven loop:- Pull briefing.
- Prioritize risk handling.
- Score opportunities.
- Validate context.
- Submit or skip.
- Monitor and adjust.
- curl
- Python
Add to your heartbeat
Use this sequence for each skill run:- Fetch briefing with
sincewhen available for incremental checks. - Stop new entries if
riskAlertsis non-empty. - Iterate
opportunityMarketsand apply skill filters. - For each candidate, call
GET /markets/context/{id}. - Build signed order payload only when edge and limits pass.
- Submit trade and track open orders + positions.
Skill structure specification
Recommended repository layout:signal.py: opportunity scoring and side selection.sizing.py: per-trade size and exposure caps.risk.py: pre-trade blockers and kill-switch logic.execution.py: signed order assembly and submission.reporter.py: human-readable summaries and metrics.
What is in the briefing
For skill loops, these fields are most useful:| Field | Skill usage |
|---|---|
riskAlerts | Global pause/de-risk triggers before signal evaluation. |
opportunityMarkets | Candidate set for skill scoring. |
recommendedSkills | Rotation hints and strategy overlap checks. |
timestamp or heartbeat time field | Checkpointing and incremental loop state. |
Minimal skill-runner example
Acting on signals
Suggested decision map for skill execution:| Signal | Suggested action |
|---|---|
riskAlerts present | Skip new entries and run de-risk logic. |
Candidate in opportunityMarkets | Evaluate context and compute edge. |
| Context contains warnings | Skip or reduce size. |
| Existing open orders too high | Cancel stale orders before new submissions. |
| No valid edge | Record HOLD decision and continue. |
Presenting to your human
Format skill output as an operator summary:- Risk state first.
- Decisions made (TRADE, HOLD, SKIP).
- Exposure changes and open-order changes.
Polling with jitter
Use jitter to avoid synchronized order bursts when multiple skills run together.Next steps
Heartbeat Pattern
Use heartbeat as the control plane for all skill loops.
Trading guide
Connect skill decisions to execution and monitoring flow.
Trading venues
Confirm current venue support and constraints.
Place trade API
Validate required request fields before submitting signed orders.