Skip to Content
Symmio Trading-SDK — the SDK surface for builders on HyperEVM
CoreTP/SLpriceSlippageCalculation

priceSlippageCalculation

Shift a trigger price by slippage percent in the direction the conditional order would fill at. Used to derive the price field on each TpSlConditionalOrderLeg — the handler fills against this wide tolerance. The result is rounded to pricePrecision decimals to match the market.

  • SHORT: shifts up by 1 + slippage / 100.
  • LONG: shifts down by 1 − slippage / 100.
import { priceSlippageCalculation } from "@symmio/trading-core"; priceSlippageCalculation("100", 90, PositionType.LONG, 4); // "10.0000"

Parameters

pricestringrequired

Trigger price to shift (decimal string).

slippagenumberrequired

Slippage percent.

positionTypePositionTyperequired

Quote direction; sets the shift direction.

pricePrecisionnumberrequired

Decimals to round the result to.

Returns

string
The slippage-shifted price as a decimal string, rounded to pricePrecision decimals.

DEFAULT_TPSL_SLIPPAGE_LOWCAPS

When a caller doesn’t pass slippage, setQuoteTpSl falls back to the exported default:

import { DEFAULT_TPSL_SLIPPAGE_LOWCAPS } from "@symmio/trading-core"; // 90 (percent — the handler quotes against a very wide tolerance for lowcap markets)
Last updated on