Skip to main content

1inch Fusion SDK

Execute token swaps with Dutch auction mechanics for optimal pricing. Build decentralized exchange integrations with the power of 1inch Fusion Mode.

Get started in minutes

Follow these steps to execute your first Fusion swap

1

Install the SDK

Add the 1inch Fusion SDK to your project using your preferred package manager.
npm install @1inch/fusion-sdk
2

Initialize the SDK

Create a new FusionSDK instance with your configuration.
import { FusionSDK, NetworkEnum, PrivateKeyProviderConnector } from '@1inch/fusion-sdk'
import { JsonRpcProvider } from 'ethers'

const provider = new JsonRpcProvider('YOUR_RPC_URL')
const connector = new PrivateKeyProviderConnector(
  'YOUR_PRIVATE_KEY',
  provider
)

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

Create and submit an order

Get a quote, create an order, and submit it to the network.
const params = {
  fromTokenAddress: '0x6b175474e89094c44da98b954eedeac495271d0f', // DAI
  toTokenAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',  // WETH
  amount: '1000000000000000000', // 1 DAI
  walletAddress: '0xYourAddress'
}

const quote = await sdk.getQuote(params)
const order = await sdk.createOrder(params)
const result = await sdk.submitOrder(order.order, order.quoteId)

console.log('Order hash:', result.orderHash)
{
  "orderHash": "0x1234567890abcdef...",
  "quoteId": "abc-123-def-456",
  "signature": "0x9876543210fedcba..."
}

Key features

Everything you need to build powerful DEX integrations

Dutch auction pricing

Optimize swap execution with dynamic price curves that improve over time

Multi-network support

Deploy on Ethereum, BSC, Polygon, Arbitrum, and more

Native token swaps

Seamlessly swap native tokens with automatic wrapping

Custom presets

Fine-tune auction parameters for your specific use case

Real-time tracking

Monitor order status with WebSocket API

Integrator fees

Earn revenue on every swap with built-in fee support

Ready to start building?

Follow our quickstart guide to execute your first Fusion swap in minutes.

View quickstart guide

Build docs developers (and LLMs) love