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

# Overview

> High-level TypeScript SDK instruction functions for Exponent Tranching

# TypeScript Tranching Instructions

These are the instruction builders provided by the `TranchingMarket` class. They handle market account resolution, return model storage, address lookup tables, SY CPI accounts, and base token conversion.

<Tip>
  For low-level control, see the [raw Codama-generated instructions](/developer-tranching/raw-instructions/overview) if you want to work directly with generated instruction builders and resolve accounts manually.
</Tip>

## Installation

```bash theme={null}
npm install @exponent-labs/exponent-sdk @solana/web3.js
```

All high-level instructions are methods on the `TranchingMarket` class:

```typescript theme={null}
import { TranchingMarket } from "@exponent-labs/exponent-sdk";
import { TrancheSide } from "@exponent-labs/exponent-sdk/client/tranching";

const market = await TranchingMarket.load(connection, marketAddress, env);

const { ixs, setupIxs } = await market.ixWrapperDeposit({
  user: wallet.publicKey,
  trancheSide: TrancheSide.Senior,
  amountBase: 1_000_000_000n, // raw base-token units
  minLpOut: 0n,               // raw Senior LP units
});
```

<Note>
  Amounts are always raw token units. `amountBase` uses the base token's smallest units, `amountIn` uses SY token units, and LP fields use the selected tranche LP mint units.
</Note>

## Instructions

<CardGroup cols={2}>
  <Card title="Wrapper Deposit" href="/developer-tranching/typescript/instructions/ix-wrapper-deposit">
    Deposit base assets into the Senior or Junior tranche. The wrapper mints SY first and deposits it into the market atomically.
  </Card>

  <Card title="Wrapper Withdraw" href="/developer-tranching/typescript/instructions/ix-wrapper-withdraw">
    Burn Senior or Junior LP shares, withdraw SY, and redeem SY back to the base asset in one flow.
  </Card>

  <Card title="Deposit SY" href="/developer-tranching/typescript/instructions/ix-deposit">
    Deposit existing SY into Senior or Junior and receive tranche LP shares.
  </Card>

  <Card title="Withdraw SY" href="/developer-tranching/typescript/instructions/ix-withdraw">
    Burn tranche LP shares and receive SY without redeeming back to the base asset.
  </Card>
</CardGroup>
