Skip to main content

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

PurposeEndpoint
Triggers on an accountGET /account/{account_id}/triggers
Placement historyGET /account/{account_id}/triggers/history/placements
Finalisation historyGET /account/{account_id}/triggers/history/finalisations
Active triggers, exchange-wideGET /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.

These materials are provided for informational purposes only and do not constitute financial, investment, legal, or tax advice, or an offer or solicitation to buy or sell any asset. Trading digital assets and derivatives involves substantial risk, including the possible loss of some or all capital. Products may not be available in all jurisdictions. Users are responsible for evaluating suitability and complying with applicable laws.