Installation
Setup
Amount inputs use raw token units.
amountBase uses the base token’s smallest units, amountIn uses SY token units, and LP amounts use tranche LP token units. APY inputs use decimal rates, so 0.10 means 10%.1
Choose a tranche
Use
TrancheSide.Senior for protected exposure and TrancheSide.Junior for first-loss exposure with higher expected return.2
Deposit base assets
Use
ixWrapperDeposit to deposit the market’s base asset. The wrapper mints SY first, deposits SY into the selected tranche, and mints Senior or Junior LP shares.3
Deposit into Junior
Junior deposits use the same wrapper with
TrancheSide.Junior.4
Withdraw to base assets
Use
ixWrapperWithdraw to burn tranche LP shares, withdraw SY from the market, and redeem SY back to the base asset.5
Read market state
Use read helpers to inspect current NAV, LP prices, capacity, APY, and Senior protection before sending transactions.
SY-only instructions
If you already hold SY, useixDeposit and ixWithdraw instead of the wrappers. These methods skip base asset minting and redemption.
Next Steps
Technical Concepts
Understand coverage, utilization, return curves, recovery periods, and LP pricing.
TypeScript Instructions
Explore high-level deposit and withdraw builders.
Read Functions
Query NAV, capacity, APY, and Senior protection without submitting transactions.
Account References
Inspect the market account, return model storage, risk config, and fee config.