Skip to main content
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

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

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:
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:
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:
import { getEarlyExitInstruction } from '@/app/generated/split-engine/instructions';
Fee is 30 bps of the exit amount.