Request Body
Unix timestamp in milliseconds. Must be within 30 seconds of the current time. Used to prevent replay attacks.
Signature of the message
api/2/perp/lighter/cancel-order-{timestamp} signed with your wallet’s private key. The signature is used to verify your identity and associate with your Lighter account.The index of the order to cancel. This can be found in your unfilled orders from the
/2/wallet/positions/perp/unfilled endpoint.The market ID where the order exists. This can be found in your unfilled orders from the
/2/wallet/positions/perp/unfilled endpoint.Response
Always
true on successful cancellation.Array of transaction execution details (optional). Each object contains:
Error Responses
400 Bad Request
Error message (e.g. “validation failed”)
Array of validation errors (Zod issues) if validation fails.
403 Forbidden
Error message
"timestamp expired"- The timestamp is more than 30 seconds old"no lighter account associated with the signer address"- The signature doesn’t match a registered Lighter account
500 Internal Server Error
Error message (e.g. “error canceling order”)
- The cancellation fails on Lighter
- The order doesn’t exist or cannot be canceled
- Other internal errors occur
Authentication
- Generate a current Unix timestamp in milliseconds
- Create the message string:
api/2/perp/lighter/cancel-order-{timestamp} - Sign this message with your wallet’s private key
- Include both the
timestampandsignaturein the request body - The signature must be from a wallet address that has a registered Lighter account