Skip to Content
Symmio Trading-SDK — the SDK surface for builders on Arbitrum
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 }.

A resolved call establishes submission acceptance, not confirmed deletion. Check a complete live-order search through searchTpSlOrders before treating absence as removal. Notifications from watchTpSlNotifications can prompt reconciliation, but cannot identify which mutation completed or order successive changes.

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

  • DELETE_TPSL_INVALID_RESPONSE for a missing/malformed successful field. Only boolean true or string "true" establishes acceptance; explicit false / "false" yields DELETE_TPSL_REJECTED.
  • SymmError when the chain has no tpsl config or signing fails.
  • SymmApiError when the handler request fails.

Mutation options

Acceptance does not confirm deletion. Check a complete live-order search before interpreting absence as removal. A malformed response or transport failure can leave the outcome unknown; the action does not retry automatically. Notifications are useful refresh signals but cannot distinguish successive mutations without backend correlation/version metadata.

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

deleteQuoteTpSlMutationOptions returns { mutationKey, mutationFn, retry: false }; the mutationFn takes the same parameters object as the action. Automatic retries are explicitly disabled, including host-level mutation retry defaults. A lost acknowledgment, timeout or network error may follow an accepted write. Reconcile state before explicitly submitting again; do not override this policy without a proven replay guarantee.

Last updated on