Use these helpers to derive market PDAs and user LP token accounts.
Market addresses
const seedId = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]);
const derived = TranchingMarket.deriveAddresses(seedId);
console.log("Market:", derived.market.toBase58());
console.log("Return model storage:", derived.returnModelStorage.toBase58());
console.log("SY escrow:", derived.tokenSyEscrow.toBase58());
console.log("Senior LP mint:", derived.mintLpSenior.toBase58());
console.log("Junior LP mint:", derived.mintLpJunior.toBase58());
| Field | Description |
|---|
market | Main ExponentTranchingMarket PDA |
returnModelStorage | PDA account storing the active return model |
tokenSyEscrow | Market-owned SY escrow |
mintLpSenior | Senior LP token mint |
mintLpJunior | Junior LP token mint |
Loaded market addresses
console.log("SY mint:", market.syMint.toBase58());
console.log("SY program:", market.syProgram.toBase58());
console.log("Senior LP mint:", market.mintLpSenior.toBase58());
console.log("Junior LP mint:", market.mintLpJunior.toBase58());
console.log("SY escrow:", market.tokenSyEscrow.toBase58());
console.log("Base mint:", market.mintBase.toBase58());
| Getter | Returns | Description |
|---|
syMint | PublicKey | SY token mint backing the market |
syProgram | PublicKey | Linked SY program |
mintLpSenior | PublicKey | Senior LP mint |
mintLpJunior | PublicKey | Junior LP mint |
tokenSyEscrow | PublicKey | Market SY escrow |
mintBase | PublicKey | Underlying base asset mint exposed by the market flavor |
currentSyExchangeRate | number | Current exchange rate from the loaded SY flavor |
User LP accounts
import { TrancheSide } from "@exponent-labs/exponent-sdk/client/tranching";
const seniorLpAta = market.lpAta(TrancheSide.Senior, wallet.publicKey);
const juniorLpAta = market.lpAta(TrancheSide.Junior, wallet.publicKey);
console.log("Senior LP ATA:", seniorLpAta.toBase58());
console.log("Junior LP ATA:", juniorLpAta.toBase58());
| Function | Description |
|---|
lpMint(trancheSide) | Returns the LP mint for Senior or Junior |
lpAta(trancheSide, owner) | Returns the owner’s associated token account for the selected LP mint |
The wrapper deposit and withdraw methods create these associated token accounts idempotently through setupIxs.