How It Works
The CCIP bridging flow:- Validates route - Ensures the source and destination chains are CCIP-compatible
- Calculates fees - Determines the required CCIP fee in source chain’s native token
- Locks/burns tokens - Secures tokens on the source chain
- Mints/unlocks tokens - Releases tokens on the destination chain
- Enables composition - Combines seamlessly with other flow types
Parameters
When using/instructions/build-ccip in your composeFlows array:
| Parameter | Type | Required | Description |
|---|---|---|---|
srcChainId | number | Yes | Source blockchain chain ID |
dstChainId | number | Yes | Destination blockchain chain ID |
srcToken | string | Yes | Token address on the source chain |
dstToken | string | Yes | Token address on the destination chain |
amount | string | Yes | Token amount in smallest unit (wei for 18 decimals) |
CCIP Fee Payment: CCIP fees are always paid in the native token (ETH, MATIC, etc.) of the source chain. The fee is automatically calculated and handled based on your execution mode:
- EOA Mode (Fusion): Tokens are funded into the Nexus Smart Account via funding transaction which will be then used to pay for CCIP fees.
- Smart Account Mode: Funds must already exist in your Smart Account, including sufficient native tokens for CCIP fees.
- EOA 7702 Mode: Your EOA acts as a Smart Account. Funds must already be present, including native tokens for fees.
Complete Workflow Examples
- Basic Bridge
- Swap & Bridge
- Bridge with Withdrawal
Bridge USDC from Base to Optimism
The CCIP finality time typically ranges between 15 to 22 minutes.
To ensure successful execution, always set the
To ensure successful execution, always set the
upperBoundTimestamp at least 22 minutes ahead (or more) to accommodate destination‐chain finality delays.Best Practices
Verify Token Addresses
Verify Token Addresses
Always verify source and destination token addresses are correct and correspond to the same token on different chains:
Format Amounts Correctly
Format Amounts Correctly
Ensure amounts are specified in the token’s smallest unit:
Account for CCIP Fees
Account for CCIP Fees
CCIP fees are always paid in the source chain’s native token (ETH, MATIC, BNB, etc.) and are handled differently based on execution mode:EOA Mode (Fusion)Smart Account ModeEOA 7702 Mode
Combine with Other Instructions
Combine with Other Instructions
CCIP bridging can be combined with swaps, DeFi operations, and withdrawals:
Use Runtime Balance for Dynamic Amounts
Use Runtime Balance for Dynamic Amounts
When bridging after a swap, use runtime balance to transfer the exact output:
Common Use Cases
1. Portfolio Rebalancing
Automatically rebalance your portfolio across multiple chains and protocols.Easily move assets to maintain target allocations, optimize exposure, and minimize gas fees.
2. Cross-Chain Yield Farming
Maximize returns by deploying assets to the highest-yield opportunities across chains.Seamlessly bridge tokens and interact with DeFi protocols to compound rewards.
3. Cross-Chain Swaps
Swap tokens across chains in a single transaction.Enjoy fast, secure, and low-cost swaps without manual bridging or complex setups.
4. Custom Use Cases
Build your own workflows with our SDK and APIs.Whether it’s automated arbitrage, liquidity migration, or multi-chain dApps — the possibilities are endless.
Troubleshooting
Unsupported token pair
Unsupported token pair
Ensure both tokens are supported on the CCIP lane:
- Check CCIP supported tokens
- Verify the token addresses are correct for each chain
- Confirm the lane exists between source and destination chains
Insufficient native tokens for fees
Insufficient native tokens for fees
CCIP fees are always paid in native tokens on the source chain. The handling depends on your execution mode:EOA Mode (Fusion)
- The API automatically swaps a portion of your source token to native token for fees
- No manual action needed - just ensure sufficient source token amount
- Example: Bridging 100 USDC, API swaps ~1 USDC → ETH for fees automatically
- Native tokens must already be present in your Smart Account
- Ensure you have ETH on Ethereum, MATIC on Polygon, etc.
- If insufficient, fund your SCA with native tokens before bridging
- Native tokens must already be present in your EOA
- Your EOA acts as a Smart Account, so pre-fund with native tokens
- Check balance before initiating the bridge transaction
Bridge transaction pending
Bridge transaction pending
CCIP bridges typically take 10-20 minutes:
- Cross-chain messages require finality on the source chain
- Track status using CCIP Explorer with source chain transaction hash
Token amount mismatch
Token amount mismatch
Verify you’re using the correct decimal places:
- Most tokens use 18 decimals (LINK, WETH, DAI)
- USDC and USDT use 6 decimals
- Use
parseUnits(amount, decimals)to avoid errors