Skip to Content
Symmio Trading-SDK — the SDK surface for builders on HyperEVM
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. 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 1 (market).

Returns

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

Last updated on