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

# Deposit Liquidity

> Low-level instruction to create a new LP position and deposit liquidity

# createDepositLiquidityInstruction

Builds a raw instruction to create a new LP position and deposit liquidity at specified tick boundaries. This initializes a fresh position account and deposits PT and SY tokens into the pool within the defined tick range.

## Usage

```typescript theme={null}
import { createDepositLiquidityInstruction } from "@exponent-labs/exponent-sdk/client/clmm";
import { Keypair, PublicKey, SystemProgram } from "@solana/web3.js";

const lpPositionKeypair = Keypair.generate();

const ix = createDepositLiquidityInstruction({
  depositor: depositorKeypair.publicKey,
  market: marketAddress,
  ticks: ticksAccount,
  lpPosition: lpPositionKeypair.publicKey,
  tokenPtSrc: depositorPtTokenAccount,
  tokenSySrc: depositorSyTokenAccount,
  tokenPtEscrow: marketPtEscrow,
  tokenSyEscrow: marketSyEscrow,
  addressLookupTable: lookupTableAddress,
  tokenProgram: tokenProgramId,
  syProgram: syProgramId,
  systemProgram: SystemProgram.programId,
  eventAuthority: eventAuthorityPda,
  program: clmmProgramId,
  lowerTickKey: 100,
  upperTickKey: 200,
  maxSyIn: 1_000_000_000n,
  maxPtIn: 500_000_000n,
});
```

## Accounts

| Name                 | Type        | Signer | Writable | Description                                    |
| -------------------- | ----------- | ------ | -------- | ---------------------------------------------- |
| `depositor`          | `PublicKey` | Yes    | Yes      | Wallet providing liquidity                     |
| `market`             | `PublicKey` | No     | Yes      | The CLMM market account                        |
| `ticks`              | `PublicKey` | No     | Yes      | The market tick array account                  |
| `lpPosition`         | `PublicKey` | Yes    | Yes      | LP position account (signer for new positions) |
| `tokenPtSrc`         | `PublicKey` | No     | Yes      | Depositor's PT token account                   |
| `tokenSySrc`         | `PublicKey` | No     | Yes      | Depositor's SY token account                   |
| `tokenPtEscrow`      | `PublicKey` | No     | Yes      | Market PT escrow account                       |
| `tokenSyEscrow`      | `PublicKey` | No     | Yes      | Market SY escrow account                       |
| `addressLookupTable` | `PublicKey` | No     | No       | Market address lookup table                    |
| `tokenProgram`       | `PublicKey` | No     | No       | SPL Token program                              |
| `syProgram`          | `PublicKey` | No     | No       | SY program                                     |
| `systemProgram`      | `PublicKey` | No     | No       | System program                                 |
| `eventAuthority`     | `PublicKey` | No     | No       | Event authority PDA                            |
| `program`            | `PublicKey` | No     | No       | CLMM program ID                                |

## Args

| Name           | Type  | Description                            |
| -------------- | ----- | -------------------------------------- |
| `lowerTickKey` | `u32` | Lower tick boundary for the position   |
| `upperTickKey` | `u32` | Upper tick boundary for the position   |
| `maxSyIn`      | `u64` | Maximum amount of SY tokens to deposit |
| `maxPtIn`      | `u64` | Maximum amount of PT tokens to deposit |

## Returns

`TransactionInstruction` — a transaction instruction ready to be added to a transaction.
