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
  • Adding Chains
    • Integrate Your Chain
  • Additional Resources
    • Contracts
    • 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
Powered by GitBook
On this page
  • Integrator Fee Structure
  • Platform Fee Structure
  1. Old v2 Documentation (Deprecated)
  2. Key Concepts

Collect Fees

Integrator Fee Structure

Squid v2 allows integrators to implement their own fee structure on top of Squid's platform fees. This document details the structure of Integrator fees implemented on through Squid.

To implement fees please contact the Squid team.

Integrator Fee Configuration

As an integrator, you can implement the following fee structures:

  1. Flat fee: A fixed amount per transaction

  2. Percentage fee: A percentage of the transaction amount

  3. Secondary address fees (optional): Fees sent to a second address

  4. Option to waive platform fee (if allowed by Squid)

Implementing Integrator Fees

In order to prevent abuse an abuse of the fee collection system, we implement the collectFees parameter on the backend for integrators:

const params = {
  // ... other route parameters
  collectFees: {
    integratorAddress: "0x123...abc", // Your address to receive fees
    fee: 50, // Fee in basis points (e.g., 50 = 0.5%)
    integratorAddress2: "0x456...def", // Optional secondary address
    fee2: 25, // Optional fee for secondary address (in basis points)
  }
};

const { route } = await squid.getRoute(params);

Fee Precision

You can set fees with precision up to thousandths of a percent (0.001% - 100% or 0.00001 - 1 in decimal form).

Fee Display

Within the returned route request, all fees (including your integrator fees and Squid's platform fees) are aggregated into a single "Service fee" in the route response. This appears in the feeCosts array and route.actions:

{
  "feeCosts": [
    {
      "amount": "31178739678247",
      "amountUsd": "0.12",
      "description": "Service fee",
      "name": "Service fee",
      "token": {
        "type": "evm",
        "chainId": "42161",
        "address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
        "name": "Ethereum",
        "symbol": "ETH",
        "decimals": 18,
        "logoURI": "https://raw.githubusercontent.com/0xsquid/assets/main/images/tokens/eth.svg",
        "coingeckoId": "ethereum",
        "usdPrice": 3798.076408348585
      }
    }
  ],
  "actions": [
    {
      // ... other action properties
      "provider": "Service fee",
      "description": "Service fee",
      "priceImpact": 0,
      "exchangeRate": "0.99"
    }
  ]
}

Platform Fee Structure

Squid splits all fees collected by integrators 50/50.

In the future, Squid may charge additional platform fees on top of integrator fees. These may include:

  • Platform Base Fee

  • Chain-specific Fees

  • Token-specific Fees

  • Volatility Tier Fees

The total fee for a transaction is calculated as:

Total Fee = Platform Fees + Integrator Fees

Note: In some cases, Squid may allow integrators to waive certain platform fees. Please contact us for more information on fee customization options.

Last updated 7 months ago