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.

A condition watches a signal and decides which action or actions can run. In strategy JSON, a condition node has type: "CONDITION" and a condition object.

Condition fields

FieldMeaning
watchThe market or market selector to observe.
signalThe value to evaluate.
triggerThe crossing direction.
thresholdThe numeric trigger value.
timingOptional timing data for time conditions.
referenceOptional reference mode for return or PnL conditions.
stabilizersOptional debounce-style controls.
conjunctsOptional additional AND clauses.

Signals

signalUse when
IMPLIED_PROBABILITYYou want to react to market price or probability.
ROI_PCTYou want to react to return on investment.
PNL_USDYou want to react to profit or loss in dollars.
TIME_SINCE_GROUP_SECONDSYou want to trigger after time has passed in a decision group.
TIME_TO_RESOLUTION_SECONDSYou want to trigger based on time remaining before resolution.

Triggers

Use CROSS_ABOVE when the signal must move above threshold. Use CROSS_BELOW when the signal must move below threshold.

Market watch

watch identifies the market and outcome the condition observes.
{
  "venue": "POLYMARKET",
  "market_id": "btc-above-100k-may-2026",
  "outcome_token": "YES",
  "token_id": "1234567890"
}
For recurring markets, add watch_selector.
{
  "venue": "POLYMARKET",
  "market_id": "btc-hourly-reference-market",
  "outcome_token": "YES",
  "watch_selector": {
    "recurring_tag_id": 102175,
    "recurring_label": "1h",
    "recurring_family_key": "series:btc-hourly",
    "topic_key": "btc",
    "fallback_market_id": "btc-hourly-reference-market",
    "auto_roll": true
  }
}

Time conditions

Time conditions require a timing object. For a trigger before close:
{
  "signal": "TIME_SINCE_GROUP_SECONDS",
  "trigger": "CROSS_ABOVE",
  "threshold": 0,
  "timing": {
    "mode": "BEFORE_CLOSE",
    "seconds_before_close": 300
  }
}
For an absolute trigger time:
{
  "signal": "TIME_SINCE_GROUP_SECONDS",
  "trigger": "CROSS_ABOVE",
  "threshold": 0,
  "timing": {
    "mode": "ABSOLUTE_TIME",
    "absolute_trigger_time_iso": "2026-05-18T18:00:00Z"
  }
}

AND clauses

Use conjuncts when a condition needs more than one clause. All clauses must pass for the condition to pass.
{
  "condition": {
    "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,
    "conjuncts": [
      {
        "watch": {
          "venue": "POLYMARKET",
          "market_id": "eth-above-5k-may-2026",
          "outcome_token": "YES",
          "token_id": "9876543210"
        },
        "signal": "IMPLIED_PROBABILITY",
        "trigger": "CROSS_BELOW",
        "threshold": 0.4
      }
    ]
  }
}