Skip to main content
split-engine takes any yield-bearing vault share and mints two tradable SPL tokens: PT (redeems 1:1 at maturity) and YT (receives all yield accrued before maturity).

Accounts

Market

["market", vault, maturity].
FieldTypeNotes
vaultPubkeyUnderlying vault (e.g. delta-vault)
vault_share_mintPubkeyVault share SPL mint
pt_mintPubkeyPrincipal token mint (authority = market PDA)
yt_mintPubkeyYield token mint (authority = market PDA)
vault_share_escrowPubkeyHolds deposited shares
maturityi64unix timestamp
total_depositsu64PT supply
total_yt_supplyu64should equal total_deposits
reward_per_shareu128MasterChef accumulator (9-decimal)
last_vault_share_priceu64for delta computation
accumulated_yieldu64total yield held in escrow

UserPosition

["position", market, owner].
FieldTypeNotes
ownerPubkey
marketPubkey
yt_balanceu64
reward_debtu128yt_balance × reward_per_share at last interaction

Instructions

InstructionWhoPurpose
initialize_marketadminCreate market with maturity and mints
deposituserAuto-claim pending → escrow shares → mint PT+YT 1:1
claim_yielduserTransfer pending yield (vault shares) from escrow
redeem_ptuserAt maturity: burn PT → receive vault shares 1:1
early_exituserBurn matched PT+YT → shares minus 0.3% fee
update_rewardsanyoneSync reward_per_share with current vault share price

MasterChef flow

// On any join/leave:
pending        = user.yt_balance × market.reward_per_share - user.reward_debt
auto_claim(user, pending)
user.yt_balance = new_balance
user.reward_debt = user.yt_balance × market.reward_per_share
This guarantees every YT holder earns exactly the yield accrued while they held, regardless of when others join or leave.

update_rewards

Anyone can crank:
  1. Read vault.share_price().
  2. delta = share_price - last_vault_share_price.
  3. If delta > 0: reward_per_share += delta × PRECISION / total_yt_supply (clamped at 1 if supply=0).
  4. last_vault_share_price = share_price.
Negative share-price movement does not decrement reward_per_share, losses are already absorbed at the vault layer (insurance fund + NAV).

Errors

NotMatured, AlreadyMatured, SupplyInvariantViolated, NoYieldToClaim, MathOverflow.

PT / YT concept

Why split, worked example.

yield-amm

Where PT and underlying trade.