workflow.run_pnl_planning
Calculate net PnL, ROE, fees and gross profit/loss for a futures trade. Use when user asks "what's my profit/loss on this trade?" Returns: grossPnl, fees, netPnl, netPnlUsdt, roe (%).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | Trade direction | |
| size | Yes | Position size — base asset qty for linear, USD contracts for inverse | |
| exitPrice | Yes | Exit price (positive) | |
| entryPrice | Yes | Entry price (positive) | |
| feeOpenPct | No | Opening fee as fraction, e.g. 0.0002 = 0.02% | |
| feeClosePct | No | Closing fee as fraction | |
| contractType | No | linear = USDT-margined (default), inverse = coin-margined. For inverse, pnl/fees are returned in the base coin, not USDT. |