Skip to main content
Use PerpsClient.getDepositFlow() instead of hard-coding a chain or collateral token. The Lighter provider owns account-existence checks and returns the correct deployment-specific flow.

Flow by deployment

The returned assets carry exact { chainId, address, decimals } identity. A symbol alone is not sufficient: Ethereum USDC and Lighter-chain USDC, and the two deployments’ asset index 3, refer to different on-chain assets.

First-deposit pipeline

A firstDepositPipeline supplies: The DEPOSIT action is user-authorized and returns two EVM transaction steps: an ERC-20 approve(bridge, amount), then bridge.deposit(to, assetIndex = 3, routeType = perp, amount). For mainnet Lighter, the bridge contract is on Ethereum. For lighter-rh, the deployment descriptor supplies Robinhood Chain and USDG instead; do not reuse mainnet constants. Direct DEPOSIT is only for the first-deposit pipeline on the bridge chain. To fund from any other chain, route through lifiSwap.

Existing accounts

An existing account returns lifiSwap. Route into flow.destination; LI.FI routing decides whether that is a same-chain swap or a bridge. The optional toAddress is the credited address when a provider requires a provisioned destination.

Setup after account opening

Lighter cannot register its trading key before the venue account exists. After the first deposit is indexed, call checkSetup() and execute the returned REGISTER_API_KEY and any conditional setup steps. See Setup.