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

getTpSlConfig

Fetch the handler’s /configs/ rules — the constraints a TP/SL request must satisfy. The wire fields (MinPriceDistancePercent, MinProfitStopLossSpreadPercent) are camel-cased on the SDK boundary.

import { getTpSlConfig } from "@symmio/trading-core"; const config = await getTpSlConfig(sdkConfig); // { minPriceDistancePercent, minProfitStopLossSpreadPercent }

Parameters

chainIdnumberoptional

Target chain id. Defaults to the config’s defaultChainId.

Returns

The handler rules. Feed this into validateTpSl before submitting.

Throws

  • SymmError when the chain has no tpsl config.
  • SymmApiError when the HTTP request fails.

Query options

import { getTpSlConfigQueryOptions } from "@symmio/trading-core"; import { useQuery } from "@tanstack/react-query"; useQuery(getTpSlConfigQueryOptions(config));

getTpSlConfigQueryOptions takes no required inputs; chainId is optional. getTpSlConfigQueryKey builds the matching cache key.

Last updated on