Deposits, Transfers and Withdrawals

Deposit via Ethereum Mainnet

To deposit via Ethereum mainnet, you can use the deposit method (0x8a857083) directly. You'll need to specify the following parameters:

  • deposit: the amount of Ether you're depositing. That is optional and only needed when interacting with the contract directly, Lighter's Ethereum gateway page does not require this. You can leave this at zero if you're depositing other kinds of assets.
  • _to: the L1 address you want to credit the deposit to
  • _assetIndex: the asset you want to deposit. You can grab the correct asset id from the assetDetails endpoint
  • _routeType: whether you want to deposit the asset to your perps (0), or spot account (1). Only USDC can be deposited to your perps account
  • _amount: the amount you're depositing. it should be in line with the ERC20's decimals. E.g. 6 decimals for USDC, 18 decimals for Ether etc. 1 USDC, or equivalent, minimum.

If you're depositing assets different from ETH (e.g. USDC), make sure to approve spending for Lighter's smart contract (0x3B4D794a66304F130a4Db8F2551B0070dfCf5ca7) for that ERC20. There is a minimum of 1 USDC, and equivalent for other ERC20s, per deposit.

Deposit via Fun.xyz

Generate a Universal Deposit Address (UDA) address for each client, for any supported chain.

  • Base URL: https://bridge.lighter.xyz
  • Authentication: every request needs to include x-api-key in its header. Builders can contact us through Discord tickets via #support to request one.

For new users, depositing will automatically create an account on Lighter and assign the wallet an account_index.

Create a Universal Deposit Address (UDA)

  • POST request to https://bridge.lighter.xyz/v1/uda
  • Content-Type: application/json
FieldTypeNotes
walletAddressstringThe client's EVM wallet, where funds will be credited
marketstring"perps" or "spot"
assetstring"USDC" or "ETH". ETH is converted to USDC.
accountIndexnumberOptional. It can be used to target a sub-account; if you omit it, the deposit is credited to the master account index.

JSON Body example

{
  "walletAddress": "0x1111111111111111111111111111111111111111",
  "market": "perps",
  "asset": "USDC"
}

Example Response (200)

{
  "depositAddr": "0x2222222222222222222222222222222222222222",
  "solanaAddr": "So1anaDepositAddressExample11111111111111111",
  "tronAddr": "TTronDepositAddressExample1234567890",
  "btcAddrSegwit": "bc1qexampledepositaddress0000000000000000",
  "blocked": false,
  "resolved": {
    "toChainId": "3586256", // lighter's chain id
    "toTokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "actionType": "LIGHTER_PERPS",
    "recipientAddr": "1234", // client's account index, or l1 if the account is new
    "userId": "0x1111111111111111111111111111111111111111"
  }
}

Deposit addresses are used to route and credit the amount to the client's address (returned as userId and recipientAddr).

Deposit minimums

SourceNew accountExisting account
Ethereum mainnet$5$5
EVM-compatible chains$5$3
Solana$5$3
Tron$5$5
Bitcoin$10$10

Note that depositing slightly larger amounts than the minimums advertised above is suggested, as bridge and swap operations may incur slippage and result in a lower amount.

List of supported EVM-compatible chains

ChainChain ID
Polygon137
Base8453
Arbitrum One42161
Optimism10
Binance Smart Chain56
HyperEVM999
Monad143
Ink57073
Robinhood4663

Track Deposit Status

GET request to https://bridge.lighter.xyz/v1/uda/{walletAddress}

walletAddress is the client's wallet, the same one used to generate a UDA above, and returned as userId.

Example Response (200)

{
  "transactions": [
    {
      "fromChainId": "42161",
      "fromTokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
      "fromAmountBaseUnit": "4999999",
      "toChainId": "3586256",
      "toTokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "txHash": "0xabc123...",
      "createdTimeMs": 1787068237169,
      "status": "COMPLETED",
      "depositAddr": "0x2222222222222222222222222222222222222222"
    }
  ]
}

Deposits appear with status: "PROCESSING" shortly after the user’s transaction confirms on the source chain, and moves to "COMPLETED" once the funds are credited on Lighter, typically within a few minutes.

Errors

Example error

{ "errorCode": "InvalidParameterError", "errorMsg": "market must be \"spot\" or \"perps\"" }
HTTPerrorCodeMeaning
400InvalidParameterErrorMalformed body, unsupported market/asset, bad address
403InsufficientPermissionErrorMissing/invalid API key, or wallet not generated by you
502DependencyFailureErrorUpstream temporarily unavailable, retry with backoff

Example (TypeScript)

const BASE = "https://bridge.lighter.xyz";
const KEY = process.env.LIGHTER_BUILDER_KEY!; // server-side only

async function createDepositAddress(walletAddress: string) {
  const res = await fetch(`${BASE}/v1/uda`, {
    method: "POST",
    headers: { "x-api-key": KEY, "Content-Type": "application/json" },
    body: JSON.stringify({ walletAddress, market: "perps", asset: "USDC" }),
  });
  if (!res.ok) throw new Error(`UDA mint failed: ${res.status} ${await res.text()}`);
  return res.json();
}

async function getDepositStatus(walletAddress: string) {
  const res = await fetch(`${BASE}/v1/uda/status/${walletAddress}`, {
    headers: { "x-api-key": KEY },
  });
  if (!res.ok) throw new Error(`status failed: ${res.status} ${await res.text()}`);
  return res.json();
}

[Legacy] Deposit USDC via other EVM-compatible chains

The following chains are supported via Circle's CCTP: Arbitrum, Base, Avalanche C-Chain. Minimum deposit is 5 USDC. You can either generate an intent address via the front-end, or via API:

curl -X POST https://mainnet.zklighter.elliot.ai/api/v1/createIntentAddress \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "chain_id=42161&from_addr=0xyourL1address&amount=0&is_external_deposit=true"

Withdrawals: Secure and Fast

You can process both secure, fast withdrawals, and transfers via both SDKs, you can find linked examples with the Python SDK. If you're processing a Fast Withdrawal (USDC only, 4 USDC minimum), or a Transfer to another L1, you'll need to sign with the address's Ethereum private key. If you prefer, you can process secure withdrawals from the contract directly, using the withdraw (0xd20191bd) method. Both Transfers and Secure Withdrawals have a 1 USDC, or equivalent, minimum.



Did this page help you?