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

# DAMM v1 TS SDK Getting Started

> Learn how to install and initialize @meteora-ag/dynamic-amm-sdk for DAMM v1 pool reads, quotes, swaps, liquidity, and locks.

The DAMM v1 TypeScript SDK is published as `@meteora-ag/dynamic-amm-sdk`. It wraps pool state reads, Dynamic Vault reads, quote math, transaction builders, pool creation helpers, config reads, and LP lock flows.

<CardGroup cols={2}>
  <Card title="DAMM v1 SDK Repository" icon="github" iconType="solid" href="https://github.com/MeteoraAg/damm-v1-sdk">
    Source for the TypeScript SDK, examples, Rust quote crate, Rust helpers, and CLI.
  </Card>

  <Card title="NPM Package" icon="npm" iconType="solid" href="https://www.npmjs.com/package/@meteora-ag/dynamic-amm-sdk">
    Published `@meteora-ag/dynamic-amm-sdk` package.
  </Card>
</CardGroup>

## Installation

Install the SDK with Solana Web3. The package uses `bn.js` amounts for token units.

<Tabs>
  <Tab title="npm">
    ```bash theme={"system"}
    npm install @meteora-ag/dynamic-amm-sdk @solana/web3.js bn.js
    ```
  </Tab>

  <Tab title="pnpm">
    ```bash theme={"system"}
    pnpm install @meteora-ag/dynamic-amm-sdk @solana/web3.js bn.js
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={"system"}
    yarn add @meteora-ag/dynamic-amm-sdk @solana/web3.js bn.js
    ```
  </Tab>
</Tabs>

## Create A Pool Client

```typescript theme={"system"}
import AmmImpl from "@meteora-ag/dynamic-amm-sdk";
import { Connection, PublicKey } from "@solana/web3.js";

const connection = new Connection(process.env.RPC_URL!, "confirmed");
const poolAddress = new PublicKey("...");

const pool = await AmmImpl.create(connection, poolAddress, {
  cluster: "mainnet-beta",
});

console.log({
  lpMint: pool.getPoolTokenMint().toBase58(),
  tokenA: pool.tokenAMint.address.toBase58(),
  tokenB: pool.tokenBMint.address.toBase58(),
  tokenAAmount: pool.poolInfo.tokenAAmount.toString(),
  tokenBAmount: pool.poolInfo.tokenBAmount.toString(),
  virtualPrice: pool.poolInfo.virtualPrice,
});
```

Use `cluster: "devnet"` when working against devnet. The DAMM v1 program ID is the same on mainnet and devnet:

```typescript theme={"system"}
// Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB
```

## Load Multiple Pools

`createMultiple` batches pool, vault, LP mint, token account, clock, and depeg account reads.

```typescript theme={"system"}
import AmmImpl from "@meteora-ag/dynamic-amm-sdk";
import { PublicKey } from "@solana/web3.js";

const pools = await AmmImpl.createMultiple(
  connection,
  [
    new PublicKey("..."),
    new PublicKey("..."),
  ],
  { cluster: "mainnet-beta" },
);

for (const pool of pools) {
  console.log(pool.address.toBase58(), pool.poolInfo.virtualPrice);
}
```

## Transactions Are Unsigned

Most SDK methods return an unsigned `Transaction` or an array of unsigned transactions. Your wallet, backend signer, or transaction pipeline must sign and send them.

```typescript theme={"system"}
const tx = await pool.swap(
  user.publicKey,
  pool.tokenAMint.address,
  inAmount,
  quote.minSwapOutAmount,
);

tx.sign(user);
const signature = await connection.sendRawTransaction(tx.serialize());
await connection.confirmTransaction(signature, "confirmed");
```

## Development Commands

| Task                 | Command                                    |
| -------------------- | ------------------------------------------ |
| Install dependencies | `cd damm-v1-sdk/ts-client && pnpm install` |
| Build SDK            | `pnpm run build`                           |
| Run SDK tests        | `pnpm test`                                |
| Run one example      | `tsx src/examples/<file-name>.ts`          |

Some examples in the repository expect a local keypair and hard-coded devnet or mainnet pool addresses. Replace RPC URLs, pool addresses, mint addresses, and signer loading before reusing them in an application.

## Next Steps

<CardGroup cols={2}>
  <Card title="Examples" icon="code" iconType="solid" href="/developer-guides/damm-v1/typescript-sdk/examples">
    Practical TypeScript patterns for pool reads, quotes, swaps, deposits, withdrawals, pool creation, and locks.
  </Card>

  <Card title="Reference" icon="book" iconType="solid" href="/developer-guides/damm-v1/typescript-sdk/reference">
    SDK exports, constants, public methods, helper functions, types, and integration notes.
  </Card>
</CardGroup>
