Skip to main content
Deposits can start from the base asset through ixWrapperDeposit, or from existing SY through ixDeposit. For raw/display units and fee-rate scale, see Units and Fees.

Deposit Preview Math

The tranching market mints LP shares from the SY value allocated to the selected tranche. valueAllocated=amountInSY×syExchangeRate\text{valueAllocated} = \text{amountInSY} \times \text{syExchangeRate} In raw execution, amountInSY is the amount_in u64 in SY token units and syExchangeRate is a Number. The result is a raw fixed-point NAV value. No token-decimal normalization happens onchain. grossLpOut=valueAllocated×(currentLpSupply+1)trancheEffectiveNAV+1NAV\text{grossLpOut} = \left\lfloor \frac{\text{valueAllocated} \times (\text{currentLpSupply} + 1)} {\text{trancheEffectiveNAV} + 1_{\text{NAV}}} \right\rfloor Deposit fees are charged in LP shares: depositFeeLpShares=grossLpOut×depositFeeRate\text{depositFeeLpShares} = \left\lceil \text{grossLpOut} \times \text{depositFeeRate} \right\rceil The user receives: netLpOut=grossLpOutdepositFeeLpShares\text{netLpOut} = \text{grossLpOut} - \text{depositFeeLpShares} The market accounting supply increases by grossLpOut, not netLpOut: totalLpSupplynext=currentLpSupply+grossLpOut\text{totalLpSupply}_{\text{next}} = \text{currentLpSupply} + \text{grossLpOut} The user receives netLpOut. The fee shares remain pending until mintProtocolFeeShares mints them to the protocol fee recipient.

Deposit Example

Assume a Senior deposit with normalized values. For raw execution, scale SY and LP amounts by the mint decimals and scale fee rates by 1_000_000_000_000.
InputValue
amountInSY1,000 SY
syExchangeRate1.05 NAV per SY
valueAllocated1,050 NAV
currentLpSupply10,000 Senior LP
trancheEffectiveNAV10,000 NAV
seniorDepositProtocolFee0.20%
Then: grossLpOut=1,050×(10,000+1)10,000+1=1,050\text{grossLpOut} = \left\lfloor \frac{1{,}050 \times (10{,}000 + 1)}{10{,}000 + 1} \right\rfloor = 1{,}050 depositFeeLpShares=1,050×0.002=3\text{depositFeeLpShares} = \left\lceil 1{,}050 \times 0.002 \right\rceil = 3 netLpOut=1,0503=1,047\text{netLpOut} = 1{,}050 - 3 = 1{,}047 The user receives 1,047 Senior LP. Market accounting total Senior LP supply increases by 1,050, and 3 Senior LP shares are added to pending deposit protocol fees.
Set minLpOut on ixWrapperDeposit or ixDeposit so the transaction fails if the output is worse than your integration preview.