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

@potswap_io/sdk

v0.6.0

Published

Potswap SDK: best-route Solana swaps with hard spending limits, transfers, wallet, strategies (DCA / rebalance / TP-SL / limit) and POT rewards. The engine behind @potswap_io/mcp and the potswap CLI. Non-custodial.

Readme

@potswap_io/sdk

The engine behind the Potswap MCP server and the potswap CLI, as a typed Node library: best-route Solana swaps with hard spending limits, transfers, a local wallet, history and PnL, standing strategies (DCA, rebalance, take-profit / stop-loss, limit orders) and POT rewards. Non-custodial: everything runs on your machine with your signer. Node 20+.

npm i @potswap_io/sdk
import { PotswapApi, loadConfig, loadSigner, buildQuote, executeSwap, rpcBalances, SOL_MINT, USDC_MINT } from '@potswap_io/sdk'

const config = loadConfig(process.env)            // SOLANA_*, POTSWAP_* (same variables as the MCP server)
const api = new PotswapApi(config.apiBase)        // https://www.potswap.io by default; no API keys needed
const signer = loadSigner({ privateKey: config.privateKey, keypairPath: config.keypairPath, stateDir: config.stateDir })
const balances = rpcBalances(config.rpcUrl)

const quote = await buildQuote(api, { inputMint: SOL_MINT, outputMint: USDC_MINT, amount: 0.1 })
const result = await executeSwap({ api, config, signer, balances }, { inputMint: SOL_MINT, outputMint: USDC_MINT, amount: 0.1, confirm: true })
if (result.kind === 'ok') console.log(result.result.signature, result.result.feeUsd, result.result.pointsAdded)
else console.error(result.kind, 'message' in result ? result.message : result.quote)

Every outcome is a tagged union (no-wallet, refused, quote-only, dry-run, failed, ok) and every message states whether funds were debited. POTSWAP_MAX_TRADE_SOL, POTSWAP_MAX_SLIPPAGE_BPS, POTSWAP_ALLOWED_TOKENS, POTSWAP_DRY_RUN and the 0.01 SOL reserve apply to every signing path exactly as in the MCP server.

Modules

| Export | Purpose | |---|---| | PotswapApi, ApiError | quotes, orders, execute, tokens, prices, points, launch pool, stats, history, OHLCV; retries once on 429 / 503 | | buildQuote, executeSwap | the swap path: quote → limits → fresh order as taker → local signature → execute | | executeTransfer, rpcFromConnection | SOL / SPL / Token-2022 transfers with ATA creation, recipient allowlist, caps, reserve; no fee | | checkLimits | per-trade and slippage caps, reserve, SOL-equivalent valuation | | loadSigner, createWallet | keypair from env, file or <stateDir>/wallet.json; createWallet writes it (0600) | | normalizeHistory, mapSignatureStatus, computePositions | parsed history and average-cost PnL | | Scheduler, FileStore, MemoryStore, acquireLock, strategy types and engine functions | DCA / rebalance / TP-SL / limit strategies with a one-process lock | | createRuntime | wires config → signer, API, balances, store, lock, scheduler (what the MCP server and potswap daemon use) | | feeBpsFor, parseFeeSchedule, DEFAULT_FEE_SCHEDULE | the fee schedule shared with the web app (2.5%, 1% at or above $1,000, staker tier) | | riskBadges, riskLevel, friendlyError, describeOrderError | the same risk flags and error copy the web app shows | | redact, redactValue, registerSecret, log | secret redaction for anything you print or persist |

Full documentation, including the MCP server and the CLI that are built on this package: https://docs.potswap.io

Fees and rewards

Swaps, stakes and strategy legs carry Potswap's 2.5% integrator fee inside the trade (1% at or above $1,000); Jupiter keeps 20%. Before the token launches, 60% of the net fee fills the launch pool, 20% is set aside as the trader's reward balance (buys POT after launch), 20% runs the project. Transfers and all reads are free. Only protocol fees enter the launch pool; nothing can be deposited.

MIT.