@staccoverflow/offerbook-sdk
v0.1.2
Published
Isolated TypeScript client for the Jupiter Offerbook program (meme lending for launchpad coins). Pinned to anchor 0.30 — do NOT consume from pump's 0.29 graph.
Readme
@stacc/offerbook-sdk
Isolated TypeScript client for the Jupiter Offerbook program — the rail for meme lending on launchpad coins.
Offerbook is time-based P2P lending: no oracle, no price liquidation, lender
sets the terms. Crucially, the on-chain program
(offerbkFMvVfpQhL8ZQ5iromnjct5rz3r52B9ewu3ie) has no token allowlist — any
SPL / Token-2022 mint or NFT can be collateral or principal. The "verified
tokens, USDC-only quote" you see on offerbook.jup.ag is purely their frontend +
indexer curation. Drive the program directly and you can borrow/lend against any
coin minted on the launchpad.
Why a separate package
The pump launchpad pins @coral-xyz/[email protected], but the Offerbook IDL is the
Anchor 0.30+/Codama format (address + discriminator arrays). 0.29's
Program cannot parse it. This package pins anchor 0.30 and is isolated so
pump's graph is untouched. Do not import it into a 0.29 dependency tree.
Install & prove the unlock
cd pump/offerbook-sdk
pnpm install
pnpm demo:read # lists Offerbook offers/loans for stacSOL, straight from chain
# RPC=... MINT=<any mint> pnpm demo:readRead path (indexer)
const client = new OfferbookClient(new Connection(RPC));
const offers = await client.getOffersForCollateral(coinMint); // the per-coin book
const loans = await client.getLoansForCollateral(coinMint);
const config = await client.getConfig();Write path (offer creation)
import { createBorrowOfferIxs, createLendOfferIxs, cancelOfferIx } from "@stacc/offerbook-sdk";
// Borrow USDC against a meme coin you hold:
const ixs = await createBorrowOfferIxs(client, borrower, coinMint, {
principalAmount: 100_000000, // 100 USDC (raw, 6dp)
collateralAmount: 500_000000000,
apyBps: 2800, durationSecs: 7*86400, expirySecs: 86400,
});Status / next
- ✅ read path (offers, loans, config) + create/cancel offer instructions
- ⏳
fill_*/repay_token_loan/claim_token_loan(need counterparty accounts derived from the fetched offer/loan) — next slice, with the NestJSlendingindexer module inpump-v2-client-server.
Landmines
- One offer per wallet: the offer PDA seeds are
["offer", signer, signer_user], so a wallet has a single offer slot — cancel/fill before opening another. disable_repayment = 1in live config (decoded 2026-06-28). Verify repay semantics before wiring the repay flow.- Governance:
admincan pause + retune fees; program is upgradeable. Not trustless. - USDC-only is a product choice; the program accepts any principal mint, but non-USDC offers won't be surfaced/filled by anyone else's UI.
