Skip to content

Quick Start Guide

This guide will help you get started with the Symphony SDK quickly.

Installation

First, install the Symphony SDK package:

npm install symphony-sdk

Basic Usage

  1. Import Symphony:
Viem
import {Symphony} from 'symphony-sdk/viem'
  1. Initialize Symphony:
const symphony = new Symphony()
  1. Get a swap route:
const tokenIn = '0x...'  // Address of input token
const tokenOut = '0x...' // Address of output token
const amount = '1'     // Amount to swap
 
const route = await symphony.getRoute(tokenIn, tokenOut, amount)
  1. Execute the swap:
const { swapReceipt } = await route.swap()
console.log(`Swap executed: ${swapReceipt.transactionHash}`)

Next Steps