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

@kineticliquid-sdk/sdk

v0.1.8

Published

KineticLiquid SDK — Solana-native liquidity execution & loop engine client library

Downloads

1,040

Readme

KineticLiquid

Architecture (Flow)

KineticLiquid SDK

Production-grade, Solana-native TypeScript SDK for KineticLiquid — a liquidity execution & loop engine designed for deterministic, risk-aware automation.

This SDK is infrastructure software: explicit error handling, deterministic routing decisions, and audit-friendly abstractions.

Installation

npm install kineticliquid-sdk

Design Principles

  • No hidden transactions: the SDK never stores private keys and never signs without an explicit wallet.signTransaction(...).
  • Deterministic execution: routing selection and risk checks are deterministic for a given input set.
  • Fail-closed: risk circuit breakers halt execution immediately.
  • Typed, explicit errors: consumer code can reliably branch on error classes.
  • IDL-driven program interface: instruction building and account decoding use the Anchor-compatible IDL in src/idl/kineticliquid.json.

Architecture Overview

  • Client
    • src/client/KineticLiquidClient.ts: single entry point, holds connection/program/wallet, exposes managers.
    • src/client/ConnectionManager.ts: deterministic send/confirm with retry.
  • Vaults
    • src/vaults/VaultManager.ts: creates, fetches, and drives vault lifecycle (initialize_vault, execute_loop, rebalance, unwind, close_vault).
    • src/vaults/Vault.ts: non-custodial vault handle; provides deposit, withdraw, rebalance, unwind, close.
  • Risk (first-class)
    • src/risk/RiskEngine.ts: oracle deviation, volatility thresholds, liquidity health hooks.
    • src/risk/CircuitBreaker.ts: immediate halt semantics.
    • src/risk/OracleValidator.ts: deviation + staleness enforcement.
  • Routing
    • src/routing/ExecutionRouter.ts: deterministic multi-adapter quote selection.
    • src/routing/DexAdapter.ts: adapter interface for DEX integration.
  • Loops
    • src/loops/LoopBuilder.ts: validates configuration and constructs a LoopExecutor.
    • src/loops/LoopExecutor.ts: orchestrates off-chain risk validation and triggers the canonical on-chain execute_loop entrypoint.

Security Model

  • Key management
    • The SDK never persists private keys.
    • All signing is explicit via the consumer-provided wallet.
  • On-chain validation
    • PDA derivations are deterministic and verified before sending lifecycle instructions.
    • Program ID is never hard-coded; it is supplied by the consumer and injected into the IDL at runtime.
  • Risk controls
    • Circuit breakers are enforced before any loop execution.
    • Oracle deviation and volatility checks are deterministic and typed.
  • Failure modes
    • Errors are typed and surfaced; no silent failures.
    • Transactions are sent + confirmed; failures surface as deterministic errors.

Usage

Basic Client + Vault

import { Connection, PublicKey } from '@solana/web3.js';
import { KineticLiquidClient } from 'kineticliquid-sdk';

const connection = new Connection(process.env.RPC_URL!, 'confirmed');
const programId = new PublicKey(process.env.KINETICLIQUID_PROGRAM_ID!);

// wallet must implement: publicKey + signTransaction
const client = new KineticLiquidClient({
  connection,
  wallet,
  environment: 'mainnet',
  programId,
});

// Option A: pass the asset mint directly
const usdcMint = new PublicKey(process.env.USDC_MINT!);
const vault = await client.vaults.create({
  owner: wallet.publicKey,
  assetMint: usdcMint,
  maxOracleDeviationBps: 200,
  maxVolatilityBps: 500,
  maxSlippageBps: 100,
});

// Option B: resolve asset symbols via a user-provided registry (no hard-coded addresses)
// const client = new KineticLiquidClient({
//   connection,
//   wallet,
//   environment: 'mainnet',
//   programId,
//   assetRegistry: { resolveMint: (sym) => { ... } },
// });
// const vault = await client.vaults.create({ owner: wallet.publicKey, asset: 'USDC', ... })

Build and Execute a Loop (Oracle-validated, then on-chain execute_loop)

const loop = client.loops.build({
  vault,
  maxRisk: 0.05,
  rebalanceInterval: 3600,
  oracle,
});

await loop.execute({
  minOutAmount: 0n,
  // optional swap stage (requires registered DEX adapters)
  // swap: { outMint: SOME_MINT, inAmount: 1_000_000n, maxSlippageBps: 100 },
});

Observability

KineticLiquidClient emits structured events:

  • vault:health
  • loop:state
  • execution:record

Consumers can stream these into metrics/logging systems and ensure there are no silent failures.

Testing

  • Unit tests: deterministic and RPC-free
npm run test:unit
  • Integration tests: require a real RPC and a deployed KineticLiquid program
export KINETICLIQUID_RPC_URL=http://127.0.0.1:8899
export KINETICLIQUID_PROGRAM_ID=... # real deployed program id
INTEGRATION=1 npm run test:integration

Legal Disclaimer

This SDK is provided “as is”, without warranty of any kind. You are responsible for validating correctness, security properties, and production suitability for your deployment and jurisdiction.