Skip to main content
The ixDepositLiquidity method on the MarketThree class creates a new LP position by depositing PT and SY tokens within a specified APY range.
This is a low-level method that requires you to already hold PT and SY tokens. To provide liquidity from base assets (e.g., USDC), use ixWrapperProvideLiquidity or ixProvideLiquidityClassic instead.

Usage

import { MarketThree, LOCAL_ENV } from "@exponent-labs/exponent-sdk";
import { Connection, PublicKey, Transaction, sendAndConfirmTransaction } from "@solana/web3.js";

const connection = new Connection("https://api.mainnet-beta.solana.com");
const market = await MarketThree.load(LOCAL_ENV, connection, marketAddress);

const { ix, signers } = market.ixDepositLiquidity({
  depositor: wallet.publicKey,
  ptInIntent: 5_000_000_000n,   // max PT to deposit
  syInIntent: 5_000_000_000n,   // max SY to deposit
  lowerTickKey: 0.05,           // 5% APY lower bound
  upperTickKey: 0.15,           // 15% APY upper bound
});

const tx = new Transaction().add(ix);
await sendAndConfirmTransaction(connection, tx, [wallet, signers]);
The signers value is the generated LP position keypair. You must include it when signing the transaction, otherwise the transaction will fail.
The lowerTickKey and upperTickKey parameters are decimal numbers — use 0.05 for 5% APY, not 500 or 50000.

Required Parameters

ParameterTypeDescription
depositorPublicKeyThe depositor’s wallet public key
ptInIntentbigintMaximum amount of PT to deposit
syInIntentbigintMaximum amount of SY to deposit
lowerTickKeynumberLower bound APY for the liquidity range
upperTickKeynumberUpper bound APY for the liquidity range

Optional Parameters

ParameterTypeDescription
ptSrcPublicKeySource PT token account. Defaults to depositor’s ATA
sySrcPublicKeySource SY token account. Defaults to depositor’s ATA
lpPositionKeypairLP position keypair. Defaults to a generated Keypair

Returns

Returns an object with:
  • ix — The TransactionInstruction that deposits liquidity
  • signers — The LP position Keypair (must be included when signing)