Skip to content

Protect

Status: Live | MCP tool: strategy_protect_create

A pure downside guard on a held position -- same executor as stop-loss, framed for the case where the only goal is capping loss (take-profit is optional here, not the point).

Shares the stop-loss executor with Stop-loss / take-profit -- identical config and mechanics.

Params

Param Type Default Meaning
wallet_address string required Agent's managed wallet address.
target_token string required Held position's mint.
position_amount int required Base units of target_token to liquidate on trigger.
stop_loss_pct float none Fraction below entry that triggers an exit (e.g. 0.15 = 15%).
take_profit_pct float none Fraction above entry that triggers an exit.
trailing bool false Trail the stop behind the running high.
trailing_distance_pct float none Trailing distance when trailing=true.
entry_price float none Override the detected entry price.
source_token string "USDC" Token received on exit.
interval_seconds int 60 Tick cadence (tight -- monitors price).
slippage_bps int 50 Max slippage on the exit fill.

Direction (optional, all deterministic signals): direction_mode (auto | long_only | short_only | manual, default auto -- follow the detected market regime, reducing exposure in a bear instead of accumulating), allow_short (bool -- enable real shorts via the perps venue adapter), regime_override (bull | bear | range | volatile -- force a regime instead of trusting detection). All three are deterministic signals, not predictions -- DYOR.

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_protect_create", {
    "wallet_address": "<AGENT_PUBLIC_KEY>",
    "target_token": "So11111111111111111111111111111111111111112",
    "position_amount": 5_000_000_000,
    "stop_loss_pct": 0.12,
    "trailing": True,
    "trailing_distance_pct": 0.04,
})

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.

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