Triggers
Triggers are conditional orders held by the exchange and submitted when the market reaches a trigger price. Product behavior is described in Take Profit and Stop Loss.
Add a trigger
import { Side, TriggerKind } from "@n1xyz/nord-ts";
const { actionId, triggerId } = await user.addTrigger({
marketId: 0,
side: Side.Ask,
kind: TriggerKind.StopLoss, // or TriggerKind.TakeProfit
triggerPrice: 45000,
limitPrice: 44900, // optional; omit for a market-style exit
limitBaseSize: 0.1, // optional
limitQuoteSize: undefined, // optional alternative to limitBaseSize
accountId, // optional
});
triggerPrice must be positive. Size the resulting order with either
limitBaseSize or limitQuoteSize.
Edit and remove
editTrigger replaces the trigger's parameters, so pass the full definition —
triggerId, marketId, side, kind, triggerPrice, and any limit fields —
not just the fields you are changing.
await user.editTrigger({
triggerId,
marketId: 0,
side: Side.Ask,
kind: TriggerKind.StopLoss,
triggerPrice: 44000,
limitBaseSize: 0.1,
});
await user.removeTrigger({ marketId: 0, triggerId });
Query triggers
| Purpose | Endpoint |
|---|---|
| Triggers on an account | GET /account/{account_id}/triggers |
| Placement history | GET /account/{account_id}/triggers/history/placements |
| Finalisation history | GET /account/{account_id}/triggers/history/finalisations |
| Active triggers, exchange-wide | GET /triggers/active |
A trigger is Active until it fires (Success), is cancelled, or is removed, so
reconcile against the placement and finalisation history rather than assuming a
trigger is still live.