Request Body
The request body should contain the exact response from the /2/perp/quote endpoint, plus a signature field.
The DEX identifier. Possible values: gains, lighter
Market pair identifier from the quote response.
Blockchain ID from the quote response.
Execution payload object from the quote response. Structure varies by DEX type (see quote endpoint documentation).
JSON stringified version of the payload from the quote response. For Lighter orders, this must be signed by the user’s wallet.
Signature of the payloadStr message. For Lighter orders, sign the payloadStr with your wallet’s private key. The signature is used to verify the signer’s address and associate it with a Lighter account.
Response
Execution result. Always true on successful execution
Array of execution details (optional). Each object contains: Show executionDetails Array Item
Transaction hash of the execution
Array of order statuses (optional). Each object contains: Show orderStatuses Array Item
Error Responses
400 Bad Request
Error message (e.g. “invalid payloadStr”, “Validation failed”)
Array of validation errors (Zod issues) if validation fails.
403 Forbidden
Error message (e.g. “no lighter account associated with the signer address”)
This error occurs when:
The signature doesn’t match a registered Lighter account
The signer address extracted from the signature has no associated Lighter account
500 Internal Server Error
Error message (e.g. “could not extract user address from signed payload”, “internal server error”)
This error occurs when:
The execution fails on the DEX
The payload type is not supported (e.g. EVM not yet implemented)
Other internal errors occur
Authentication
For Lighter orders:
Sign the payloadStr from the quote response using your wallet’s private key
The signature must be from a wallet address that has a registered Lighter account
The API will verify the signature and extract your address to associate with the Lighter account
For EVM orders:
Currently not implemented
Example Flow
Call /2/perp/quote to get a quote and payload
Sign the payloadStr from the quote response
Call /2/perp/execute with the quote response data plus your signature
Receive execution confirmation with transaction details