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

# Strip & Merge

> Strip yield-bearing assets into PT and YT, collect yield, and merge back to the base asset

This page follows 1,000 USDC through every stage of the core Exponent flow: stripping into [PT](https://docs.exponent.finance/developers/learn/emitted-tokens.md#pt-principal-token) and [YT](https://docs.exponent.finance/developers/learn/emitted-tokens.md#yt-yield-token), collecting yield, and merging back to the base asset. Every code block uses the real Exponent Core SDK — for isolated copy-paste snippets, see the [SDK Quickstart](https://docs.exponent.finance/developer-core/core-sdk.md).

## Setup

```typescript theme={null}
import { Vault, YtPosition, LOCAL_ENV } from "@exponent-labs/exponent-sdk";
import { Connection, PublicKey, Transaction, sendAndConfirmTransaction, Keypair } from "@solana/web3.js";

const connection = new Connection("https://api.mainnet-beta.solana.com");
const wallet = Keypair.fromSecretKey(/* ... */);

const vault = await Vault.load(LOCAL_ENV, connection, new PublicKey("..."));

// Scenario starting point
const rate = vault.currentSyExchangeRate; // 1.00
const maturity = vault.expirationDate;    // 90 days from now
```

***

## Initialize a Yield Position

YT does not earn yield sitting in your wallet — it is just an SPL token. To start accruing interest and emissions, it must be deposited into a `YieldTokenPosition`. This is a one-time setup per vault, and must be done before calling `ixStripFromBase` (which auto-deposits YT).

```typescript theme={null}
// One-time: create a yield position for this vault
const initIx = vault.ixInitializeYieldPosition({
  owner: wallet.publicKey,
});

await sendAndConfirmTransaction(
  connection, new Transaction().add(initIx), [wallet]
);
```

***

## Strip

Stripping converts a base asset into PT and YT in one atomic instruction. The vault wraps the base into [SY](https://docs.exponent.finance/developers/learn/emitted-tokens.md#sy-standardized-yield) under the hood, then mints equal amounts of PT and YT based on the current exchange rate. YT is automatically deposited into your yield position and begins accruing immediately.

At a rate of 1.00, depositing 1,000 USDC produces 1,000 PT + 1,000 YT.

```typescript theme={null}
const stripIx = await vault.ixStripFromBase({
  owner: wallet.publicKey,
  amountBase: 1_000_000_000n, // 1,000 USDC (6 decimals)
});

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

const ytPosition = await YtPosition.loadByOwner(
  LOCAL_ENV, connection, wallet.publicKey, vault
);
```

> [!TIP]
>
> If you already hold SY tokens, use `vault.ixStrip({ syIn, depositor })` to skip the base-to-SY wrapping step. Note that `ixStrip` does not auto-deposit YT — you would need to call `ytPosition.ixDepositYt()` separately.

**Holdings: 1,000 PT + 1,000 YT (deposited)**

***

## Collect Yield

### Yield accrues over time

As the underlying protocol (e.g., Marginfi) earns interest, the [SY exchange rate](https://docs.exponent.finance/developers/learn/emitted-tokens.md#sy-standardized-yield) grows. The deposited YT position tracks this growth.

| | Value |
| - | - |
| Exchange rate at deposit | 1.000 |
| Exchange rate after 30 days | \~1.008 |
| YT deposited | 1,000 |
| Accrued interest | \~8.1 SY |

### Stage and collect

Before collecting, the yield must be staged — this snapshots the current exchange rate and computes what is owed.

```typescript theme={null}
// Reload to get latest state
const ytPosition = await YtPosition.loadByOwner(
  LOCAL_ENV, connection, wallet.publicKey, vault
);

// Check how much can be claimed
const claimable = ytPosition.getClaimableInterest(vault.currentSyExchangeRate);

const stageIx = ytPosition.ixStageYield({
  payer: wallet.publicKey,
});

const collectIx = ytPosition.ixCollectInterest({
  signer: wallet.publicKey,
});

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

**Holdings: 1,000 PT + 1,000 YT (deposited) + \~8.1 SY (collected)**

***

## Redeem at Maturity

At [maturity](https://docs.exponent.finance/developers/learn/post-maturity.md), the exchange rate freezes. PT becomes redeemable for its full SY backing, and YT stops accruing. To exit, withdraw YT from the yield position, then merge PT + YT back into the base asset.

```typescript theme={null}
// Withdraw YT from yield position
const withdrawIx = ytPosition.ixWithdrawYt({
  amount: 1_000_000_000n, // 1,000 YT
});

// Merge PT + YT back to base asset in one instruction
const { ixs, setupIxs } = await vault.ixMergeToBase({
  owner: wallet.publicKey,
  amountPy: 1_000_000_000n, // 1,000 PT+YT
});

const tx = new Transaction().add(withdrawIx, ...setupIxs, ...ixs);
await sendAndConfirmTransaction(connection, tx, [wallet]);
```

> [!TIP]
>
> Use `vault.ixMerge({ pyIn, depositor })` to receive SY back instead of the base asset.

***

## Summary

| Stage | Action | SDK Method | Holdings After |
| - | - | - | - |
| Start | — | — | 1,000 USDC |
| Initialize | Create yield position (one-time) | `vault.ixInitializeYieldPosition()` | 1,000 USDC |
| Strip | Base to PT + YT (auto-deposits YT) | `vault.ixStripFromBase()` | 1,000 PT + 1,000 YT (deposited) |
| Collect | Claim accrued interest | `ytPosition.ixStageYield()` + `ixCollectInterest()` | 1,000 PT + 1,000 YT + \~8.1 SY |
| Withdraw | Prepare to merge | `ytPosition.ixWithdrawYt()` | 1,000 PT + 1,000 YT + \~8.1 SY |
| Merge | PT + YT to base asset | `vault.ixMergeToBase()` | \~1,008 USDC |

**Result:** \~0.8% return over 90 days (\~3.3% annualized), matching the underlying lending rate.

## Next Steps

> [card] [SDK Quickstart](https://docs.exponent.finance/developers/guides/quickstart.md)
>
> Install the SDK and walk through the complete flow

> [card] [Trading](https://docs.exponent.finance/developers/guides/trade.md)
>
> Trade PT and YT on the CLMM and Orderbook

> [card] [CLMM Trading](https://docs.exponent.finance/developer-clmm/sdk-quickstart.md)
>
> Buy and sell PT and YT on the concentrated liquidity AMM

> [card] [Orderbook Trading](https://docs.exponent.finance/developer-orderbook/sdk-quickstart.md)
>
> Post limit orders at specific APY levels


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.