size the order closes the whole position. The SDK places them the way the ZEUS app does, as orders attached to the position, so they are cleared together with it.
Take profit and stop loss are
decrease orders:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Close a position at a trigger price.
const tp = await zeus.orders.takeProfit({ market: 'ETH/USD', side: 'long', triggerPrice: 2600 })
const sl = await zeus.orders.stopLoss({ market: 'ETH/USD', side: 'long', triggerPrice: 2250, size: 500 })
size the order closes the whole position. The SDK places them the way the ZEUS app does, as orders attached to the position, so they are cleared together with it.
| Order | A Long triggers | A Short triggers |
|---|---|---|
| Take profit | at or above the price | at or below the price |
| Stop loss | at or below the price | at or above the price |
decrease orders:
await zeus.orders.update({ kind: 'decrease', orderIndex: tp.orderIndex, triggerPrice: 2650 })
await zeus.orders.cancel({ kind: 'decrease', orderIndex: sl.orderIndex })