> ## Documentation Index
> Fetch the complete documentation index at: https://kamino.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Liquidity

> Learn how to build with Kamino's automated concentrated liquidity vaults

<div id="liquidity-dev-overview">
  ## Overview

  Kamino Liquidity provides access to automated concentrated liquidity strategies on Solana via a TypeScript SDK and public API. A strategy manages a CLMM position for a token pair within a defined price range, handling rebalancing, fee compounding, and reward collection. Depositors receive [kTokens](/products/liquidity/concepts#ktokens), which represent a proportional share of the strategy and are redeemable for the underlying assets based on the current share price.

  <Note>
    Providing liquidity carries impermanent loss risk — see [Liquidity Concepts](/products/liquidity/concepts) for the full explanation before integrating.
  </Note>

  ## Key Components of Liquidity Integration

  <CardGroup cols={3}>
    <Card title="Strategy Operations" icon="right-left">
      Two-sided and single-sided deposits, partial and full withdrawals, with ATA management and lookup-table resolution handled by the SDK.
    </Card>

    <Card title="Position Tracking" icon="user">
      User share holdings, USD valuation, pending fees and rewards, PnL, and transaction history.
    </Card>

    <Card title="Strategy Analytics" icon="chart-mixed">
      Share price, TVL, APR/APY, price range, and historical metrics for charts and dashboards.
    </Card>
  </CardGroup>

  ## Integration Options

  <CardGroup cols={2}>
    <Card title="Public API" icon="globe">
      Read-only access to strategy metrics, historical performance, user PnL, fees and rewards, and transaction history. Language-agnostic REST endpoints.
    </Card>

    <Card title="TypeScript SDK" icon="code">
      On-chain reads and transaction building for deposits, withdrawals, and position tracking. TS/JS only.
    </Card>
  </CardGroup>

  ### Deposit

  <Tabs>
    <Tab title="TypeScript">
      ```typescript theme={null}
      import { createSolanaRpc, address } from '@solana/kit';
      import { Kamino } from '@kamino-finance/kliquidity-sdk';
      import Decimal from 'decimal.js';

      const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com');
      const kamino = new Kamino('mainnet-beta', rpc);

      const STRATEGY = address('CEz5keL9hBCUbtVbmcwenthRMwmZLupxJ6YtYAgzp4ex');
      const strategyState = (await kamino.getStrategiesWithAddresses([STRATEGY]))[0];

      // Single-sided deposit: 2 USDC with 100 bps slippage. The SDK swaps half
      // the input into the other side via Jupiter v6 before depositing.
      const { instructions, lookupTablesAddresses } =
        await kamino.singleSidedDepositTokenB(
          { address: STRATEGY, strategy: strategyState.strategy },
          new Decimal(2.0),
          signer, // TransactionSigner
          new Decimal(100),
        );

      console.log('Deposit Instructions:', instructions);
      ```

      <a href="https://github.com/Kamino-Finance/kliquidity-sdk/tree/master/examples" target="_blank" rel="noopener noreferrer" class="github-link">
        <Icon icon="github" iconType="brands" size={16} />

        <span>View Code</span>
      </a>
    </Tab>
  </Tabs>

  <Note>
    For the full deposit flow including lookup-table resolution and transaction confirmation, see [Deposit Operations](/build/developers/liquidity/operations/deposit).
  </Note>

  ### Withdraw

  <Tabs>
    <Tab title="TypeScript">
      ```typescript theme={null}
      import { createSolanaRpc, address } from '@solana/kit';
      import { Kamino } from '@kamino-finance/kliquidity-sdk';

      const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com');
      const kamino = new Kamino('mainnet-beta', rpc);

      const STRATEGY = address('CEz5keL9hBCUbtVbmcwenthRMwmZLupxJ6YtYAgzp4ex');
      const strategy = await kamino.getStrategyByAddress(STRATEGY);
      const strategyWithAddress = { strategy, address: STRATEGY };

      // Burn all shares and receive Token A + Token B back to the user's ATAs.
      const bundle = await kamino.withdrawAllShares(
        strategyWithAddress,
        signer, // TransactionSigner
      );

      console.log('Withdraw Instructions:', bundle?.withdrawIx);
      ```

      <a href="https://github.com/Kamino-Finance/kliquidity-sdk/tree/master/examples" target="_blank" rel="noopener noreferrer" class="github-link">
        <Icon icon="github" iconType="brands" size={16} />

        <span>View Code</span>
      </a>
    </Tab>
  </Tabs>

  <Note>
    For the full withdraw flow including ATA setup, lookup-table resolution, and transaction confirmation, see [Withdraw Operations](/build/developers/liquidity/operations/withdraw).
  </Note>

  ## What's Covered

  <CardGroup cols={2}>
    <Card title="Strategy Data" icon="chart-line" href="/build/developers/liquidity/data/strategy">
      List strategies, read share price, TVL, APR/APY, price range, and token balances.
    </Card>

    <Card title="User Position Data" icon="user" href="/build/developers/liquidity/data/user-position">
      Fetch user positions, USD valuation, pending fees and rewards, and PnL.
    </Card>

    <Card title="Deposit" icon="arrow-down-to-line" href="/build/developers/liquidity/operations/deposit">
      Two-sided deposits and single-sided deposits via auto-swap.
    </Card>

    <Card title="Withdraw" icon="arrow-up-from-line" href="/build/developers/liquidity/operations/withdraw">
      Withdraw a specific share amount or close the full position.
    </Card>
  </CardGroup>

  ## Relevant Links

  <CardGroup cols={2}>
    <Card title="Fetch Data via the API" icon="globe" href="https://api-docs.kamino.com/">
      Access strategy metrics and performance data through REST endpoints.
    </Card>

    <Card title="Kliquidity SDK repository" icon="github" href="https://github.com/Kamino-Finance/kliquidity-sdk">
      Explore the SDK source, on-chain program docs, and example scripts.
    </Card>

    <Card title="NPM SDK package" icon="npm" href="https://www.npmjs.com/package/@kamino-finance/kliquidity-sdk">
      Install the TypeScript SDK to integrate liquidity operations.
    </Card>

    <Card title="Liquidity Concepts" icon="book-open" href="/products/liquidity/concepts">
      AMMs, concentrated liquidity, impermanent loss, and kTokens explained.
    </Card>
  </CardGroup>
</div>
