Skip to content

Composite (signal-rule DSL)

Status: Live | MCP tool: strategy_composite_create

The 17th strategy type: an agent-authored declarative signal-rule combination -- never free-form code. Build one by (1) enumerating available streams with list_signal_catalog, (2) validating a definition for free with compose_strategy (schema, stream existence, rule-tree depth/size limits, required risk caps, and an anti-gaming check -- a social sentiment/trend_social stream may never be the sole entry trigger), then (3) creating it live.

Params

Param Type Default Meaning
wallet_address string required Agent's managed wallet address.
definition dict required Declarative signal-rule DSL definition -- validate first with compose_strategy; enumerate streams with list_signal_catalog.
interval_seconds int 300 Tick cadence.
mode string "live" live or paper -- recorded on the config; defaults to live.

risk (optional dict, all percent units, <= 0 disables that single guard; omitted keys keep the model's safe defaults): max_position_pct, max_portfolio_exposure_pct, max_single_loss_pct, max_drawdown_pct, max_daily_loss_pct.

Example create call

result = await client.call_tool("strategy_composite_create", {
    "wallet_address": "<AGENT_PUBLIC_KEY>",
    "definition": {
        "entry": {"all": [
            {"stream": "technical.rsi_14", "op": "<", "value": 30},
            {"stream": "regime.detected", "op": "==", "value": "range"},
        ]},
        "exit": {"any": [
            {"stream": "technical.rsi_14", "op": ">", "value": 70},
        ]},
        "target_token": "So11111111111111111111111111111111111111112",
        "usd_per_action": 15,
    },
    "interval_seconds": 300,
    "mode": "live",
})

A successful create returns strategy_id, strategy_type, status, schedule, and managed_signing (whether the wallet has a Turnkey signer -- false means each tick returns an unsigned tx to sign).

Policy interaction

Every create call runs through the same gate stack as a hand-built trade before it persists: rate limiting, identity/capability check, the per-wallet policy_gate (action strategy_create), USD-notional sizing against policy limits, an idempotency check, and the platform kill switch. A wallet without a Turnkey signing key still gets the strategy -- each due tick returns an unsigned transaction for the owner to sign instead of executing autonomously.

LIVE BY DEFAULT: creation defaults to mode="live"; the response recommends running backtest_strategy (strategy_type="composite") on the definition first -- historical results are not predictive, DYOR. definition is an immutable identity key: strategy_modify refuses to edit it in place, same as target_token / tracked_wallet / venue on the other types -- cancel and create a new composite for a different rule set. Shares the same non-custodial create path and risk-limit contract (risk dict) as the other 16 types; direction params are not applicable (the DSL expresses its own entry/exit rules).

Lifecycle

Every strategy type shares one lifecycle surface once created:

  • strategy_status(strategy_id, wallet_address) -- config, state, P&L, next tick.
  • strategy_modify(strategy_id, wallet_address, config_updates=..., risk=..., ...) -- retune in place without losing execution history; fields that define WHAT the strategy trades (target_token / source_token / tracked_wallet / venue / a composite definition) are immutable and refused -- cancel and create a new strategy to change those.
  • strategy_pause / strategy_resume -- manual pause and re-enable.
  • strategy_cancel(strategy_id, wallet_address) -- stop for good (terminal).
  • strategy_list(wallet_address, detail="concise"|"full") -- every strategy the wallet owns.

Full param docs for all six lifecycle tools: MCP tool reference.

See also