Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Installation – Uniswap SDK
Skip to content

Installation

Package Manager

npm
npm install @uniswap/sdk-core-next

Requirements

  • Node.js: 18.x or later (for native BigInt support)
  • TypeScript: 5.0 or later (recommended)

Dependencies

The SDK Core has minimal dependencies:

  • ox - Web3 library for address and encoding utilities
  • tiny-invariant - Runtime assertions
  • zod - Schema validation

Usage

Import what you need from the package:

import {
  Token,
  CurrencyAmount,
  Price,
  Percent,
  Fraction,
  Ether,
  WETH9,
  validateAndParseAddress,
} from '@uniswap/sdk-core-next'

TypeScript Configuration

For the best experience, ensure your tsconfig.json has:

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true
  }
}

ESM Only

This package is ESM-only. If you're using CommonJS, you'll need to use dynamic imports:

const sdk = await import('@uniswap/sdk-core-next')

Or configure your bundler to handle ESM modules.