The ixDeposit instruction deposits existing SY into the selected tranche and mints Senior or Junior LP shares. Use this when your integration already holds SY and does not need base-asset wrapping.
Usage
import { Transaction, sendAndConfirmTransaction } from "@solana/web3.js";
import { TrancheSide } from "@exponent-labs/exponent-sdk/client/tranching";
const ix = market.ixDeposit({
user: wallet.publicKey,
trancheSide: TrancheSide.Junior,
amountIn: 1_000_000_000n, // raw SY units
minLpOut: 0n, // raw Junior LP units; set above 0 for output protection
tokenSrc: userSyTokenAccount,
tokenLpDst: userJuniorLpTokenAccount,
});
const tx = new Transaction().add(ix);
const signature = await sendAndConfirmTransaction(connection, tx, [wallet]);
Parameters
| Parameter | Type | Required | Description |
|---|
user | PublicKey | Yes | Wallet depositing SY |
trancheSide | TrancheSide | Yes | TrancheSide.Senior or TrancheSide.Junior |
amountIn | bigint | Yes | SY amount to deposit, in raw SY token units |
minLpOut | bigint | No | Minimum selected-tranche LP shares to receive, in raw LP units. Defaults to 0n |
tokenSrc | PublicKey | Yes | User SY token source account |
tokenLpDst | PublicKey | Yes | Destination token account for the selected LP mint |
tokenProgram | PublicKey | No | SPL Token program |
Behavior
The instruction:
- Syncs the market against the current SY exchange rate.
- Validates market state, pause flags, minimum deposit, and capacity.
- Transfers SY into the market escrow.
- Mints LP shares to
tokenLpDst.
Use ixWrapperDeposit if your user starts with the base asset instead of SY.