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, lighterMarket 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.
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”)
- 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”)
- 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
payloadStrfrom 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
- Currently not implemented
Example Flow
- Call
/2/perp/quoteto get a quote and payload - Sign the
payloadStrfrom the quote response - Call
/2/perp/executewith the quote response data plus your signature - Receive execution confirmation with transaction details