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

@topazdex/router-sdk

v0.1.1

Published

Mixed route and multi route trade types spanning Topaz v2 and Topaz CL pools

Readme

@topazdex/router-sdk

Routes and trades that span both Topaz stacks.

Mixed routes

A mixed route crosses Topaz CL and Topaz v2 pools in a single path, e.g. WBNB —CL(50)→ USDT —v2 stable→ USDC. Topaz's deployed MixedRouteQuoterV1 prices these, and it reuses the CL path layout — token ‖ uint24 ‖ token ‖ … — putting a flag in the 3 byte pool slot for v2 hops:

| slot value | hop | | --- | --- | | 0x400000 (1 << 22) | Topaz v2 volatile pool | | 0x200000 (1 << 21) | Topaz v2 stable pool | | anything else | Topaz CL pool with that tick spacing |

encodeMixedRouteToPath emits exactly that. The mixed quoter is exact input only; there is no mixed exact-output quoter, and stable pools cannot serve exact output at all.

partitionMixedRouteByProtocol splits a mixed route into the longest runs of one stack, which is what the Universal Router executes: one command per run, with the router holding the intermediate token.

Trades

Trade aggregates one or more Swaps — each a route plus its input and output amount — so a trade can be split across several routes and both stacks at once. It aggregates and applies slippage; it does not price. Amounts come from whoever quoted the routes, which for the smart order router means Topaz's on-chain quoters rather than a local simulation.

const trade = new Trade({
  swaps: [
    { route: clRoute, inputAmount: seventyFivePercent, outputAmount: clQuote },
    { route: v2Route, inputAmount: twentyFivePercent, outputAmount: v2Quote }
  ],
  tradeType: TradeType.EXACT_INPUT
})

trade.spansBothStacks          // true
trade.minimumAmountOut(slippage)

Tests

src/mainnet.test.ts prices mixed routes through the live MixedRouteQuoterV1 and requires the result to equal the same route priced leg by leg — the CL leg by the CL quoter, the v2 leg by @topazdex/v2-sdk's Solidly math.