Opening, Editing, Closing, and Canceling Positions
Updated May 22, 2026 · 2 min read
Open, resize, and close Hyperliquid positions from your strategy wallets, set TP/SL, and cancel resting orders.
Where positions live
Senpi uses dedicated strategy sub-wallets to open positions. Your Main Senpi wallet is only for funding and managing money - it cannot open positions directly. To trade, you need to fund a strategy wallet and place orders from there. If you tried to place an order from your Main Wallet and nothing happened, this is why.
The four primary position-management MCP tools
create_positionOpens one position inside an existing strategy.
- parameters
- strategy id, asset (case-sensitive - BTC, ETH, kPEPE, xyz:TSLA), direction (LONG/SHORT), leverage, size in USD notional, optional TP/SL %, optional
orderType. - orderType
MARKETfills immediately.FEE_OPTIMIZED_LIMITplaces a maker ALO order that rests (if you omitfeeOptimizedLimitOptions) or falls back to market after a timeout (article 8).- TP/SL
- Percentages are relative to margin, not raw price (article 11).
- prerequisite
- You need an existing strategy first - create one with
strategy_create_custom_strategy.
edit_positionResizes a position, flips its direction, or updates TP/SL on an existing position.
- semantics
- Uses target-size semantics, not delta. Partial closes go through
edit_position, notclose_position. - restriction
- Does not accept
orderType: LIMIT- returnsEDIT_LIMIT_NOT_SUPPORTED(since March 2026 schema update).
close_positionFully closes a single position and clears its TP/SL triggers.
- restriction
- Does not accept
orderType: LIMIT- returnsCLOSE_LIMIT_NOT_SUPPORTED.
strategy_close_positionsCloses one or more positions on a strategy while the strategy itself stays ACTIVE or PAUSED.
- gotcha
- Passing an empty
coinsarray (or omittingcoins) closes ALL positions on that strategy.
cancel_orderCancel a resting order. Idempotent - calling it on an order that is already filled or cancelled will not error; you get a status indicating the current state.
- parameters
- Pass the coin (case-sensitive) and the order id.
- states
- Orders in
PENDINGorRESTINGstate can be cancelled; onceFILLEDthey cannot. - fee-optimized
- For fee-optimized orders that may rest indefinitely (when
feeOptimizedLimitOptionsis omitted), either callcancel_orderexplicitly or let the 45-second server-default fallback to market handle it (if you setensureExecutionAsTaker: true).
Exit price vs mark price
The exit price shown is the average price across all fills when closing the position, not the mark price at the time of exit. If a position was partially sold over time, each partial sale contributes to the average exit price, which can result in the displayed exit price differing from the mark price at the final close. Market orders also execute at fill price, not mark price, and there can be differences between the two, especially during volatile moves.
For automated exits, see Section H. For strategy-level open/close (not position-level), see article 16.
Trade on Senpi
Open, edit, and close Hyperliquid positions from the app.
Related articles
Tradeable Assets: Crypto, Equities, and XYZ DEX
Trade 275+ perps across crypto, equities, and metals on Hyperliquid, with per-asset leverage limits and case-sensitive symbols.
Trading Mechanics: Margin, Leverage, TP/SL, Funding, and Liquidation
How margin, leverage, and liquidation price work on Senpi, plus margin-relative TP/SL and hourly funding rates.
