Build a signed canonical payload to deposit USDC collateral into a perpetual DEX account (Lighter) or bridge USDC into a Gains account.
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.
create-order. Skip this for Gains.originChainId to the Lighter L2 account via a multi-step Relay route.
Deposits are eventually consistent and tracked asynchronously — the execute-v2 response carries a processId you poll via /2/perp/check-process.
accountIndex to the L1 address — needed by /2/perp/payloads/create-account and every subsequent trade/withdraw call. See the create-account page for how to discover the accountIndex afterwards.payloadStr is a canonical envelope whose payload carries a Relay-style route:
payloadStr.kind === "transaction" and every item whose status !== "complete", sign the tx with the user’s key on item.data.chainId.payload.signedTxs.finalPayloadStr.`api/2/perp/execute-v2-${timestamp}-${finalPayloadStr}` and call /2/perp/execute-v2 with that payloadStr and no top-level signedTx.lighter.lighter:301 or lighter:304.chainId for a same-chain deposit."250" or "100.5"). Must be positive./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 | deposit payload generation failed — bridge unavailable, insufficient USDC, or DEX refusal |
lighter Destination Lighter chain (lighter:301 or lighter:304).
Source chain holding the user's USDC.
USDC amount as a decimal string (e.g., "250"). Must be positive.