The ixDepositLiquidity method on the MarketThree class creates a new LP position by depositing PT and SY tokens within a specified APY range.
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
| Parameter | Type | Description |
|---|
depositor | PublicKey | The depositor’s wallet public key |
ptInIntent | bigint | Maximum amount of PT to deposit |
syInIntent | bigint | Maximum amount of SY to deposit |
lowerTickKey | number | Lower bound APY for the liquidity range |
upperTickKey | number | Upper bound APY for the liquidity range |
Optional Parameters
| Parameter | Type | Description |
|---|
ptSrc | PublicKey | Source PT token account. Defaults to depositor’s ATA |
sySrc | PublicKey | Source SY token account. Defaults to depositor’s ATA |
lpPosition | Keypair | LP 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)