Skip to main content
Set up the Exponent SDK and walk through the main tranching lifecycle - loading a market, depositing into Senior or Junior, withdrawing, and reading market state.

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.
Set minLpOut to protect against stale exchange-rate or NAV assumptions. The transaction reverts if LP output is below that value.
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.
Senior withdrawals are only allowed while the market is Active. During FixedTermRecovery, Senior withdrawals are paused.
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, use ixDeposit 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.