Skip to main content
Attach trigger orders to any order, or place standalone TP/SL on existing positions. The registered provider plugin authorizes both flows with its SDK-managed credential; the user’s wallet is not prompted.
The examples on this page use Hyperliquid (provider: 'hyperliquid'). Replace the provider value with any supported DEX from getProviders().

Take Profit & Stop Loss

Attach trigger orders to any order using the takeProfit and stopLoss fields on placeOrder:
This produces multiple actions: Trigger wires are bundled into the placeOrder action. The placeTriggerOrder action type only appears for standalone trigger orders (via placeTriggerOrder()).
If limitPrice is omitted, the trigger executes as a market order. If size is omitted, the trigger covers the entire position and tracks later position-size changes. Set size to a base-asset decimal string for a fixed partial-position trigger.

Trigger Order Enums

The SDK exports enums for trigger order types and their lifecycle status:

Standalone Trigger Orders

Place standalone TP/SL orders on existing positions, separate from a main order, via placeTriggerOrder:
placeTriggerOrder() sends a placeTriggerOrder action type, which creates standalone trigger orders on existing positions.
API Reference: POST /createAction · /executeAction