Skip to main content
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());
FieldDescription
marketMain ExponentTranchingMarket PDA
returnModelStoragePDA account storing the active return model
tokenSyEscrowMarket-owned SY escrow
mintLpSeniorSenior LP token mint
mintLpJuniorJunior 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());
GetterReturnsDescription
syMintPublicKeySY token mint backing the market
syProgramPublicKeyLinked SY program
mintLpSeniorPublicKeySenior LP mint
mintLpJuniorPublicKeyJunior LP mint
tokenSyEscrowPublicKeyMarket SY escrow
mintBasePublicKeyUnderlying base asset mint exposed by the market flavor
currentSyExchangeRatenumberCurrent 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());
FunctionDescription
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.