Skip to Content
Symmio Trading-SDK — the SDK surface for builders on Arbitrum
CoreTP/SLbuildConditionalOrderLeg

buildConditionalOrderLeg

Build one leg (TP or SL) of a conditional-order message (TpSlConditionalOrderLeg). Maps the SDK’s TpSlPriceType (markPrice / lastPrice) onto the handler’s wire form (market / last_close) and defaults orderType to market-best-effort (2), the close-only order type accepted for TP/SL. setQuoteTpSl builds each leg with this.

import { buildConditionalOrderLeg } from "@symmio/trading-core"; const leg = buildConditionalOrderLeg({ quantity: "100", price: "10.0000", conditionalPrice: "150.0000", priceType: "markPrice", });

Parameters

quantitystringrequired

Quote quantity (decimal string).

pricestringrequired

Slippage-shifted fill price (decimal string, rounded to market precision).

conditionalPricestringrequired

Trigger price (decimal string, rounded to market precision).

priceTypeTpSlPriceTyperequired

markPrice or lastPrice; mapped to the wire conditionalPriceType.

orderTypenumberoptional

Wire order_type. Defaults to 2 (market-best-effort). An explicit 0 selects limit; the handler rejects 1 (market) for TP/SL.

Returns

The leg, with conditionalPriceType set to last_close when priceType is lastPrice, else market.

Last updated on