> ## 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 SY

> Deposit existing SY into a Senior or Junior tranche

The `ixDeposit` instruction deposits existing SY into the selected tranche and mints Senior or Junior LP shares. Use this when your integration already holds SY and does not need base-asset wrapping.

## Usage

```typescript theme={null}
import { Transaction, sendAndConfirmTransaction } from "@solana/web3.js";
import { TrancheSide } from "@exponent-labs/exponent-sdk/client/tranching";

const ix = market.ixDeposit({
  user: wallet.publicKey,
  trancheSide: TrancheSide.Junior,
  amountIn: 1_000_000_000n, // raw SY units
  minLpOut: 0n,             // raw Junior LP units; set above 0 for output protection
  tokenSrc: userSyTokenAccount,
  tokenLpDst: userJuniorLpTokenAccount,
});

const tx = new Transaction().add(ix);
const signature = await sendAndConfirmTransaction(connection, tx, [wallet]);
```

## Parameters

| Parameter      | Type          | Required | Description                                                                      |
| -------------- | ------------- | -------- | -------------------------------------------------------------------------------- |
| `user`         | `PublicKey`   | Yes      | Wallet depositing SY                                                             |
| `trancheSide`  | `TrancheSide` | Yes      | `TrancheSide.Senior` or `TrancheSide.Junior`                                     |
| `amountIn`     | `bigint`      | Yes      | SY amount to deposit, in raw SY token units                                      |
| `minLpOut`     | `bigint`      | No       | Minimum selected-tranche LP shares to receive, in raw LP units. Defaults to `0n` |
| `tokenSrc`     | `PublicKey`   | Yes      | User SY token source account                                                     |
| `tokenLpDst`   | `PublicKey`   | Yes      | Destination token account for the selected LP mint                               |
| `tokenProgram` | `PublicKey`   | No       | SPL Token program                                                                |

## Behavior

The instruction:

1. Syncs the market against the current SY exchange rate.
2. Validates market state, pause flags, minimum deposit, and capacity.
3. Transfers SY into the market escrow.
4. Mints LP shares to `tokenLpDst`.

<Tip>
  Use `ixWrapperDeposit` if your user starts with the base asset instead of SY.
</Tip>
