Every deposit or withdrawal syncs the market against the current SY exchange rate before validation. An integration preview can become stale if the SY exchange rate, return model, or market state changes before execution. For the lifecycle model, see Market State Model. For utilization math, see Utilization. Utilization and threshold fields are
Number fixed-point ratios onchain. A displayed 1.0 is stored as 1_000_000_000_000.
Shared Checks
| Check | Source | Raw dimension |
|---|---|---|
| Market must not be paused | state.statusFlags; see Status Flags | Bitmask |
Deposit amount must meet minDepositAmount | state.riskConfig.minDepositAmount; see TranchingRiskConfig | Raw SY units after any wrapper mint |
Output must satisfy minLpOut, minAmountOut, or minBaseOut | SDK instruction parameters | Raw LP, SY, or base token units |
| LP supply cap must not be exceeded | max_senior_lp_supply, max_junior_lp_supply; see TrancheSupplyState | Raw LP mint units |
| Capacity and utilization must remain valid | Capacity Helpers, Utilization | Capacity helpers return raw NAV or raw LP depending on helper; utilization is a Number ratio |
Senior Deposit
Senior deposits are allowed inActive or FixedTermRecovery, but only when both Senior and Junior impermanent loss balances are zero.
The post-deposit utilization must not exceed 1.0:
The program compares U_post to UNIT, where UNIT = 1_000_000_000_000.
Use getSrRemainingCapacityNetAssetValue() or getSyncedSrRemainingCapacityNetAssetValue() to check remaining Senior room. Senior capacity can be lower than the configured max supply because it is also constrained by available Junior coverage.
Junior Deposit
Junior deposits are allowed only inActive. They are blocked while Senior has unrecovered impermanent loss.
Junior deposits increase Junior effective NAV and usually reduce utilization. They are still subject to maxJuniorLpSupply when that cap is non-zero.
Use getJrRemainingCapacityNetAssetValue() or getSyncedJrRemainingCapacityNetAssetValue() to check configured Junior capacity.
Senior Withdrawal
Senior withdrawals are allowed only inActive. During the Recovery Period, Senior withdrawals are paused.
The recovery window is the market’s fixed-term observation period:
| Field | Meaning | Raw dimension |
|---|---|---|
state.riskConfig.fixedTermDurationSec | Duration of the observation period. 0 disables fixed-term recovery | Seconds |
state.financials.fixedTermEndTs | End timestamp for the current recovery period | Unix timestamp seconds |
FixedTermRecovery as a Senior withdrawal lock. You can still transfer Senior LP tokens, but the market will not redeem them until the state returns to Active.
Junior Withdrawal
Junior withdrawals are allowed inActive and FixedTermRecovery, but they cannot reduce protection below the market’s required level. The transaction fails if post-withdraw utilization exceeds 1.0:
The program compares U_post to UNIT, where UNIT = 1_000_000_000_000.
For integrations that allow Junior LP as collateral, this check is important. A Junior LP balance can be transferable and still fail redemption if withdrawing it would leave Senior under-protected.
Risk Integration Checklist
| Area | What to check |
|---|---|
| Senior collateral | Treat FixedTermRecovery as a redemption lock |
| Junior collateral | Account for first-loss exposure and post-withdraw utilization checks |
| Capacity | Use synced capacity helpers when the SY exchange rate may have moved |
| Slippage protection | Set minLpOut, minAmountOut, or minBaseOut |
| Observation period | Read fixedTermDurationSec and fixedTermEndTs before assuming redemption timing |