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 🙏

© 2025 – Pkg Stats / Ryan Hefner

kinetic-sdk

v2.1.0

Published

Kinetic SDK for Solana protocols

Readme

kinetic-sdk - Core SDK

npm version

The core Kinetic SDK for interacting with Solana DeFi protocols.

Overview

This package provides comprehensive TypeScript/JavaScript APIs for interacting with Kinetic's suite of DeFi protocols on Solana, including:

  • CPMM (Constant Product Market Maker) - AMM pools for token swaps
  • FBO (Frequent Batch Ordering) - MEV-resistant batch auctions
  • Launchpad - Token launch and distribution platform

Features

🔌 Protocol Clients

  • Type-safe Anchor program clients
  • Automatic transaction building
  • Error handling with user-friendly messages
  • Support for all protocol operations

📊 Read Operations (No Wallet Required)

  • Fetch pool data with reserves
  • Calculate swap outputs and price impact
  • Discover token prices via BFS algorithm
  • Monitor pools in real-time

💱 Trading Operations

  • Token swaps with slippage protection
  • Add/remove liquidity
  • Create new pools
  • Claim fees and rewards

🧮 Advanced Calculations

  • Pool math utilities (TVL, APY, price impact)
  • Impermanent loss calculator
  • LP token valuation
  • Price discovery through pool graph

🎯 Developer Experience

  • Full TypeScript support
  • Comprehensive error handling
  • Extensive examples
  • Modular architecture

Directory Structure

src/
├── kinetic/
│   ├── cpmm/           # CPMM protocol implementation
│   │   ├── client.ts       # Main CPMM client
│   │   ├── methods.ts      # Protocol operations
│   │   ├── pool-fetcher.ts # Read-only pool data
│   │   ├── pool-math.ts    # Calculation utilities
│   │   ├── price-calculator.ts # Price discovery
│   │   ├── enriched-pool.ts    # Enhanced pool types
│   │   ├── errors.ts       # Error handling
│   │   ├── constants/      # Network configurations
│   │   ├── idl/           # Contract IDL files
│   │   └── types/         # TypeScript types
│   ├── fbo/            # FBO protocol (coming soon)
│   └── launchpad/      # Launchpad protocol (coming soon)
├── common/             # Shared utilities
└── index.ts           # Main exports

Quick Start

import { Connection } from '@solana/web3.js';
import { 
  fetchAllPoolsWithReserves,
  PoolMath,
  PriceCalculator 
} from '@kinetic/sdk';

// No wallet needed for read operations!
const connection = new Connection('https://api.devnet.solana.com');

// Fetch all pools with reserves
const pools = await fetchAllPoolsWithReserves(connection);

// Calculate swap output
const swapResult = PoolMath.calculateSwapOutput(
  amountIn,
  pool.token0VaultReserve,
  pool.token1VaultReserve,
  pool.tradeFeeRate
);

// Discover token prices
const prices = PriceCalculator.fromPools(pools, seedPrices);

Examples

See the examples directory for:

  • basic-usage.ts - Simple operations and common patterns
  • advanced-pool-usage.ts - Complex calculations and enriched data

Technical Details

Anchor Integration

Built on top of Anchor framework for type-safe program interactions with automatic IDL parsing and transaction building.

Network Support

  • Mainnet-beta
  • Devnet (default for development)
  • Testnet
  • Localnet

Dependencies

  • @solana/web3.js - Solana blockchain interaction
  • @coral-xyz/anchor - Smart contract framework
  • @solana/spl-token - SPL token operations
  • bn.js - Big number arithmetic

Contributing

This is the core protocol implementation. When adding new features:

  1. Implement in the appropriate protocol module
  2. Export from the module's index.ts
  3. Add to main index.ts exports
  4. Include examples demonstrating usage
  5. Update types as needed

License

Apache-2.0