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

# Split Yield into PT + YT

> Turn vault shares into transferable principal and yield tokens.

Once you hold vault shares, the split-engine can wrap them into PT (principal,
1:1 redeemable at maturity) and YT (yield, all future accrual). Both are plain
SPL tokens.

## 1. Find the market

```ts theme={null}
import { findMarketPda, fetchMarket } from '@/app/generated/split-engine/accounts';

const [market] = await findMarketPda({
  vault: vaultPda,
  maturity: BigInt(maturityTs),
});
const marketAccount = await fetchMarket(rpc, market);
```

## 2. Deposit shares

```ts theme={null}
import { getDepositInstruction, findUserPositionPda }
  from '@/app/generated/split-engine/instructions';

const [userPosition] = await findUserPositionPda({ market, owner: wallet.address });

const ix = getDepositInstruction({
  user: wallet,
  market,
  userPosition,
  vaultShareMint: marketAccount.vaultShareMint,
  ptMint: marketAccount.ptMint,
  ytMint: marketAccount.ytMint,
  vaultShareEscrow: marketAccount.vaultShareEscrow,
  userVaultShareAta,
  userPtAta,
  userYtAta,
  amount: 1_000_000_000n,   // 1,000 shares (9 decimals)
});
```

After it lands you hold **1,000 PT + 1,000 YT**.

## 3. Claim yield

Each time someone cranks `update_rewards`, your YT's share of accumulated yield
grows. Claim with:

```ts theme={null}
import { getClaimYieldInstruction } from '@/app/generated/split-engine/instructions';

const ix = getClaimYieldInstruction({
  user: wallet,
  market,
  userPosition,
  vaultShareEscrow: marketAccount.vaultShareEscrow,
  userVaultShareAta,
});
```

Yield arrives as vault shares (not USDC directly).

## 4. Redeem PT at maturity

After `clock.unix_timestamp ≥ market.maturity`:

```ts theme={null}
import { getRedeemPtInstruction } from '@/app/generated/split-engine/instructions';

const ix = getRedeemPtInstruction({
  user: wallet,
  market,
  ptMint: marketAccount.ptMint,
  vaultShareEscrow: marketAccount.vaultShareEscrow,
  userPtAta,
  userVaultShareAta,
  amount: 1_000_000_000n,
});
```

PT burns 1:1 for vault shares, regardless of how funding performed.

## 5. Early exit (before maturity)

Only works if you hold **matched** PT + YT pairs:

```ts theme={null}
import { getEarlyExitInstruction } from '@/app/generated/split-engine/instructions';
```

Fee is 30 bps of the exit amount.
