Skip to main content
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

ParameterTypeRequiredDescription
userPublicKeyYesWallet depositing SY
trancheSideTrancheSideYesTrancheSide.Senior or TrancheSide.Junior
amountInbigintYesSY amount to deposit, in raw SY token units
minLpOutbigintNoMinimum selected-tranche LP shares to receive, in raw LP units. Defaults to 0n
tokenSrcPublicKeyYesUser SY token source account
tokenLpDstPublicKeyYesDestination token account for the selected LP mint
tokenProgramPublicKeyNoSPL Token program

Behavior

The instruction:
  1. Syncs the market against the current SY exchange rate.
  2. Validates market state, pause flags, minimum deposit, and capacity.
  3. Transfers SY into the market escrow.
  4. Mints LP shares to tokenLpDst.
Use ixWrapperDeposit if your user starts with the base asset instead of SY.