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: mainnet and venue-chain USDC, and the two deployments’ asset index 3, refer to different on-chain assets.
First-deposit pipeline
AfirstDepositPipeline supplies:
The
DEPOSIT action is user-authorized and returns EVM transaction steps. For mainnet Lighter, the bridge contract is on Ethereum and the flow approves USDC before calling deposit. For lighter-rh, the deployment descriptor supplies Robinhood Chain and USDG instead; do not reuse mainnet constants.
Existing accounts
An existing account returnslifiSwap. 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, callcheckSetup() and execute the returned REGISTER_API_KEY and any conditional setup steps. See Setup.