Skip to main content
POST
Build deposit payload
Lighter-only. Gains has no deposit endpoint — collateral on Gains is sent directly with each create-order. Skip this for Gains.
Bridges USDC from originChainId to the Lighter L2 account via a multi-step bridge route. Deposits are eventually consistent and tracked asynchronously — the execute-v2 response carries a processId you poll via /2/perp/check-process.
First-time deposits register the account on Lighter. If the EOA has never deposited on Lighter, this call must transfer ≥ 5 USDC (a Lighter-side requirement). Once the bridge settles, Lighter assigns an 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.

Lighter deposit payload shape

The response’s payloadStr is a canonical envelope whose payload carries a bridge route with one or more transaction steps:
Client workflow (Lighter):
  1. Parse payloadStr.
  2. For every step with kind === "transaction" and every item whose status !== "complete", sign the tx with the user’s key on item.data.chainId.
  3. Push each signed hex string (in order) into a new array payload.signedTxs.
  4. Re-stringify the envelope → finalPayloadStr.
  5. Sign `api/2/perp/execute-v2-${timestamp}-${finalPayloadStr}` and call /2/perp/execute-v2 with that payloadStr and no top-level signedTx.

Request Body

dex
string
required
Must be lighter.
chainId
string
required
Destination Lighter chain. Must be lighter:304 — only id the router accepts for deposit today.
originChainId
string
required
EVM chain holding the user’s USDC. Confirmed working: evm:42161 (Arbitrum), evm:8453 (Base). Other EVM chains may resolve — open an issue if you need one that isn’t listed.
amountUsdc
string
required
USDC amount as a decimal string (e.g., "250" or "100.5"). Must be positive.

Authentication

Every /2/perp/payloads/<action> endpoint verifies the caller by requiring two extra fields in the request body alongside the action parameters:
timestamp
number
required
Unix timestamp in milliseconds. Must be within 30 seconds of server time. Older timestamps are rejected to prevent replay.
signature
string
required
Hex signature (EIP-191 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.

Authentication errors

Statusmessage
403timestamp expired — timestamp older than 30s
403signature already used — replay attempt
400zod validation failedtimestamp/signature shape invalid

Response envelope

Every /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.
Top-level shape. Successful (2xx) responses return { data: { ... } }. A success: true flag is only present inside the body of execute-v2’s response, not on the payload-build endpoints. Parse defensively: read body.data, then check for the action-specific fields you need (e.g. data.payloadStr).
data
object

Endpoint-specific errors

Statusmessage
400deposit payload generation failed — bridge unavailable, insufficient USDC, or DEX refusal

Example — Lighter bridge from Arbitrum

Body

application/json
timestamp
number
required
signature
string
required
dex
enum<string>
required
Available options:
lighter
chainId
string
required

Destination Lighter chain (lighter:301 or lighter:304).

originChainId
string
required

Source chain holding the user's USDC.

amountUsdc
string
required

USDC amount as a decimal string (e.g., "250"). Must be positive.

Response

200 - application/json

Canonical payload envelope

success
boolean
required
data
object
required