@1delta/margin-fetcher-sol 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -0
- package/dist/index.d.mts +718 -34
- package/dist/index.d.ts +718 -34
- package/dist/index.js +2835 -776
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2782 -745
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# @1delta/margin-fetcher-sol
|
|
2
|
+
|
|
3
|
+
> **Moved from `lending-sdks-sol/packages/lending` on 2026-10-02.** Paths are
|
|
4
|
+
> relative to this package; the prototype's `@1delta/sol-*` names map to
|
|
5
|
+
> `@1delta/margin-fetcher-sol`, `margin-fetcher-sol`, `svm-kit`.
|
|
6
|
+
|
|
7
|
+
Lending data provision for Solana venues in the `margin-fetcher` shape — public
|
|
8
|
+
market rows, user positions, oracle prices, term sheets. Kamino is the first
|
|
9
|
+
family, Jupiter Lend the second, Save (ex-Solend) the third, Loopscale (a
|
|
10
|
+
fixed-rate credit order book — Morpho Midnight's product on Solana) the fourth.
|
|
11
|
+
See [KAMINO_LENDING_PLAN.md](../../KAMINO_LENDING_PLAN.md) for the
|
|
12
|
+
route-by-route mapping and the declared gaps,
|
|
13
|
+
[JUPITER_LEND.md](../../JUPITER_LEND.md),
|
|
14
|
+
[SAVE_FINANCE.md](../../SAVE_FINANCE.md) and
|
|
15
|
+
[LOOPSCALE_PLAN.md](../../LOOPSCALE_PLAN.md) for the other three.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import {
|
|
19
|
+
fetchExponentPtMarkets,
|
|
20
|
+
fetchJupiterLendEarnVaults,
|
|
21
|
+
fetchSolsticeVaults,
|
|
22
|
+
fetchSolsticeUser,
|
|
23
|
+
fetchKaminoPublic,
|
|
24
|
+
fetchKaminoUser,
|
|
25
|
+
fetchKaminoOraclePrices,
|
|
26
|
+
fetchSavePublic,
|
|
27
|
+
fetchSaveUser,
|
|
28
|
+
fetchLoopscalePublic,
|
|
29
|
+
fetchLoopscaleUser,
|
|
30
|
+
fetchLoopscaleEarnVaults,
|
|
31
|
+
} from '@1delta/margin-fetcher-sol'
|
|
32
|
+
|
|
33
|
+
const markets = await fetchKaminoPublic() // { 'KAMINO_<market>': { data, eModes, chainId } }
|
|
34
|
+
const user = await fetchKaminoUser('<base58 wallet>') // LenderUserResponse[] (one per served market)
|
|
35
|
+
const prices = await fetchKaminoOraclePrices(tokenList) // { byMint, byAssetGroup, asOf }
|
|
36
|
+
|
|
37
|
+
// Save: one key per team-run pool, rates RECOMPUTED from reserve state; positions
|
|
38
|
+
// DERIVED on-chain (obligation #0..#2 per pool, one pooled read, live valuation).
|
|
39
|
+
const save = await fetchSavePublic() // { 'SAVE_<market>': { data, params: { saveMarket } } }
|
|
40
|
+
const savePos = await fetchSaveUser('<base58 wallet>') // { lendingPositions, ext: { obligations, probed } }
|
|
41
|
+
|
|
42
|
+
// Loopscale: one key per (principal, collateral) PAIR — an isolated x-margin
|
|
43
|
+
// basket of two legs — with the fixed-rate tenor menu (1d/1w/1m/3m ladders)
|
|
44
|
+
// on params.loopscaleMarket.terms[]; ~180 paced quotes (2/s, the route's
|
|
45
|
+
// per-IP limit) + one Mint read per collateral the list does not name.
|
|
46
|
+
const ls = await fetchLoopscalePublic({ tokenList }) // { 'LOOPSCALE_<principal>_<collateral>': { data, params: { loopscaleMarket } } }
|
|
47
|
+
const lsPos = await fetchLoopscaleUser('<base58 wallet>', { decimals }) // every Loan account: ledgers, slots, health to maturity
|
|
48
|
+
const lsVaults = await fetchLoopscaleEarnVaults({ tokenList }) // the curated vaults as earn rows
|
|
49
|
+
|
|
50
|
+
// Earn rows: Jupiter Lend jl tokens (the Fluid `FluidFToken` shape) and
|
|
51
|
+
// Exponent PTs (the Pendle `PendlePtMarket` shape — EXPONENT.md).
|
|
52
|
+
const jl = await fetchJupiterLendEarnVaults({ tokenList })
|
|
53
|
+
const pts = await fetchExponentPtMarkets({ tokenList }) // live vaults only; quote assets priced through Jupiter
|
|
54
|
+
|
|
55
|
+
// Solstice: eUSX + the strcUSX tranches as 4626-shaped rows read from the
|
|
56
|
+
// chain (SOLSTICE.md) — the vested exchange rate, the exit each one has,
|
|
57
|
+
// the oracle the strategy gates on; and a wallet's holdings + pending exits.
|
|
58
|
+
const sol = await fetchSolsticeVaults({ tokenList }) // { [shareMint]: SolsticeVault }
|
|
59
|
+
const mine = await fetchSolsticeUser('<base58 wallet>', { vaults: sol })
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- `pnpm test` — unit tests on a captured fixture, no network
|
|
63
|
+
- `pnpm test:live` — shape pins against `api.kamino.finance`
|