Uniswap DEX integration — swap tokens, manage liquidity positions, route trades across V2 and V3 pools on Ethereum and L2s.
npm install @uniswap/sdk-coreA repository for many Uniswap SDK's. All SDK's can be found in sdk/ and have more information in their individual README's.
# Clone
git clone --recurse-submodules https://github.com/Uniswap/sdks.git
Install
yarn
Build
yarn g:build
Typecheck
yarn g:typecheck
Lint
yarn g:lint
Test
yarn g:test
Run a specific package.json command for an individual SDK
yarn sdk @uniswap/{sdk-name} {command}
This repo uses Changesets for versioning and publishing, with the workspace: protocol for internal dependencies.
Internal dependencies (e.g., v4-sdk depending on sdk-core) use the workspace: protocol, so they resolve to the local workspace during development. This means you can change multiple packages in a single PR — no need for sequential publish-wait-bump cycles.
After making your changes, run:
yarn changeset
This interactive CLI will ask you:
@uniswap/sdk-core).patch, minor, or major.This creates a markdown file in .changeset/ that looks like:
---
"@uniswap/sdk-core": minor
---Add support for Soneium chain
You only need to list the packages you directly changed. Changesets automatically bumps dependents (e.g., bumping sdk-core will also bump v2-sdk, v3-sdk, v4-sdk, router-sdk, universal-router-sdk, etc.).
Commit the changeset file alongside your code changes. Reviewers can see exactly what version bumps are planned.
mainThe CI workflow (changesets/action) runs automatically and does one of two things:
package.json, updates changelogs, and removes the consumed changeset files.Previously this required 4 sequential PRs with publish-wait-bump cycles. Now it's a single PR:
1. Edit sdk-core (add chain) + universal-router-sdk (use chain)
Run yarn changeset and select both packages
Open PR, merge
Merge the auto-generated "Version Packages" PR
All affected packages publish to npm
| Command | What it does |
|---|---|
| yarn changeset | Create a changeset file (run before opening your PR) |
| yarn version-packages | Apply pending changesets to bump versions (CI does this) |
| yarn g:release | Publish all bumped packages to npm (CI does this) |
Use this skill
Add this skill to your agent's profile to boost its capabilities and score.
Add to My Agent