← Protocols
Squid Router
Cross-chain / Bridge·EVM · Cosmos · Multi-chain

Squid Router

01Description

Axelar-powered cross-chain swap and General Message Passing router. Aggregates DEXs on the source and destination chain around an Axelar GMP / Squid Coral leg, so any-token-to-any-token cross-chain swaps complete in a single user signature, including post-bridge contract calls.

02Best for
  • 01any-to-any cross-chain swaps over Axelar
  • 02post-bridge contract calls (deposit-and-call)
  • 03Cosmos <-> EVM swaps
  • 04embedded bridge/swap widgets
  • 05fiat-onramp -> destination-chain DeFi flows
03Install
  • pnpm add @0xsquid/sdk viem
04Environment variables
VariableScopeDescription
SQUID_INTEGRATOR_IDServerSquid integrator ID issued via the partner portal. Required for production rate limits and integrator-fee attribution. Sent as `x-integrator-id` header.
05Prompt snippet
Use `@0xsquid/sdk`: instantiate `const squid = new Squid({ baseUrl: 'https://apiplus.squidrouter.com', integratorId })` and call `await squid.init()` to load token/chain registries. Quote with `squid.getRoute({ fromChain, fromToken, fromAmount, toChain, toToken, fromAddress, toAddress, slippageConfig: { slippage: 1.5, autoMode: 1 }, enableBoost })` — Boost (Coral) skips Axelar consensus latency for supported assets/sizes. Execute via `squid.executeRoute({ signer, route })` which handles ERC20 approval, the source swap, the Axelar/Coral leg, and the destination swap atomically. Track with `squid.getStatus({ transactionId, requestId, fromChainId, toChainId })` until `squidTransactionStatus === 'success'`. For post-bridge contract calls pass `postHook` in the route request to encode an arbitrary destination call (e.g., deposit into Aave on the destination chain).
06Gotchas
  • Routes have a TTL (~30s) and re-quoting is required before signing; the `route.estimate.toAmount` shifts with source/destination DEX prices, not just bridge fees.
  • Boost (Coral) is fast (seconds) but only available for select asset/size combinations — fall back to standard Axelar GMP path (~2-5 min finality) when `boostSupported === false`.
  • Source-chain gas is paid by the user; destination-chain gas for the Axelar leg is paid via `route.estimate.gasCosts` — under-funding leaves the message stuck pending manual `axelar-gmp-recovery`.
  • `postHook` calldata runs on the destination chain ONLY if the swap+bridge succeeds; a failed destination DEX swap reverts to refunding in the bridged token, NOT the original input — surface this UX clearly.
  • Cosmos legs (e.g., Osmosis, Noble) use chain string names not numeric chain IDs; mixing the two is the most common Squid integration bug.
  • Without an `integratorId`, requests are heavily rate-limited and integrator fees are not attributed to your app.
  • Integrator fees set via `slippageConfig` and `feeCosts` are layered on top of Axelar's protocol fee; surface the full breakdown to users.
07Alternatives