TypeScript Tranching Instructions
These are the instruction builders provided by theTranchingMarket class. They handle market account resolution, return model storage, address lookup tables, SY CPI accounts, and base token conversion.
Installation
TranchingMarket class:
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.Instructions
Wrapper Deposit
Deposit base assets into the Senior or Junior tranche. The wrapper mints SY first and deposits it into the market atomically.
Wrapper Withdraw
Burn Senior or Junior LP shares, withdraw SY, and redeem SY back to the base asset in one flow.
Deposit SY
Deposit existing SY into Senior or Junior and receive tranche LP shares.
Withdraw SY
Burn tranche LP shares and receive SY without redeeming back to the base asset.