Skip to main content
Crosschain routing coordinates DeFi operations across multiple blockchains. The source transaction and destination callback are separate stages: each transaction can be atomic on its own chain, but destination failure cannot revert a finalized source-chain bridge. Both route and bundle API operate in crosschain mode. For custom bundles, use the bridge action to facilitate cross-chain token transfers using one of four supported bridge protocols: CCIP, CCTP (USDC-only), Relay or Stargate. For example: bridge assets to chains where protocols exist, execute operations such as minting, then optionally bridge results back to your origin chain and deposit them in a yield-bearing position.

Quick Start

Use the GET /layerzero/pool API to find the correct pool address for Stargate, or GET /api/v1/ccip/router?chainId={chainId} for CCIP.Always start the post-bridging callback with a balance action.

Core Concepts

Bridge Protocols

Enso supports four bridge protocols: CCIP (Chainlink), CCTP (Circle, USDC-only), Relay, and Stargate (LayerZero). Each has different characteristics for callback limits, native token support, and fee handling.

Protocol Discovery

Use protocol-specific APIs to discover bridge addresses: GET /api/v1/ccip/router?chainId={chainId} for CCIP, /cctp/bridge/tokenmessengerv2 for CCTP, /layerzero/pool for Stargate.

Native Drop

Parent bridge calls calculate gas fees required for all child bridge operations and include these costs in the initial transaction fee.

Post-Bridge Execution

Callback actions execute atomically within their destination transaction after asynchronous bridge delivery. Monitor source and destination status separately.

Bridge Protocols

Enso supports four bridge protocols, each with different characteristics:

When to Use Each Bridge

Best for: Native USDC transfers across chains where the recipient shouldn’t need destination gas.
  • USDC only — bridges burn-and-mint, not wrapped
  • Supports only the HyperCore deposit callback shape; use CCIP/Stargate/Relay for other post-bridge actions
  • Auto-relayed by Circle’s Forwarding Service in both fast and standard modes
  • Fees deducted from minted amount: protocol fee (Fast only, ~Iris minimumFee * 1.20) + forwarding fee (low/med/high, always)
  • protocolArgs.transferType defaults to fast where supported, otherwise silently falls back to standard
See the CCTP Bridge use case for full details on fees, fallbacks, and the manual claim flow. Per-chain Fast/Standard support comes from Circle’s supported blockchains matrix.
Best for: Flexible bridging with dynamic amounts and native token support.
  • Uses placeholder-based design for dynamic amount resolution
  • No callback data limit (amounts resolved at execution time)
  • Supports both ERC20 and native token bridging
  • API-based fee calculation
Best for: Native token bridging and LayerZero ecosystem integration.
  • Full native token support
  • Tight callback data limit (~9.5KB) - keep callbacks concise
  • Uses LayerZero messaging for cross-chain communication

When to use Route vs Bundle API?

Use Route API for: Limitations: The route API automatically selects the optimal bridge protocol - bridge protocol cannot be explicitly selected. Cannot handle custom post-bridge logic or multi-step protocol interactions. See Bridge Transaction Status to track delivery after submission. Use Bundle API for: Advantages: Allows explicit bridge protocol selection (CCIP, Relay, Stargate, or CCTP). Limitations: Single callback sequence with up to 10 chained actions. Callback data limits vary by protocol (see Bridge Protocols).

Examples

1. Simple Cross-Chain Swap

Use Route API for basic cross-chain operations with automatic pathfinding.
SDK

2. Crosschain Vault Zap

In this example, we’ll bridge ETH from Ethereum to zap it to a Ether.fi weETH vault on Base. Try this route →

3. Cross-Chain Position Minting

Crosschain routing enables you to mint positions on different chains and bridge them back, while signing only once. In this example, we’ll bridge USDC from Berachain to Ethereum, mint e-rUSD using Reservoir protocol, then bridge rUSD back to Berachain. About Reservoir: Reservoir is a stablecoin protocol that mints rUSD (a USD-pegged stablecoin) by accepting USDC as collateral on Ethereum mainnet.
Use the GET layerzero/pool API or client.getLayerZeroPool() from the SDK to find the correct pool address and use it as the primaryAddress for stargate.bridge operation.
What’s happening: This workflow demonstrates a complete round-trip bridge operation - taking USDC from Berachain, minting a stablecoin on Ethereum where the protocol exists, then bringing the newly minted e-rUSD back to the origin chain. Understanding callback execution After bridge delivery, the encoded callback executes in a destination-chain transaction:
  • Destination atomicity: Callback actions succeed or revert together on the destination chain. A callback failure cannot revert a finalized source transaction. Refund and recovery behavior is bridge-provider specific; monitor Bridge Status.
  • Gas management: The source request includes the destination execution fees calculated for the selected bridge route.
  • Output chaining: Callback references are local to the callback array. Start supported bridge callbacks with enso:balance, then reference that delivered balance with { useOutputOfCallAt: 0 }.
mintOnBeraFromMainnet.ts

4. Crosschain Yield Strategy

Nested callbacks enable multi-hop workflows, allowing operations that span multiple chains where different protocols exist. In this example, we’ll do an Euler deposit of rUSD tokens minted on a Berachain by using Ethereum Mainnet assets. The user starts with USDC on Berachain and ends with yield-generating vault shares with a single signature.
mintOnBeraDepositOnMainnet.ts

5. CCIP Bridge with Callback

Use CCIP for ERC20 token bridging with larger callback payloads. This example bridges SolvBTC from BNB Chain to Base, then swaps it to native ETH.
Use GET /api/v1/ccip/router?chainId={chainId} to get the CCIP Router address for the primaryAddress parameter.
ccipBridgeWithCallback.ts

6. Mixed Bridge Protocols

Combine different bridge protocols in a single workflow. This example uses Stargate for the outbound bridge and CCIP for the return bridge, useful when different protocols support different token pairs.
mixedBridgeProtocols.ts

7. Relay Bridge with Callback

Use Relay for bridging with dynamic amount resolution. This example bridges ETH from Ethereum to Arbitrum and wraps it to WETH.
relayBridge.ts

8. CCTP Bridge

Bridge native USDC across chains with Circle’s CCTP — burn on the source, mint on the destination. Both fast and standard transfers are auto-relayed by Circle’s Forwarding Service, so the receiver never needs destination gas.
Use the GET /api/v1/cctp/bridge/tokenmessengerv2 API to fetch the TokenMessengerV2 address for the source chain.
cctpBridge.ts
See CCTP Bridge for the full fee model, fast vs standard trade-offs, and the manual claim/recovery flow.

Reference

Bridge Action Parameters

All bridge protocols share a common set of parameters: refundReceiver is not a generic bridge-action argument. Route-level dust/refund fields and recovery behavior depend on the selected endpoint and bridge provider.

Protocol-Specific Parameters

primaryAddress: CCIP Router address from GET /api/v1/ccip/router?chainId={chainId}Callback limits:
  • Data limit: ~30KB
  • Gas limit: 200k (default) to 3M (max)
Notes:
  • ERC20 tokens only (no native token bridging)
  • Fee paid in native token

Callback Requirements

Critical: All callback sequences must begin with a balance check action to verify the bridged token amount on the destination chain.
  1. First action must be the balance action:
  1. Reference previous outputs: Use useOutputOfCallAt to chain actions together
Or with specific output index:
  1. Nested callbacks: Bridge actions within callbacks enable multi-hop workflows across multiple chains
  2. Callback data limits: Keep callbacks concise for Stargate (~9.5KB limit). CCIP supports larger payloads (~30KB). Relay has no practical limit. CCTP supports only the HyperCore deposit callback shape.

Protocol Discovery APIs

Updated