@kamino-finance/kliquidity-sdk
v12.0.1
Published
Typescript SDK for interacting with the Kamino Liquidity (kliquidity) protocol
Downloads
58,657
Maintainers
Readme
Kamino Liquidity SDK
Typescript SDK for integrating with Kamino Liquidity (automated CLMM vaults) on Solana. Kamino manages concentrated liquidity positions across Orca Whirlpools, Raydium CLMM, and Meteora DLMM, handling automatic rebalancing, fee compounding, and reward collection.
Quick Start
npm install @kamino-finance/kliquidity-sdk @solana/kit decimal.jsimport { Kamino } from '@kamino-finance/kliquidity-sdk';
import { createSolanaRpc } from '@solana/kit';
const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com');
const kamino = new Kamino('mainnet-beta', rpc);
// List all live strategies
const strategies = await kamino.getAllStrategiesWithFilters({ strategyCreationStatus: 'LIVE' });
// Get share price for a strategy
const sharePrice = await kamino.getStrategySharePrice(strategies[0].address);
console.log('Share price:', sharePrice.toString());Documentation
| Document | Description | |----------|-------------| | Overview | Core concepts, installation, and SDK setup | | Reading Strategies | List strategies, get metrics, balances, and ranges | | Deposits | Both-sided and single-sided deposits | | Withdrawals | Partial and full share withdrawals | | Positions & PnL | User positions, fees, rewards, strategy holders | | REST API Reference | Kamino Public API endpoints | | API Response Types | TypeScript interfaces for API responses | | SDK Types | SDK type reference | | FAQ | Common questions |
Examples
See the examples/ directory for runnable code. Setup:
cd examples
yarn install
export RPC_ENDPOINT=YOUR_RPC_URL_HERE| Example | Run | Description |
|---------|-----|-------------|
| Read strategy | yarn read-strategy | Strategy data, share price, token balances |
| Read positions | yarn read-positions | User positions and USD values |
| Strategy APY | yarn strategy-apy | APR/APY, position range, pool price |
| Strategy holders | yarn strategy-holders | All holders of a strategy |
| Deposit & stake | yarn deposit-and-stake | Deposit tokens and stake in farm |
| Unstake & withdraw | yarn unstake-and-withdraw | Unstake from farm and withdraw |
Development
Codegen
Copy the new idl from the kamino-liquidity program to src/kamino-client/idl.json:
yarn codegen:kliquiditySetup localnet
Ensure deps contains the correct .so you want to test against. Either build it from the main repo or dump it from mainnet:
yarn start-validatorRun tests
yarn start-validator-and-test
# Or, if the local validator is already running:
yarn testSync with smart contracts
yarn
solana program dump 6LtLpnUFNByNXLyCoK9wA2MykKAmQNZKBdY8s47dehDc -u m deps/kamino.so
yarn codegen