place_bracket_order
Place a bracket order for a new position, combining entry, take profit, and stop loss in one transaction. Ensures TP and SL are set with OCO behavior, so they cancel each other.
Instructions
Place a bracket order for a NEW position (entry + take profit + stop loss in one order)
Args: coin: Trading pair (e.g., "BTC", "ETH") side: Order side ("buy" or "sell") size: Number of tokens/coins to trade (NOT dollar value - e.g., 0.1 for 0.1 SOL, not $20) entry_price: Entry limit price per token take_profit_price: Take profit price per token stop_loss_price: Stop loss price per token client_order_id: Optional client order ID (128-bit hex string, e.g. 0x1234567890abcdef1234567890abcdef)
IMPORTANT: The 'size' parameter is the NUMBER OF TOKENS, not dollar value. If user wants "$20 worth of SOL" at $150/SOL, calculate: $20 ÷ $150 = 0.133 SOL
Note: This creates a NEW position with TP/SL. For existing positions, use set_take_profit_stop_loss. Uses HyperLiquid's normalTpSl grouping for proper OCO behavior where TP and SL orders cancel each other.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | Yes | ||
| side | Yes | ||
| size | Yes | ||
| entry_price | Yes | ||
| client_order_id | No | ||
| stop_loss_price | Yes | ||
| take_profit_price | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||