Build a signed canonical payload to cancel an unfilled limit order (or TP/SL attached to a position) on Gains Network or Lighter.
Builds the payload to cancel an unfilled order. For Gains,Documentation Index
Fetch the complete documentation index at: https://docs.mobula.io/llms.txt
Use this file to discover all available pages before exploring further.
orderType distinguishes pending limit orders (order) from TP/SL legs (tp, sl) attached to an open trade.
gains or lighter.^\d+$). Obtainable from /2/wallet/perp/orders.order, tp, sl. Omit for Lighter./2/perp/payloads/<action> endpoint verifies the caller by requiring two extra fields in the request body alongside the action parameters:
personal_sign) of the message `${endpoint}-${timestamp}`, where endpoint is the path of this endpoint without the leading slash (e.g., for this page: api/2/perp/payloads/<this-action>). The recovered signer address becomes the user for the request. Single-use — replay returns 403 signature already used.| Status | message |
|---|---|
| 403 | timestamp expired — timestamp older than 30s |
| 403 | signature already used — replay attempt |
| 400 | zod validation failed — timestamp/signature shape invalid |
/2/perp/payloads/<action> endpoint returns the same envelope shape. You pass these fields verbatim into POST /2/perp/execute-v2 to execute the action.
| Status | message |
|---|---|
| 400 | cancel-order payload generation failed — order not found or DEX refusal |
data.transport.
gains, lighter Positive integer string (regex ^\d+$).
Required by Lighter.
Gains only. Omit for Lighter.
order, tp, sl