Squid Dev Documentation
  • Getting Started
    • Overview
    • Get an Integrator ID
    • Integrator Quickstart
  • Widget Integration
    • Add A Widget
      • Swap widget
        • Getting Started
        • Installing the Widget
        • React Installation
        • NextJS Installation
        • Vite Installation
        • Iframe Installation
        • Customization Guide
          • Default User Settings
          • Configuring Content
          • Default Chains and Tokens
          • Configuration Types
          • Collect Fees
        • Information for Integrators
        • Set default chains and tokens via URL
        • Errors
    • Upgrade Your Widget
  • API & SDK Integration
    • API
      • Swap & Bridge Example
      • Staking Example
      • Cross-chain NFT Purchase Example
      • Get Route Status
    • SDK
      • Cross-chain Swap Example
      • Staking Example
      • Cross-chain NFT Purchase Example
      • Get Route Status
    • Key Concepts
      • Route Request Parameters
      • Get a route
      • Execute the route
      • 🪝Hooks
        • How do hooks work
        • Build a preHook
        • Build a postHook
        • Using the full ERC20 or Native balance in a call
        • ❗Transfer the remainder to the user
        • Get a route and execute as normal
      • Express
      • Track status
      • Types
      • Collect Fees
      • Get supported tokens and chains
    • Coral: Intent Swaps
      • Integrating Coral
    • NEW: Bitcoin and Solana
  • Adding Tokens
    • Whitelist a Token
    • Interchain Token(ITS) Listings
      • How To List
    • Circle's EURC Integration Guide
  • Migration
    • Squid v2 vs Squid v1
    • v1 -> v2 Migration
  • Additional Resources
    • Contracts
    • Squid v1 Docs
      • SDK
        • Installing our SDK
        • Get supported tokens and chains
          • Example chains response
          • Example tokens response
        • Set your transfer parameters
        • Get a route
          • Understanding the route response
        • Execute your swap or call
        • Get Route Status
        • Contract calls
          • Code example
          • Creating a ContractCall object
          • Contract call types
          • Approving ERC20s in our multicall
          • Transferring the remainder to a user
        • Collect Fees
          • Fee collector contract addresses
        • Working example!
      • API
        • integratorId
        • API playground
        • Base URLs
        • Get supported tokens and chains
        • Get a route
        • Checking the status of a transaction
        • Error codes
          • V2 API
      • Cosmos
        • Installing our SDK
        • Get supported tokens and chains
          • Example chains response
          • Example tokens response
        • Set your transfer parameters
        • Get a route
          • Cosmos route response
        • Execute your swap or call on Cosmos
        • Get Route Status
        • Cosmos custom calls
        • Working cosmos example!
        • Fallback Addresses
    • Additional Dev Resources
      • Choose How To Integrate Squid
      • Squid x Tenderly
      • Testnet or Mainnet?
      • Understanding Gas Payments
      • Supported Chains and Tokens
      • Request a new supported token
      • Liquidity Sources
        • axlASSET Liquidity
      • Integrator type specific docs
        • DEXs
        • Aggregators
        • NFTs
      • Setting up an EVM signer
      • Setting up Cosmos signer
      • Contract addresses
      • SDK easter eggs
        • Setting toAmount
        • getAllBalances
        • Advanced set up
        • Manually approve a route
        • Manually approve an ERC20
      • Whitelist a token
      • Security & Audits
        • Security
        • Audits
        • Axelar
      • Get an integrator-id
    • Architecture
      • FAQ
      • Liquidity model
      • Architecture
      • General message passing (GMP)
      • Transaction times and fees
      • Fallback behaviour on failed transactions
      • Axelar
    • Brand Assets
      • "Powered by Squid" Policy
    • Audits & Security
    • Contact
  • Changelog
    • SDK
      • v1.3
      • v1.2
    • API
      • v1.9
      • v1.8
      • v1.7
      • v1.6
  • Old v2 Documentation (Deprecated)
    • Whitelist a Token
    • Interchain Token(ITS) Listings
      • How To List
    • Add A Widget
      • Swap widget
        • Getting Started
        • Installing the Widget
        • React Installation
        • NextJS Installation
        • Iframe Installation
        • Customization Guide
          • Default User Settings
          • Theme Customization
          • Configuring Content
          • Default Chains and Tokens
          • Configuration Types
          • Collect fees
        • Information for Integrators
        • Set default chains and tokens via URL
        • Errors
      • Stake widget
        • Installing the Widget
        • Configuration
        • Importing The widget
    • Quick Start
    • API
      • Swap & Bridge Example
      • Staking Example
      • Cross-chain NFT Purchase Example
    • SDK
      • Cross-chain Swap Example
      • Staking Example
      • Cross-chain NFT Purchase Example
    • Key Concepts
      • Route Request Parameters
      • Get a route
      • Execute the route
      • 🪝Hooks
        • How do hooks work
        • Build a preHook
        • Build a postHook
        • Using the full ERC20 or Native balance in a call
        • ❗Transfer the remainder to the user
        • Add your hooks to a route request, or widget
        • Get a route and execute as normal
      • Boost
      • Track status
      • Types
      • Collect Fees
      • Get supported tokens and chains
Powered by GitBook
On this page
  • Source chain gas fees
  • Cross-chain gas fees
  1. Additional Resources
  2. Additional Dev Resources

Understanding Gas Payments

Cross-chain transactions are all about gas.

The lack of atomicity, as well as varying prices of gas on different chains makes reliable execution very difficult to obtain. It's something we pride ourselves on, as for over a year we've been working closely with Axelar's relay team to hone gas payments to get reliable and cheap execution for our users.

Here are the basics:

Squid separates gas fee payments into source chain and cross-chain gas fees.

Source chain gas fees

Source chain gas fees are paid by the user as normal for any crypto transaction.

  1. The Squid API/SDK/Widget recommends the gasLimit for the transaction.

    • i.e. the maximum amount of gas that the source transaction will consume.

  2. The user's wallet recommends a good price per unit of gas that will get the transaction executed on chain.

    • This amount is variable and so the exact cost of the source chain transaction is unknown until the user completes the tx.

Cross-chain gas fees

Squid bundles all cross-chain gas fees into a single payment, whether the transaction includes multiple hops or just one hop. The complexity is abstracted away from any developer using the Squid API/SDK/Widget.

From EVM

  • For transactions from EVM chains, Axelar takes a gas payment using value in native tokens on the source chain. If we are sending USDC from Arbitrum, we pay native ETH to the Axelar gas service contract as part of source chain transaction. Hence, the user needs enough native gas on the source chain to pay for the entire transaction, and this is independent from the amount the user is swapping/bridging.

  • You can find the value amount to be paid in the API or SDK route response at route.estimate.transactionRequest.value

  • Axelar's model for cross-chain gas fee payment is currently a pay for what you use model. The user over pays on the source chain, then gets refunded the value that isn't used during the transaction.

From Cosmos via Axelar

  • Gas fees are paid as part of the token to be bridged. For example if swapping from ATOM to ETH, Squid will swap first to axlUSDC, bridge to Ethereum, then swap for ETH. The bridged token is axlUSDC, so the cross-chain gas payment to Axelar will be paid in axlUSDC.

From Cosmos via IBC

  • IBC currently is subsidised by relayers and has no implemented fee model, so cross-chain gas payments are free. This will change in the future and Squid's API/SDK will adapt to the new models.

PreviousTestnet or Mainnet?NextSupported Chains and Tokens

Last updated 1 year ago