npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cryptoalgebra/integral-omega-router-sdk

v1.0.0

Published

SDK for integrating with the Omega Router contracts

Downloads

107

Readme

✨ Features


📦 Installation

Using npm:

npm install @cryptoalgebra/omega-router-sdk

or yarn:

yarn add @cryptoalgebra/omega-router-sdk

Peer Dependencies

The SDK requires the following peer dependencies:

yarn add @cryptoalgebra/integral-sdk @uniswap/v2-sdk @uniswap/v3-sdk @uniswap/sdk-core viem

🚀 Getting Started

Getting Quotes

Use OmegaQuoter to calculate expected outputs:

import { OmegaQuoter } from '@cryptoalgebra/omega-router-sdk'
import { createPublicClient, http } from 'viem'

const client = createPublicClient({
  chain: base,
  transport: http(),
})

const quoter = new OmegaQuoter(client, OMEGA_QUOTER_ADDRESS)

// Single quote
const result = await quoter.quote(route, amount, true) // true = exactInput

// Batch quotes for multiple routes
const results = await quoter.batchQuote(routes, amount, true)

Creating an OmegaTrade

OmegaTrade is the main class for representing trades across multiple protocols:

import { OmegaTrade } from '@cryptoalgebra/omega-router-sdk'
import {
  TradeType,
  CurrencyAmount,
  Route as IntegralRoute,
  BoostedRoute as IntegralBoostedRoute,
} from '@cryptoalgebra/integral-sdk'
import { Route as V2Route } from '@uniswap/v2-sdk'
import { Route as V3Route } from '@uniswap/v3-sdk'

// Create a trade with routes from different protocols
const trade = new OmegaTrade({
  v2Routes: [
    {
      route: v2Route,
      inputAmount: CurrencyAmount.fromRawAmount(tokenIn, '1000000'),
      outputAmount: CurrencyAmount.fromRawAmount(tokenOut, '990000'),
    },
  ],
  v3Routes: [
    {
      route: v3Route,
      inputAmount: CurrencyAmount.fromRawAmount(tokenIn, '1000000'),
      outputAmount: CurrencyAmount.fromRawAmount(tokenOut, '995000'),
    },
  ],
  integralRoutes: [
    {
      route: integralRoute,
      inputAmount: CurrencyAmount.fromRawAmount(tokenIn, '1000000'),
      outputAmount: CurrencyAmount.fromRawAmount(tokenOut, '999000'),
    },
  ],
  integralBoostedRoutes: [
    {
      route: integralBoostedRoute,
      inputAmount: CurrencyAmount.fromRawAmount(tokenIn, '1000000'),
      outputAmount: CurrencyAmount.fromRawAmount(tokenOut, '991000'),
    },
  ],
  tradeType: TradeType.EXACT_INPUT,
})

Executing a Swap

Use OmegaRouter to generate calldata for swap execution:

import { OmegaRouter } from '@cryptoalgebra/omega-router-sdk'
import { Percent } from '@cryptoalgebra/integral-sdk'

const router = new OmegaRouter(OMEGA_ROUTER_ADDRESS)

const { calldata, value } = router.swapCallParameters(trade, {
  slippageTolerance: new Percent(50, 10_000), // 0.5%
  recipient: userAddress,
  deadline: Math.floor(Date.now() / 1000) + 1800, // 30 minutes
})

Adding Liquidity to Boosted Pools

The SDK supports liquidity operations with automatic ERC4626 wrapping:

import { OmegaRouter } from '@cryptoalgebra/omega-router-sdk'
import { Position, Percent } from '@cryptoalgebra/integral-sdk'

const router = new OmegaRouter(OMEGA_ROUTER_ADDRESS)

// Create position
const position = new Position({
  pool: boostedPool,
  tickLower: -887220,
  tickUpper: 887220,
  liquidity: '1000000000000000000',
})

// Generate calldata with automatic wrapping of underlying tokens
const { calldata, value } = router.addCallParameters(position, {
  recipient: userAddress,
  slippageTolerance: new Percent(50, 10_000),
  deadline: Math.floor(Date.now() / 1000) + 1800,
  token0Permit: permit0,
  token1Permit: permit1,
  // Provide underlying amounts to automatically wrap to boosted tokens
  amount0Underlying: underlyingAmount0,
  amount1Underlying: underlyingAmount1,
})

Removing Liquidity with Unwrap

const { calldata, value } = router.removeCallParameters(position, {
  tokenId: positionNFTId,
  liquidityPercentage: new Percent(100, 100), // 100% removal
  slippageTolerance: new Percent(50, 10_000),
  deadline: Math.floor(Date.now() / 1000) + 1800,
  permit: nftPermitSignature,
  recipient: userAddress,
  token0Unwrap: true, // Unwrap boosted token0 to underlying
  token1Unwrap: true, // Unwrap boosted token1 to underlying
})

🧪 Running Tests

Make sure you are running node v18+

Install dependencies and run integration tests:

yarn install
yarn test

📄 License

This project is licensed under the MIT License. See the LICENSE file for more details.