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

deleteQuoteTpSl

Cancel a live TP or SL order by its handler-issued cohQuoteId. Internally: resolves the handler URL + DELETE signing spec, builds a TpSlDeleteMessage bound to the target cohQuoteId + side, signs it with the session-key wallet, and calls DELETE /api/v5/ with { typedData, signature, signer }.

The handler returns 200 on accept; the cancel is only fully confirmed once the WebSocket reports state: "cancel" (or canceled / cancelled). Callers should subscribe via watchTpSlNotifications and reconcile.

import { deleteQuoteTpSl } from "@symmio/trading-core"; await deleteQuoteTpSl(config, { from: sessionKey, quoteId: 42n, virtualAccount, cohQuoteId: "coh4213", conditionalOrderType: "take_profit", });

Parameters

quoteIdbigintrequired

On-chain quote id the order belongs to (used for cache invalidation).

virtualAccountAddressrequired

PartyA (the VA address) that owns the quote.

cohQuoteIdstringrequired

Handler-issued conditional-order id targeted by the delete.

conditionalOrderType"take_profit" | "stop_loss"required

Which side is being canceled (TpSlConditionalOrderType).

fromAddressoptional

Session-key signer the wallet client resolves for. Defaults to the connected wallet in the React layer.

chainIdnumberoptional

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

Returns

DeleteQuoteTpSlReturnType
successtrue

Always true on a resolved call (failures throw).

Throws

  • SymmError when the chain has no tpsl config or signing fails.
  • SymmApiError when the handler request fails.

Mutation options

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

deleteQuoteTpSlMutationOptions returns { mutationKey, mutationFn }; the mutationFn takes the same parameters object as the action.

Last updated on