Cross-chain / Bridge·EVM · Solana · Aptos · Multi-chain
Stargate
Composable native-asset bridge built on LayerZero. V2 uses single-asset cross-chain shared pools (managed by the Δ algorithm) plus the Hydra OFT mechanism for instant guaranteed finality on supported routes.
- 01native asset bridging (USDC, USDT, ETH)
- 02instant guaranteed finality transfers
- 03OFT-style token expansion (Hydra)
- 04deep-liquidity stablecoin routes
- 05contract-to-contract composable bridge calls
- pnpm add @stargatefinance/stg-evm-v2 @layerzerolabs/lz-evm-protocol-v2 viem
| Variable | Scope | Description |
|---|---|---|
| STARGATE_API_URL | Client | Stargate quote API base URL (default `https://stargate.finance/api/v1`). Used by `/quotes` to fetch routes, fees, and calldata. |
For programmatic bridging, call `GET https://stargate.finance/api/v1/quotes?srcToken=&dstToken=&srcChainKey=&dstChainKey=&srcAddress=&dstAddress=&srcAmount=&dstAmountMin=` to get available routes (`taxi` for instant, `bus` for batched/cheaper). Each quote returns `steps[]` with pre-built `transaction.data` and `transaction.to` — submit approvals first, then send the bridge tx with `value` equal to the quoted LayerZero native fee. Track delivery via LayerZero Scan (`https://layerzeroscan.com/tx/<srcHash>`). For on-chain integrations import `IStargate` from `@stargatefinance/stg-evm-v2`, build `SendParam` (dstEid, to, amountLD, minAmountLD, extraOptions, composeMsg, oftCmd), quote with `quoteSend`, then call `sendToken{value: fee.nativeFee}(sendParam, fee, refundAddress)`.
- ⚑V2 uses LayerZero Endpoint IDs (EIDs), NOT EVM chain IDs — the API expects `srcChainKey`/`dstChainKey` strings (e.g. `ethereum`, `arbitrum`). Mixing IDs is a top integration bug.
- ⚑There are two route modes: `taxi` (instant, higher fee) and `bus` (batched, cheaper but minute-scale ETA). Surface both to users and persist `mode` to track properly.
- ⚑`minAmountLD` must be set with realistic slippage; a too-tight bound causes refunds and a wasted LayerZero fee on the source chain.
- ⚑Always forward `msg.value = fee.nativeFee` exactly — Stargate / LayerZero reverts on under-funding and silently keeps overage on some paths.
- ⚑Pool liquidity is per-asset-per-chain. Large transfers can exhaust a pool and revert — always re-quote immediately before signing.
- ⚑Hydra OFT routes have different ABIs than legacy pool routes; do not assume one path generalizes — branch on the quote's `route.type`.
- ⚑Solana and Aptos spokes are separate codebases with their own SDKs; the EVM ABI does not translate.