Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.miramarket.org/llms.txt

Use this file to discover all available pages before exploring further.

Strategy JSON is the portable external representation of a Miramarket strategy. It is designed to be readable by humans and deterministic enough for AI agents to generate safely.

Top-level object

{
  "version": "1.1.0",
  "strategy_id": "example_strategy",
  "initial_principal_usd": 100,
  "root_node_id": "condition_entry",
  "nodes": [],
  "edges": [],
  "decision_groups": []
}
FieldTypeRequiredMeaning
versionstringYesStrategy JSON version.
strategy_idstringYesStable strategy identifier.
initial_principal_usdnumberYesStarting capital in USD. Must be greater than 0.
root_node_idstringYesnode_id of the root node.
nodesarrayYesCondition and action nodes.
edgesarrayYesAction-to-condition continuation edges.
decision_groupsarrayYesCondition-to-action selection groups.
is_demobooleanNoWhen true, skips the fee-aware principal check.

Nodes

Each node is either a CONDITION or an ACTION.
{
  "node_id": "condition_entry",
  "type": "CONDITION",
  "level": 0,
  "condition": {}
}
{
  "node_id": "buy_yes",
  "type": "ACTION",
  "level": 0,
  "action": {}
}
FieldTypeRequiredMeaning
node_idstringYesUnique node identifier.
typestringYesCONDITION or ACTION.
levelnumberYesGraph level. Must be 0 or greater.
conditionobjectFor condition nodesDecision logic.
actionobjectFor action nodesCapital movement or execution instruction.

Condition object

{
  "watch": {
    "venue": "POLYMARKET",
    "market_id": "btc-above-100k-may-2026",
    "outcome_token": "YES",
    "token_id": "1234567890"
  },
  "signal": "IMPLIED_PROBABILITY",
  "trigger": "CROSS_ABOVE",
  "threshold": 0.6
}
FieldTypeRequiredMeaning
watchobjectYesMarket or selector to observe.
signalstringYesSignal type.
triggerstringYesCROSS_ABOVE or CROSS_BELOW.
thresholdnumberYesTrigger threshold.
timingobjectFor time signalsTiming details.
referenceobjectNoReference mode for return or PnL signals.
stabilizersobjectNoHysteresis or cooldown settings.
conjunctsarrayNoAdditional AND clauses.

Action object

{
  "action_type": "BUY_MARKET_OUTCOME",
  "allocation_pct": 100,
  "target": {
    "venue": "POLYMARKET",
    "market": {
      "market_id": "btc-above-100k-may-2026",
      "outcome_token": "YES",
      "token_id": "1234567890"
    }
  }
}
FieldTypeRequiredMeaning
action_typestringYesAction to perform.
allocation_pctnumberRequired in SPLIT_100 groupsPercentage of selected capital.
targetobjectYesMarket, wallet, or vault target.
risk_guardsobjectNoExecution guardrails.

Edges

Edges represent continuation after an action.
{
  "edge_id": "edge_1",
  "from_node_id": "buy_yes",
  "to_node_id": "condition_exit"
}
Edges must always be action-to-condition.

Decision groups

Decision groups represent condition-to-action selection.
{
  "group_id": "entry_group",
  "condition_node_id": "condition_entry",
  "action_node_ids": ["buy_yes", "hold_cash"],
  "level": 0,
  "mode": "SPLIT_100"
}
FieldTypeRequiredMeaning
group_idstringYesUnique decision group identifier.
condition_node_idstringYesCondition node that selects actions.
action_node_idsarrayYesActions selected by the condition.
levelnumberYesSame level as the condition and selected actions.
modestringYesSINGLE or SPLIT_100.
priority_orderarrayNoOrdered action IDs for priority-aware selection.

Relationship model

Use decision_groups for condition-to-action relationships. Use edges only for action-to-condition continuation.
condition_entry --decision group--> buy_yes
buy_yes --edge--> condition_exit
condition_exit --decision group--> sell_yes
This separation makes the graph unambiguous for humans and AI agents.