@1delta/margin-fetcher-sol
Moved from
lending-sdks-sol/packages/lendingon 2026-10-02. Paths are relative to this package; the prototype's@1delta/sol-*names map to@1delta/margin-fetcher-sol,margin-fetcher-sol,svm-kit.
Lending data provision for Solana venues in the margin-fetcher shape — public
market rows, user positions, oracle prices, term sheets. Kamino is the first
family, Jupiter Lend the second, Save (ex-Solend) the third, Loopscale (a
fixed-rate credit order book — Morpho Midnight's product on Solana) the fourth.
See KAMINO_LENDING_PLAN.md for the
route-by-route mapping and the declared gaps,
JUPITER_LEND.md,
SAVE_FINANCE.md and
LOOPSCALE_PLAN.md for the other three.
import {
fetchExponentPtMarkets,
fetchJupiterLendEarnVaults,
fetchSolsticeVaults,
fetchSolsticeUser,
fetchKaminoPublic,
fetchKaminoUser,
fetchKaminoOraclePrices,
fetchSavePublic,
fetchSaveUser,
fetchLoopscalePublic,
fetchLoopscaleUser,
fetchLoopscaleEarnVaults,
} from '@1delta/margin-fetcher-sol'
const markets = await fetchKaminoPublic() // { 'KAMINO_<market>': { data, eModes, chainId } }
const user = await fetchKaminoUser('<base58 wallet>') // LenderUserResponse[] (one per served market)
const prices = await fetchKaminoOraclePrices(tokenList) // { byMint, byAssetGroup, asOf }
// Save: one key per team-run pool, rates RECOMPUTED from reserve state; positions
// DERIVED on-chain (obligation #0..#2 per pool, one pooled read, live valuation).
const save = await fetchSavePublic() // { 'SAVE_<market>': { data, params: { saveMarket } } }
const savePos = await fetchSaveUser('<base58 wallet>') // { lendingPositions, ext: { obligations, probed } }
// Loopscale: one key per (principal, collateral) PAIR — an isolated x-margin
// basket of two legs — with the fixed-rate tenor menu (1d/1w/1m/3m ladders)
// on params.loopscaleMarket.terms[]; ~180 paced quotes (2/s, the route's
// per-IP limit) + one Mint read per collateral the list does not name.
const ls = await fetchLoopscalePublic({ tokenList }) // { 'LOOPSCALE_<principal>_<collateral>': { data, params: { loopscaleMarket } } }
const lsPos = await fetchLoopscaleUser('<base58 wallet>', { decimals }) // every Loan account: ledgers, slots, health to maturity
const lsVaults = await fetchLoopscaleEarnVaults({ tokenList }) // the curated vaults as earn rows
// Earn rows: Jupiter Lend jl tokens (the Fluid `FluidFToken` shape) and
// Exponent PTs (the Pendle `PendlePtMarket` shape — EXPONENT.md).
const jl = await fetchJupiterLendEarnVaults({ tokenList })
const pts = await fetchExponentPtMarkets({ tokenList }) // live vaults only; quote assets priced through Jupiter
// Solstice: eUSX + the strcUSX tranches as 4626-shaped rows read from the
// chain (SOLSTICE.md) — the vested exchange rate, the exit each one has,
// the oracle the strategy gates on; and a wallet's holdings + pending exits.
const sol = await fetchSolsticeVaults({ tokenList }) // { [shareMint]: SolsticeVault }
const mine = await fetchSolsticeUser('<base58 wallet>', { vaults: sol })
pnpm test— unit tests on a captured fixture, no networkpnpm test:live— shape pins againstapi.kamino.finance