Skip to main content
The MarketThree class exposes getter properties for reading onchain market state. After loading a market, you can access token mints, balances, configuration, and time-related parameters directly.

Usage

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

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

// Token mints
console.log("PT Mint:", market.mintPt.toBase58());
console.log("SY Mint:", market.mintSy.toBase58());
console.log("YT Mint:", market.mintYt.toBase58());

// Market balances
console.log("PT Balance:", market.ptBalance);
console.log("SY Balance:", market.syBalance);
console.log("LP Balance:", market.lpBalance);

// Time and rate
console.log("SY Exchange Rate:", market.currentSyExchangeRate);
console.log("Seconds Remaining:", market.secondsRemaining);

// Status
console.log("Status Flags:", market.statusFlags);

Getter Properties

PropertyTypeDescription
mintPtPublicKeyPT token mint address
mintSyPublicKeySY token mint address
mintYtPublicKeyYT token mint address
ptBalancebigintPT tokens held in the market
syBalancebigintSY tokens held in the market
lpBalancebigintTotal LP token supply
currentSyExchangeRatenumberCurrent SY exchange rate from the underlying yield source
secondsRemainingnumberSeconds until market expiration
statusFlagsnumberBitmask of enabled operations

Nested State Properties

For deeper state access, use market.state:
// Financial parameters
const expiration = market.state.financials.expirationTs;

// Configuration
const tickSpace = market.state.configurationOptions.tickSpace;
const feeRateRoot = market.state.configurationOptions.lnFeeRateRoot;
const treasuryFeeBps = market.state.configurationOptions.treasuryFeeBps;
Call await market.reload() to refresh the market state from onchain data before reading properties.