size_trade
Calculate a trade's size, notional, leverage, margin, stop risk, target payoffs, and liquidation price before placing a bracketed order, plus the maximum margin available.
Instructions
Size one trade before placing it, with the rules place_bracket uses: size, notional, leverage, margin, dollars at risk at the stop, payoff at each target and the liquidation price, plus the most this account's margin allows on the coin. The side follows the levels: stop below entry is a long, above is a short. targets adds a payoff per target price; leverage overrides the default (capped by the profile); equity_usd sizes a what-if account and skips the margin check. Use before every place_bracket; never size a trade by hand. Places nothing. Needs a configured account unless equity_usd is given. Returns {sizing: {side, size, notional_usd, leverage, margin_usd, risk_usd, risk_pct, targets[], liq_px, reason, warnings[]}, max_by_margin}, or the sizing alone for a what-if. A trade that cannot be sized (stop at the entry, equity too small) comes back can_trade false with size null and the reason.
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": {
"coin": "<coin>",
"entry_px": "<entry_px>",
"stop_px": "<stop_px>"
},
"name": "size_trade"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | Yes | Coin: a main-dex perp by name (BTC, ETH) or a HIP-3 perp as dex:SYMBOL (xyz:GOLD, xyz:BRENTOIL). | |
| stop_px | Yes | Planned stop: below entry for a long, above for a short. | |
| targets | No | Target prices to report the payoff for. | |
| entry_px | Yes | Planned entry price. | |
| leverage | No | Leverage to size at (capped by the profile). | |
| equity_usd | No | What-if equity in USD instead of the account's own. |