Skip to main content

Overview

The 1inch Fusion SDK supports token swaps across 13 EVM-compatible blockchain networks. Each network has its own set of resolvers, liquidity sources, and characteristics that may affect your swap execution.

Supported networks

The SDK uses the NetworkEnum to specify which network to operate on:

Ethereum

Chain ID: 1Network: NetworkEnum.ETHEREUMThe largest and most liquid network with the best resolver competition

Polygon

Chain ID: 137Network: NetworkEnum.POLYGONLow gas fees with good liquidity for major token pairs

BNB Chain

Chain ID: 56Network: NetworkEnum.BINANCEPopular for DeFi with competitive liquidity and low fees

Arbitrum

Chain ID: 42161Network: NetworkEnum.ARBITRUMEthereum L2 with significantly lower gas costs

Optimism

Chain ID: 10Network: NetworkEnum.OPTIMISMEthereum L2 optimized for fast, cheap transactions

Base

Chain ID: 8453Network: NetworkEnum.COINBASECoinbase’s L2 network built on Optimism stack

Avalanche

Chain ID: 43114Network: NetworkEnum.AVALANCHEHigh-throughput chain with sub-second finality

zkSync Era

Chain ID: 324Network: NetworkEnum.ZKSYNCZK-rollup L2 with enhanced security and privacy

Gnosis

Chain ID: 100Network: NetworkEnum.GNOSISEthereum sidechain focused on stable payments

Fantom

Chain ID: 250Network: NetworkEnum.FANTOMFast, low-cost network popular for DeFi

Linea

Chain ID: 59144Network: NetworkEnum.LINEAConsenSys zkEVM L2 network

Sonic

Chain ID: 146Network: NetworkEnum.SONICHigh-performance blockchain network

Unichain

Chain ID: 130Network: NetworkEnum.UNICHAINUniswap’s dedicated L2 network

Network configuration

Configure the SDK for your desired network:
import { FusionSDK, NetworkEnum } from '@1inch/fusion-sdk'

// Ethereum mainnet
const ethSdk = new FusionSDK({
  url: 'https://api.1inch.dev/fusion',
  network: NetworkEnum.ETHEREUM,
  authKey: 'your-api-key'
})

// Polygon
const polySdk = new FusionSDK({
  url: 'https://api.1inch.dev/fusion',
  network: NetworkEnum.POLYGON,
  authKey: 'your-api-key'
})

// Arbitrum
const arbSdk = new FusionSDK({
  url: 'https://api.1inch.dev/fusion',
  network: NetworkEnum.ARBITRUM,
  authKey: 'your-api-key'
})

Network-specific considerations

Native token addresses

Each network has a different native token (ETH, BNB, MATIC, etc.). The SDK uses a special address to represent native tokens:
const NATIVE_TOKEN_ADDRESS = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
When swapping native tokens, use this address and the special native token flow:
import { FusionSDK, NetworkEnum } from '@1inch/fusion-sdk'

const params = {
  fromTokenAddress: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', // ETH
  toTokenAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',  // USDC
  amount: '1000000000000000000', // 1 ETH
  walletAddress: '0xYourAddress'
}

const sdk = new FusionSDK({
  url: 'https://api.1inch.dev/fusion',
  network: NetworkEnum.ETHEREUM,
  blockchainProvider: connector,
  authKey: 'your-api-key'
})

const order = await sdk.createOrder(params)
await sdk.submitNativeOrder(order.order, new Address(params.walletAddress), order.quoteId)
See the Native token swaps guide for complete details.

Gas costs

Gas costs vary significantly between networks and affect auction pricing:
NetworkAvg Gas CostSpeedNotes
EthereumHigh (20-100+ gwei)12s blocksHighest liquidity, highest costs
PolygonVery Low2s blocksVery cheap, good liquidity
BNB ChainLow (3-5 gwei)3s blocksBalanced cost/liquidity
ArbitrumLowSub-secondL2 benefits, growing liquidity
OptimismLowSub-secondL2 benefits, good liquidity
BaseLowSub-secondNewer, growing ecosystem
AvalancheLow (25 nAVAX)Sub-secondFast, low cost
zkSyncLowSub-secondZK-rollup benefits
Gas costs are automatically factored into auction pricing. Higher gas networks may have slightly worse effective rates to compensate resolvers.

Liquidity and execution

Network liquidity affects execution quality:
Networks: Ethereum, BNB Chain, Polygon
  • More resolvers active
  • Better execution rates
  • Faster fills
  • Recommended for large swaps

RPC provider setup

Each network requires its own RPC provider:
import { JsonRpcProvider } from 'ethers'
import { PrivateKeyProviderConnector, Web3Like } from '@1inch/fusion-sdk'

// Network-specific RPC URLs
const RPC_URLS = {
  [NetworkEnum.ETHEREUM]: 'https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY',
  [NetworkEnum.POLYGON]: 'https://polygon-mainnet.g.alchemy.com/v2/YOUR_KEY',
  [NetworkEnum.BINANCE]: 'https://bsc-dataseed.binance.org',
  [NetworkEnum.ARBITRUM]: 'https://arb-mainnet.g.alchemy.com/v2/YOUR_KEY',
  [NetworkEnum.OPTIMISM]: 'https://opt-mainnet.g.alchemy.com/v2/YOUR_KEY'
  // ... other networks
}

// Create provider for specific network
function createProvider(network: NetworkEnum) {
  const rpcUrl = RPC_URLS[network]
  const ethersProvider = new JsonRpcProvider(rpcUrl)
  
  const web3Like: Web3Like = {
    eth: {
      call(transactionConfig): Promise<string> {
        return ethersProvider.call(transactionConfig)
      }
    },
    extend(): void {}
  }
  
  return new PrivateKeyProviderConnector(
    'YOUR_PRIVATE_KEY',
    web3Like
  )
}

// Use it
const connector = createProvider(NetworkEnum.ETHEREUM)

Multi-network support

For applications supporting multiple networks:
import { FusionSDK, NetworkEnum } from '@1inch/fusion-sdk'

class MultiNetworkFusion {
  private sdks: Map<NetworkEnum, FusionSDK> = new Map()

  constructor(private authKey: string) {
    // Initialize SDKs for supported networks
    const networks = [
      NetworkEnum.ETHEREUM,
      NetworkEnum.POLYGON,
      NetworkEnum.BINANCE,
      NetworkEnum.ARBITRUM
    ]

    for (const network of networks) {
      const connector = createProvider(network) // From above
      
      this.sdks.set(network, new FusionSDK({
        url: 'https://api.1inch.dev/fusion',
        network,
        blockchainProvider: connector,
        authKey: this.authKey
      }))
    }
  }

  async getQuote(network: NetworkEnum, params: QuoteParams) {
    const sdk = this.sdks.get(network)
    if (!sdk) throw new Error(`Network ${network} not supported`)
    
    return sdk.getQuote(params)
  }

  async placeOrder(network: NetworkEnum, params: OrderParams) {
    const sdk = this.sdks.get(network)
    if (!sdk) throw new Error(`Network ${network} not supported`)
    
    return sdk.placeOrder(params)
  }
}

// Usage
const fusion = new MultiNetworkFusion('your-api-key')

// Swap on Ethereum
await fusion.placeOrder(NetworkEnum.ETHEREUM, {
  fromTokenAddress: '0x...',
  toTokenAddress: '0x...',
  amount: '1000000000000000000',
  walletAddress: '0xYourAddress'
})

// Swap on Polygon
await fusion.placeOrder(NetworkEnum.POLYGON, {
  fromTokenAddress: '0x...',
  toTokenAddress: '0x...',
  amount: '1000000000000000000',
  walletAddress: '0xYourAddress'
})

Network selection best practices

1

Consider liquidity

Choose networks with good liquidity for your token pair. Check active orders on your target network before placing large swaps.
2

Factor in gas costs

For small swaps, L2s and sidechains may provide better net value after gas costs.
3

Check resolver activity

More active resolvers mean better execution. Ethereum typically has the most resolver competition.
4

Test first

Always test with small amounts on a new network before placing large orders.

Network contract addresses

The 1inch Limit Order V4 contract is deployed at the same address across all networks:
const LIMIT_ORDER_V4_ADDRESS = '0x111111125421ca6dc452d289314280a0f8842a65'
This is the contract you need to approve for token allowances.

Next steps

Quickstart

Get started with your first swap

Native token swaps

Learn about network-specific native tokens

Configuration

Complete configuration reference

Placing orders

Step-by-step order creation guide

Build docs developers (and LLMs) love