Scale Out
workflow.run_scale_outScale-out planner: P&L, ROI, and cumulative P&L for each partial exit level. Edge cases: entry_price and total_size above zero; 2 to 10 exits, each price above zero and pct above 0 and at most 100, the pct values summing to at most 100 (less than 100 leaves the rest open); fees are fractions from 0 to 0.05. Not covered: the remainder not sold, funding, slippage, and the chance that each level is reached. Use when user wants to take profit at multiple targets: "close 30% at $90k, 30% at $95k, 40% at $100k, what's my total P&L?". Returns: per-level pnl, weightedAvgExitPrice, totalRoi.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"side": "<side>",
"entry_price": "<entry_price>",
"total_size": "<total_size>",
"exits": "<exits>"
},
"name": "workflow.run_scale_out"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | Trade direction: "long" or "short" | |
| exits | Yes | Partial exit levels (2 to 10). Each: { price, pct }, e.g. [{ "price": 90000, "pct": 30 }, { "price": 95000, "pct": 70 }]; the pct values must not sum to more than 100. | |
| total_size | Yes | Total position size in base currency | |
| entry_price | Yes | Entry price | |
| contractType | No | linear = USDT-margined (default), inverse = coin-margined. total_size is USD notional (contracts) for inverse, and per-level pnl comes back denominated in the base coin. | |
| fee_open_pct | No | Open fee rate (default 0.0002) | |
| fee_close_pct | No | Close fee rate (default 0.0005) |