Position Sizing
workflow.run_position_sizingCalculate the correct position size given a maximum risk in USDT and a stop-loss price. Use when user asks "how many coins should I buy?" or "size my position so I risk exactly $X". Returns: positionSize (base), positionUsdt, marginRequired.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | ||
| leverage | No | Leverage, default 1 | |
| riskUsdt | Yes | Maximum acceptable loss in USDT | |
| stopLoss | Yes | Stop-loss price | |
| entryPrice | Yes | Entry price | |
| feeOpenPct | No | Opening fee fraction, default 0.0002 | |
| feeClosePct | No | Closing fee fraction, default 0.0005 | |
| contractType | No | linear = USDT-margined (default), inverse = coin-margined. For inverse, sizeQuote is USD contracts and margin is returned in the base coin. |