Skip to main content

Documentation Index

Fetch the complete documentation index at: https://v2-docs.exponent.finance/llms.txt

Use this file to discover all available pages before exploring further.

TypeScript Orderbook Instructions

These are the instruction builders provided by the Orderbook class. They handle account resolution, address lookup tables, base token conversion, and CPI routing automatically.
For low-level control, see the raw Codama-generated instructions if you want to work directly with the generated instruction layer and resolve accounts manually.

Installation

npm install @exponent-labs/exponent-sdk @solana/web3.js
All instructions are methods on the Orderbook class:
import { Orderbook } from "@exponent-labs/exponent-sdk";

// Load an orderbook
const orderbook = await Orderbook.load(env, connection, orderbookAddress);

// Use instructions
const { ix, setupIxs } = await orderbook.ixWrapperPostOffer({...});

Instructions

Post Order

Place a limit order on the orderbook, with wrapper helpers that handle token account setup and account resolution automatically.

Market Order

Execute immediately against existing liquidity on the book, with support for slippage bounds and wrapper account setup.

Remove Order

Cancel an existing open order and return the locked trading balances to your escrow state.

Collect Interest

Claim accrued yield on YT held through open or previously filled orderbook positions.

Withdraw Funds

Withdraw PT, YT, and SY balances from your orderbook escrow back to your wallet.