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

@aiquant/minswap-sdk

v0.0.0

Published

Query Minswap data and build transactions

Readme

Minswap SDK (CommonJS & ESM)

Official fork of the Minswap SDK with dual build support for CommonJS (CJS) and ECMAScript Modules (ESM).

This package provides both the CommonJS and ESM distributions of the Minswap SDK, ensuring compatibility across Node.js environments that do and do not use ES Modules.


Overview

The Minswap open-source SDK offers off-chain tooling to interact with the Minswap DEX. It supports:

  • Stableswap
  • AMM V1
  • AMM V2
  • LBE V2

Features include pool price feeds, trade simulations, transaction builders, and historical data access.


Features

  • [x] Pool price feed
  • [x] Historical pool data
  • [x] Calculate trade price & impact
  • [x] Build and submit orders via Lucid
  • [x] Syncer for liquidity pool data

Install

Choose the package that matches your project setup:

| Build | Install Command | Usage | | ----- | ---------------------------------- | -------------------------------------------------- | | CJS | npm install @aiquant/minswap-sdk | const { ... } = require("@aiquant/minswap-sdk"); | | ESM | npm install @aiquant/minswap-sdk | import { ... } from "@aiquant/minswap-sdk"; | | PNPM | pnpm add @aiquant/minswap-sdk | Supports both CJS & ESM | | Yarn | yarn add @aiquant/minswap-sdk | Supports both CJS & ESM |


Usage Examples

Example 1: Get Current MIN/ADA Price

import { BlockFrostAPI } from "@blockfrost/blockfrost-js";
import { BlockfrostAdapter } from "@aiquant/minswap-sdk";  // forked package

const api = new BlockfrostAdapter({
  blockFrost: new BlockFrostAPI({
    projectId: "<your_project_id>",
    network: "mainnet",
  }),
});

const [adaPerMin, minPerAda] = await api.getPoolPrice({ pool: await api.getV1PoolById({ id: "<poolId>" }) });
console.log(`ADA/MIN: ${adaPerMin.toString()}, MIN/ADA: ${minPerAda.toString()}`);

Example 2: Historical Price History

import { BlockFrostAPI } from "@blockfrost/blockfrost-js";
import { BlockfrostAdapter, NetworkId } from "@aiquant/minswap-sdk";

const api = new BlockfrostAdapter({ /* ... */ });
const history = await api.getPoolHistory({ id: "<poolId>" });
for (const point of history) {
  const pool = await api.getPoolInTx({ txHash: point.txHash });
  const [priceA, priceB] = await api.getPoolPrice({ pool, decimalsA: 6, decimalsB: 6 });
  console.log(`${point.time}: ADA/MIN=${priceA}, MIN/ADA=${priceB}`);
}

Example 3: Build & Submit Swap Order

import { Lucid, Blockfrost } from "@aiquant/lucid-cardano";
import { BlockfrostAdapter, Dex } from "@aiquant/minswap-sdk";

const lucid = await Lucid.new(new Blockfrost("...", "<id>"), "Mainnet");
const adapter = new BlockfrostAdapter({ /* ... */ });

const { poolState, poolDatum } = await api.getPoolById({ id: "<poolId>" });
const dex = new Dex(lucid);

const tx = await dex.buildSwapExactOutTx({ /* parameters */ }).sign().complete();
const hash = await tx.submit();
console.log("Swap tx hash:", hash);

Contributing

Contributions welcome! Please see our CONTRIBUTING.md.


License

MIT © Minswap Labs