@1delta/data-sdk 0.0.41 → 0.0.43

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.
@@ -0,0 +1,208 @@
1
+ /** Per-chain LlamaLend deployment seed (hand-maintained). */
2
+ export type LlamaLendConfigChain = {
3
+ /** v1 `OneWayLendingFactory` — parallel index getters. Absent on chains
4
+ * that only ever got v2. */
5
+ oneWayFactory?: string;
6
+ /** v2 `LendFactory` — struct-returning `markets(i)`; `version()` = `2.0.0`. */
7
+ lendFactory?: string;
8
+ /** v2 LendConfigurator (admin surface; carried for completeness). */
9
+ configurator?: string;
10
+ /**
11
+ * Curve's deployed v1 LeverageZap for this chain, and the aggregator router
12
+ * it is hard-wired to. THIS is how leverage works here — we do not deploy a
13
+ * callbacker.
14
+ *
15
+ * The zap's router is an IMMUTABLE with no allowlist, and `callback_bytes`
16
+ * is forwarded to it verbatim, so arbitrary aggregator calldata is already
17
+ * permitted. Two are deployed per chain (Odos and 1inch); pick whichever
18
+ * aggregator is quoting, and ALWAYS check the quote's target against
19
+ * `*Router` before encoding — the zap forwards mismatched calldata to the
20
+ * wrong contract rather than rejecting it.
21
+ */
22
+ leverageZapOdos?: string;
23
+ leverageZapOdosRouter?: string;
24
+ leverageZap1inch?: string;
25
+ leverageZap1inchRouter?: string;
26
+ /**
27
+ * Lowest `factoryIndex` the zaps accept — markets below it were deployed
28
+ * from a blueprint the zap does not recognise. 9 on Ethereum and Arbitrum,
29
+ * 0 on Optimism. This is a WIDER gate than delegation: 84.9% of borrows
30
+ * qualify, including markets that are not delegation-capable, because
31
+ * leverage is EOA-direct and needs no grant.
32
+ */
33
+ leverageStartId?: number;
34
+ /**
35
+ * The crvUSD mint (CDP) factory, when the chain's zap indexes it as
36
+ * `factoryId = 1`. Present on Ethereum only. Recorded because the SAME zap
37
+ * serves those markets — see LLAMALEND.md.
38
+ */
39
+ crvUsdFactory?: string;
40
+ /** Curve data API base. Overridable so a self-hosted indexer can be
41
+ * swapped in; the default serves every chain and both generations from
42
+ * one call. */
43
+ apiBaseUrl?: string | null;
44
+ /** The chain's slug in the Curve API's `blockchainId` field
45
+ * (`ethereum` / `optimism` / `arbitrum` / `fraxtal` / `sonic`). */
46
+ apiChainSlug?: string;
47
+ };
48
+ export type LlamaLendConfigType = {
49
+ [lender: string]: {
50
+ [chainId: string]: LlamaLendConfigChain;
51
+ };
52
+ };
53
+ /** One LlamaLend market (= one Controller). */
54
+ export type LlamaLendMarketConfig = {
55
+ /** Controller contract — also the per-market key suffix
56
+ * (`LLAMALEND_<CONTROLLER_ADDR>`). */
57
+ controller: string;
58
+ /** ERC-4626 vault — the lender side. TRAP: shares run ~1000x the asset
59
+ * scale (`DEAD_SHARES`), so never assume 1:1. */
60
+ vault: string;
61
+ /** LLAMMA. MUST be excluded from any leverage swap route — the Controller
62
+ * asserts the AMM's band state is unchanged across a callback. */
63
+ amm: string;
64
+ collateralToken: string;
65
+ collateralDecimals: number;
66
+ collateralSymbol?: string;
67
+ borrowedToken: string;
68
+ borrowedDecimals: number;
69
+ borrowedSymbol?: string;
70
+ monetaryPolicy: string;
71
+ priceOracle?: string;
72
+ /** 1 = `oneway` (v1, `*_extended` leverage), 2 = `oneway-v2` (v2, callbacker
73
+ * folded into the base functions). Branch every encoder on this. */
74
+ version: 1 | 2;
75
+ /**
76
+ * Whether this Controller carries the boolean delegation grant
77
+ * (`approve(spender, allow)` + `_for` on the writes).
78
+ *
79
+ * PER-MARKET, not per-protocol: only newer-blueprint controllers have it
80
+ * (48 of 98 markets at 2026-08, and 0 of 22 on Arbitrum). Derived by the
81
+ * metadata generator from a runtime-bytecode selector scan, because an
82
+ * `eth_call` probe cannot distinguish "no such method" from a node hiccup
83
+ * on most public RPCs. FAIL CLOSED — treat `undefined` as `false`.
84
+ */
85
+ supportsDelegation: boolean;
86
+ /** Band-geometry parameter `A` from the AMM. With `loanDiscount` and the
87
+ * chosen `N` this fixes the effective collateral factor. */
88
+ ammA: string;
89
+ /** WAD haircut used when sizing a loan. */
90
+ loanDiscount: string;
91
+ /** WAD hard-liquidation bonus (applies only BELOW the whole band range —
92
+ * inside it the position soft-liquidates with no penalty). */
93
+ liquidationDiscount: string;
94
+ /**
95
+ * The market's index in its factory — `controllers(i)`. Doubles as the
96
+ * `controller_id` the leverage zap's `callback_args` requires, so it is
97
+ * mandatory for any leveraged encode. The Curve API exposes it as the
98
+ * numeric suffix of `id` (`oneway-41`).
99
+ */
100
+ factoryIndex: number;
101
+ /**
102
+ * Whether Curve's v1 leverage zap accepts this market
103
+ * (`factoryIndex >= leverageStartId`, and v1 only — v2 markets live in a
104
+ * factory the zap does not index). Independent of `supportsDelegation`.
105
+ */
106
+ supportsLeverage: boolean;
107
+ /** Band count offered by default in the UI (Curve's own default is 10).
108
+ * There is no single LTV — the collateral factor is a function of N — so
109
+ * public data reports `collateralFactor` at this N and exposes the rest
110
+ * of the curve alongside. */
111
+ defaultBands?: number;
112
+ /** Monetary-policy family: `semilog` (v1) or `hyperbolic` (v2). The
113
+ * `hyperbolic-dynamic` variant pulls its target rate from an external
114
+ * rate calculator tracking a yield-bearing asset, so its curve moves
115
+ * under a cache — never serve it from stale params. */
116
+ rateModel?: 'semilog' | 'hyperbolic' | 'hyperbolic-dynamic';
117
+ /** Gauge (CRV emissions on the vault side), v1 only. */
118
+ gauge?: string | null;
119
+ /** v2 only: 0 DISABLES borrowing. A fresh v2 market looks live but is not. */
120
+ borrowCap?: string;
121
+ name?: string;
122
+ };
123
+ /** Generated per-chain data: the curated market roster. */
124
+ export type LlamaLendChainData = {
125
+ markets: LlamaLendMarketConfig[];
126
+ };
127
+ export type LlamaLendMarketsType = {
128
+ [lender: string]: {
129
+ [chainId: string]: LlamaLendChainData;
130
+ };
131
+ };
132
+ export declare const llamaLendConfig: () => LlamaLendConfigType;
133
+ /** Deployment seed for one LlamaLend lender on a chain (undefined if unloaded). */
134
+ export declare const llamaLendConfigFor: (lender: string, chainId: string | number) => LlamaLendConfigChain | undefined;
135
+ export declare const llamaLendMarkets: () => LlamaLendMarketsType;
136
+ /** Generated chain data (curated market roster; undefined if unloaded). */
137
+ export declare const llamaLendChainData: (lender: string, chainId: string | number) => LlamaLendChainData | undefined;
138
+ /** Find one LlamaLend market by its Controller address. */
139
+ export declare const llamaLendMarketByController: (lender: string, chainId: string | number, controller: string) => LlamaLendMarketConfig | undefined;
140
+ /**
141
+ * Find one LlamaLend market by its ERC-4626 VAULT address (the lender side).
142
+ *
143
+ * The roster is keyed on the Controller because that is the borrow surface,
144
+ * but other protocols reference LlamaLend by its vault — Resupply, for
145
+ * instance, custodies the vault SHARE as collateral, so the vault is the only
146
+ * handle it exposes. This is the join for "which LlamaLend market does that
147
+ * wrapper actually sit on top of".
148
+ */
149
+ export declare const llamaLendMarketByVault: (lender: string, chainId: string | number, vault: string) => LlamaLendMarketConfig | undefined;
150
+ /**
151
+ * All LlamaLend lender keys with config on a chain (drives getLendersForChain).
152
+ * Gated on a factory being present — a chain entry with neither factory is a
153
+ * placeholder, not a live deployment.
154
+ */
155
+ export declare const llamaLendLendersByChain: (chainId: string | number) => string[];
156
+ /**
157
+ * Whether a LlamaLend market accepts on-behalf calls (`_for` + the boolean
158
+ * `approve` grant). FAILS CLOSED: an unknown market, an unloaded roster or an
159
+ * explicit `false` all return `false`, because calling `approve` on an older
160
+ * controller reverts with no usable reason string.
161
+ */
162
+ export declare const llamaLendSupportsDelegation: (lender: string, chainId: string | number, controller: string) => boolean;
163
+ /**
164
+ * Resolve the leverage zap + its hard-wired router for a chain and aggregator.
165
+ * `undefined` means leverage is unavailable there for that aggregator, which
166
+ * callers must report rather than silently falling back — there is no Composer
167
+ * route that can be funded.
168
+ */
169
+ export declare const llamaLendLeverageZap: (lender: string, chainId: string | number, aggregator: "odos" | "1inch") => {
170
+ zap: string;
171
+ router: string;
172
+ } | undefined;
173
+ /**
174
+ * Whether a market can be leveraged at all: it must be v1, at or above the
175
+ * chain's `leverageStartId`, and the chain must have a zap deployed. Fails
176
+ * closed on an unknown market.
177
+ */
178
+ export declare const llamaLendSupportsLeverage: (lender: string, chainId: string | number, controller: string) => boolean;
179
+ /**
180
+ * Curve data API base. Read through the getter (not a module constant) for the
181
+ * same reason as TermMax/Midnight: the per-request metadata re-init rewrites
182
+ * `llamaLendConfig`, so a captured value goes stale.
183
+ */
184
+ export declare const llamaLendApiBaseUrl: (lender: string, chainId: string | number) => string;
185
+ /**
186
+ * Per-market lender key for one LlamaLend market, keyed by its CONTROLLER (the
187
+ * borrow-side contract), not the vault — the Controller is what every write
188
+ * and every user read targets.
189
+ *
190
+ * Format: `LLAMALEND_${controllerAddr.slice(2).toUpperCase()}`
191
+ *
192
+ * Both generations share this key space deliberately: they are one brand to the
193
+ * user, and the Curve API returns them in one list. The `version` field on the
194
+ * market row is what encoders branch on. chainId is intentionally NOT in the
195
+ * token (chain scoping happens at the marketUid level), matching every other
196
+ * per-market key in this package.
197
+ *
198
+ * `isLlamaLend()` works on this because it matches `startsWith('LLAMALEND')`.
199
+ */
200
+ export declare function llamaLendLenderKey(controller: string): string;
201
+ /**
202
+ * Inverse of `llamaLendLenderKey`: given a per-market lender key, return
203
+ * `{ controllerAddrLower }`. Returns `undefined` if the key isn't a per-market
204
+ * LlamaLend key (e.g. someone passed the bare prefix `LLAMALEND`).
205
+ */
206
+ export declare function parseLlamaLendLenderKey(lenderKey: string): {
207
+ controllerAddrLower: string;
208
+ } | undefined;
@@ -0,0 +1,72 @@
1
+ /** Per-chain Midnight deployment addresses + HTTP API endpoint. */
2
+ export type MidnightConfigChain = {
3
+ /** Core Midnight contract. */
4
+ midnight: string;
5
+ /** MidnightBundlesV1 periphery (spot supply/borrow/repay bundles). */
6
+ midnightBundles: string;
7
+ /** On-chain mempool log contract where signed offers are published. */
8
+ midnightMempool: string;
9
+ ecrecoverRatifier?: string | null;
10
+ ecrecoverAuthorizer?: string | null;
11
+ setterRatifier?: string | null;
12
+ /** Midnight HTTP API base for book/quote/offer data (defaults to Morpho hosted). */
13
+ apiBaseUrl?: string | null;
14
+ };
15
+ export type MidnightConfigType = {
16
+ [chainId: string]: MidnightConfigChain;
17
+ };
18
+ /** One collateral leg of a Midnight market (mirrors on-chain CollateralParams). */
19
+ export type MidnightCollateralParam = {
20
+ token: string;
21
+ /** WAD-scaled liquidation LTV (as string). */
22
+ lltv: string;
23
+ /** WAD-scaled liquidation cursor (as string). */
24
+ liquidationCursor: string;
25
+ oracle: string;
26
+ decimals: number;
27
+ };
28
+ /** A Midnight market: full struct params needed to build calls + read state. */
29
+ export type MidnightMarketConfig = {
30
+ /** bytes32 market id (IdLib hash of the Market struct). */
31
+ marketId: string;
32
+ loanToken: string;
33
+ loanDecimals: number;
34
+ /** Ordered collateral legs; index = the on-chain `collateralIndex`. */
35
+ collateralParams: MidnightCollateralParam[];
36
+ /** Maturity, unix seconds (as string). */
37
+ maturity: string;
38
+ /** Recovery-close-factor threshold (WAD, as string). */
39
+ rcfThreshold: string;
40
+ enterGate: string;
41
+ liquidatorGate: string;
42
+ /**
43
+ * Mutable per-market settlement fees, one per TTM breakpoint index
44
+ * [0d,1d,7d,30d,90d,180d,360d], in cbp (centi-basis-points; fraction =
45
+ * cbp·1e-6). Governance-settable (`feeSetter`), so it is NOT part of the
46
+ * immutable market id and is snapshotted on-chain each metadata refresh.
47
+ * Absent when the on-chain read was unavailable.
48
+ */
49
+ settlementFeeCbp?: number[];
50
+ /**
51
+ * Mutable per-market continuous fee (uint32), a per-second WAD rate borne by
52
+ * lenders (annual fraction = continuousFee·secondsPerYear/1e18, capped 1%/yr).
53
+ * Governance-settable; snapshotted on-chain like `settlementFeeCbp`. Stored
54
+ * as a decimal string. Absent when the on-chain read was unavailable.
55
+ */
56
+ continuousFee?: string;
57
+ /** Optional display label, e.g. "USDC / WETH — 2026-09-18". */
58
+ name?: string;
59
+ };
60
+ export type MidnightMarketsType = {
61
+ [chainId: string]: MidnightMarketConfig[];
62
+ };
63
+ export declare const midnightConfig: () => MidnightConfigType;
64
+ export declare const setMidnightApiBase: (url: string | undefined | null) => void;
65
+ export declare const midnightApiBaseOverride: () => string | undefined;
66
+ /** Resolve the Midnight API base for a chain: override → config → hosted default. */
67
+ export declare const resolveMidnightApiBase: (chainId: string) => string;
68
+ export declare const midnightMarkets: () => MidnightMarketsType;
69
+ /** All Midnight market configs on a chain (empty array if none/unloaded). */
70
+ export declare const midnightMarketsByChain: (chainId: string | number) => MidnightMarketConfig[];
71
+ /** Look up one Midnight market config by its bytes32 id (case-insensitive). */
72
+ export declare const midnightMarketById: (chainId: string | number, marketId: string) => MidnightMarketConfig | undefined;
@@ -0,0 +1,72 @@
1
+ export type MorphoPoolsType = {
2
+ [fork: string]: {
3
+ [chainId: string]: string;
4
+ };
5
+ };
6
+ export type MorphoBundler3ChainConfig = {
7
+ bundler3: string;
8
+ generalAdapter1: string;
9
+ paraswapAdapter?: string | null;
10
+ erc20WrapperAdapter?: string | null;
11
+ compoundV2MigrationAdapter?: string | null;
12
+ compoundV3MigrationAdapter?: string | null;
13
+ aaveV2MigrationAdapter?: string | null;
14
+ aaveV3CoreMigrationAdapter?: string | null;
15
+ aaveV3PrimeMigrationAdapter?: string | null;
16
+ aaveV3EtherFiMigrationAdapter?: string | null;
17
+ aaveV3OptimizerMigrationAdapter?: string | null;
18
+ };
19
+ export type MorphoBundler3Type = {
20
+ [chainId: string]: MorphoBundler3ChainConfig;
21
+ };
22
+ /** NB: the `Mropho` spelling is a long-standing typo kept for compatibility. */
23
+ export interface MrophoOracleInfo {
24
+ oracle: string;
25
+ loanAsset: string;
26
+ collateralAsset: string;
27
+ loanAssetDecimals: number;
28
+ collateralAssetDecimals: number;
29
+ }
30
+ export type MorphoOracles = {
31
+ [c: string]: MrophoOracleInfo[];
32
+ };
33
+ export type MorphoTypeOracles = {
34
+ [chainId: string]: {
35
+ [protocol: string]: MrophoOracleInfo[];
36
+ };
37
+ };
38
+ export type MorphoTypeMarkets = {
39
+ [protocol: string]: {
40
+ [chainId: string]: string[];
41
+ };
42
+ };
43
+ /**
44
+ * Static MetaMorpho-shaped vault registry, keyed by curator-protocol then chain.
45
+ * Sourced from `data/morpho-type-vaults.json` in `lender-metadata`. Used by the
46
+ * on-chain `fetchMorphoVaultsFromChain` path for forks / chains where the
47
+ * Morpho public API or Goldsky subgraph isn't available.
48
+ */
49
+ export type MorphoTypeVaultEntry = {
50
+ /** Lowercased vault (share-token) contract address. */
51
+ vault: string;
52
+ /** Lowercased underlying ERC20 address. */
53
+ underlying: string;
54
+ /** Curated display name (e.g. `Lista USD1 Vault`). Optional. */
55
+ name?: string;
56
+ /** Vault interface version. `v1` = MetaMorpho (withdraw-queue → markets);
57
+ * `v2` = Vaults V2 (adapter-based). Drives the on-chain fetcher's
58
+ * allocation walk. Absent ⇒ the fetcher auto-detects on-chain
59
+ * (`adaptersLength()` present ⇒ v2). */
60
+ version?: 'v1' | 'v2';
61
+ };
62
+ export type MorphoTypeVaultsType = {
63
+ [protocol: string]: {
64
+ [chainId: string]: MorphoTypeVaultEntry[];
65
+ };
66
+ };
67
+ export declare const morphoPools: () => MorphoPoolsType;
68
+ export declare const morphoOracles: () => MorphoOracles;
69
+ export declare const morphoTypeOracles: () => MorphoTypeOracles;
70
+ export declare const morphoTypeMarkets: () => MorphoTypeMarkets;
71
+ export declare const morphoTypeVaults: () => MorphoTypeVaultsType;
72
+ export declare const morphoBundler3: () => MorphoBundler3Type;
@@ -0,0 +1,140 @@
1
+ /**
2
+ * The global lender-data registry — the one piece of mutable state in this
3
+ * package.
4
+ *
5
+ * Every getter in `src/lending/*` reads through `getGlobalData()`, and
6
+ * `initializeLenderData` is the only writer. State lives on `globalThis` (not a
7
+ * module-level `let`) so that several copies of the package — a worker bundling
8
+ * its own instance, a transitive dependency pulling a second one — still share
9
+ * one registry.
10
+ *
11
+ * IMPORTANT: this module must have **no runtime imports**. Every per-lender
12
+ * module imports `getGlobalData` from here, so a value import in the other
13
+ * direction would create a cycle. The type imports below are `import type` and
14
+ * are erased at compile time.
15
+ *
16
+ * ADDING A LENDER: create `src/lending/<lender>.ts` (types + getters), then
17
+ * touch this file twice — one line in `GlobalLenderDataRegistry` and one line
18
+ * in `LENDER_DATA_DEFAULTS`. Nothing else: the `initializeLenderData` parameter
19
+ * type and its assignment loop are both derived from those two.
20
+ */
21
+ import type { AaveOraclesConfigType, AavePoolsType, AaveTokensType, AaveWethGatewayType } from './aave';
22
+ import type { AaveV4OraclesType, AaveV4PeripheralsType, AaveV4SpokesType } from './aaveV4';
23
+ import type { GeneralReservesMap, OracleMap } from './common';
24
+ import type { CompoundV2OraclesConfigType, CompoundV2PoolsType, CompoundV2TokenArrayType, CompoundV2TokensType } from './compoundV2';
25
+ import type { CompoundV3BaseDataType, CompoundV3BulkerType, CompoundV3OracleDataMap, CompoundV3PoolsType } from './compoundV3';
26
+ import type { CurvanceConfigType } from './curvance';
27
+ import type { DolomiteConfigsType, DolomiteEmodeType } from './dolomite';
28
+ import type { UsddConfigType, UsddMarketsType } from './dss';
29
+ import type { EulerConfigsType, EulerVaultsType } from './euler';
30
+ import type { ExactlyConfigType, ExactlyMarketsType } from './exactly';
31
+ import type { FluidResolversType, FluidVaultsType } from './fluid';
32
+ import type { FrankencoinConfigType, FrankencoinMarketsType } from './frankencoin';
33
+ import type { GearboxResolversType } from './gearbox';
34
+ import type { InitConfigType } from './initProtocol';
35
+ import type { InverseConfigType, InverseMarketsType } from './inverse';
36
+ import type { ListaNativeProviderType } from './lista';
37
+ import type { LiquityConfigType, LiquityMarketsType } from './liquity';
38
+ import type { LlamaLendConfigType, LlamaLendMarketsType } from './llamalend';
39
+ import type { MidnightConfigType, MidnightMarketsType } from './midnight';
40
+ import type { MorphoBundler3Type, MorphoOracles, MorphoPoolsType, MorphoTypeMarkets, MorphoTypeOracles, MorphoTypeVaultsType } from './morpho';
41
+ import type { FraxlendConfigType } from './fraxlend';
42
+ import type { ResupplyConfigType } from './resupply';
43
+ import type { RiverConfigType, RiverMarketsType } from './river';
44
+ import type { SiloMarketsType, SiloPeripheralsType } from './silo';
45
+ import type { TellerConfigType, TellerPoolsType } from './teller';
46
+ import type { TermConfigType, TermMarketsType } from './term';
47
+ import type { TermMaxConfigType } from './termMax';
48
+ /**
49
+ * Every data slot the registry holds, one group per lender family. A slot name
50
+ * is the getter name (`aaveTokens()` reads `aaveTokens`) and, suffixed with
51
+ * `Override`, the `initializeLenderData` argument that writes it.
52
+ */
53
+ export interface GlobalLenderDataRegistry {
54
+ aaveTokens: AaveTokensType;
55
+ aavePools: AavePoolsType;
56
+ aaveReserves: GeneralReservesMap;
57
+ aaveOracles: OracleMap;
58
+ aaveOraclesConfig: AaveOraclesConfigType;
59
+ aaveWethGateway: AaveWethGatewayType;
60
+ aaveV4Spokes: AaveV4SpokesType;
61
+ aaveV4Oracles: AaveV4OraclesType;
62
+ aaveV4Peripherals: AaveV4PeripheralsType;
63
+ compoundV2Pools: CompoundV2PoolsType;
64
+ compoundV2Tokens: CompoundV2TokensType;
65
+ compoundV2TokenArray: CompoundV2TokenArrayType;
66
+ compoundV2Reserves: GeneralReservesMap;
67
+ compoundV2Oracles: OracleMap;
68
+ compoundV2OraclesConfig: CompoundV2OraclesConfigType;
69
+ compoundV3Pools: CompoundV3PoolsType;
70
+ compoundV3BaseData: CompoundV3BaseDataType;
71
+ compoundV3Reserves: GeneralReservesMap;
72
+ compoundV3OraclesData: CompoundV3OracleDataMap;
73
+ compoundV3Bulker: CompoundV3BulkerType;
74
+ morphoPools: MorphoPoolsType;
75
+ morphoOracles: MorphoOracles;
76
+ morphoTypeOracles: MorphoTypeOracles;
77
+ morphoTypeMarkets: MorphoTypeMarkets;
78
+ morphoTypeVaults: MorphoTypeVaultsType;
79
+ morphoBundler3: MorphoBundler3Type;
80
+ initConfig: InitConfigType;
81
+ listaNativeProvider: ListaNativeProviderType;
82
+ midnightConfig: MidnightConfigType;
83
+ midnightMarkets: MidnightMarketsType;
84
+ termConfig: TermConfigType;
85
+ termMarkets: TermMarketsType;
86
+ termMaxConfig: TermMaxConfigType;
87
+ exactlyConfig: ExactlyConfigType;
88
+ exactlyMarkets: ExactlyMarketsType;
89
+ tellerConfig: TellerConfigType;
90
+ tellerPools: TellerPoolsType;
91
+ liquityConfig: LiquityConfigType;
92
+ liquityMarkets: LiquityMarketsType;
93
+ riverConfig: RiverConfigType;
94
+ riverMarkets: RiverMarketsType;
95
+ inverseConfig: InverseConfigType;
96
+ inverseMarkets: InverseMarketsType;
97
+ usddConfig: UsddConfigType;
98
+ usddMarkets: UsddMarketsType;
99
+ skyConfig: UsddConfigType;
100
+ skyMarkets: UsddMarketsType;
101
+ frankencoinConfig: FrankencoinConfigType;
102
+ frankencoinMarkets: FrankencoinMarketsType;
103
+ llamaLendConfig: LlamaLendConfigType;
104
+ llamaLendMarkets: LlamaLendMarketsType;
105
+ resupplyConfig: ResupplyConfigType;
106
+ curvanceConfig: CurvanceConfigType;
107
+ fraxlendConfig: FraxlendConfigType;
108
+ eulerConfigs: EulerConfigsType;
109
+ eulerVaults: EulerVaultsType;
110
+ dolomiteConfigs: DolomiteConfigsType;
111
+ dolomiteEmode: DolomiteEmodeType;
112
+ siloMarkets: SiloMarketsType;
113
+ siloPeripherals: SiloPeripheralsType;
114
+ siloMarketsV3: SiloMarketsType;
115
+ siloPeripheralsV3: SiloPeripheralsType;
116
+ fluidResolvers: FluidResolversType;
117
+ fluidVaults: FluidVaultsType;
118
+ gearboxResolvers: GearboxResolversType;
119
+ }
120
+ /**
121
+ * Read the registry. Internal to `src/lending` — consumers use the per-lender
122
+ * getters, which is where the shape is documented.
123
+ */
124
+ export declare function getGlobalData(): GlobalLenderDataRegistry;
125
+ /**
126
+ * Arguments of {@link initializeLenderData}: one optional `<slot>Override` per
127
+ * registry slot, derived from `GlobalLenderDataRegistry` so a new slot cannot
128
+ * be forgotten here.
129
+ */
130
+ export type LenderDataOverrides = {
131
+ [K in keyof GlobalLenderDataRegistry as `${K}Override`]?: GlobalLenderDataRegistry[K];
132
+ };
133
+ /**
134
+ * Override datas used in the SDK - works across all module instances.
135
+ *
136
+ * Each override REPLACES its slot wholesale (no merging); falsy/omitted
137
+ * overrides leave the current value untouched, so partial re-initialization is
138
+ * safe. `@1delta/initializer-sdk` is the usual caller.
139
+ */
140
+ export declare function initializeLenderData(overrides: LenderDataOverrides): void;
@@ -0,0 +1,77 @@
1
+ /** Per-chain, protocol-level (evergreen) Resupply addresses. */
2
+ export type ResupplyConfigChain = {
3
+ /** ResupplyRegistry — `getAllPairAddresses()` IS the market discovery, and
4
+ * `getAddress(key)` resolves every other singleton. */
5
+ registry: string;
6
+ /** reUSD — the only debt asset. */
7
+ reusd: string;
8
+ /** Utilities lens — `getPairInterestRate`, `getUnderlyingSupplyRate`,
9
+ * `getSwapRouteAmountOut`, `isSolventAfterLeverage`. Optional, but every
10
+ * rate and every leverage pre-flight is far cheaper with it. */
11
+ utilities?: string | null;
12
+ /** The built-in Curve `Swapper` — every leg for every pair is already
13
+ * registered on it, so a leverage route needs no aggregator at all. This
14
+ * is THE DEFAULT leverage swapper. */
15
+ curveSwapper?: string | null;
16
+ /** `RouterSwapper` wrapping the Enso router. Whitelisted on every pair, and
17
+ * it executes ARBITRARY router calldata packed into the `address[] path` —
18
+ * which is what makes aggregator-quoted looping possible at all. */
19
+ ensoSwapper?: string | null;
20
+ /** Same, wrapping the LI.FI Diamond. No LI.FI fetcher on our side yet. */
21
+ lifiSwapper?: string | null;
22
+ /** RedemptionHandler — the (communal) peg mechanism. Read-only for us. */
23
+ redemptionHandler?: string | null;
24
+ /** LiquidationHandler — liquidations are insurance-pool-funded, whole-position. */
25
+ liquidationHandler?: string | null;
26
+ /** InsurancePool — reUSD staked as first-loss capital. */
27
+ insurancePool?: string | null;
28
+ /** sreUSD — the savings leg (belongs to SAVINGS_REGISTRY; carried here for
29
+ * completeness so one config row describes the whole protocol). */
30
+ sreusd?: string | null;
31
+ /** PriceWatcher — supplies the off-peg weight the borrow rate is scaled by. */
32
+ priceWatcher?: string | null;
33
+ /** reUSD USD price feed (`PriceWatcher.oracle()`); its `price()` is 18-dec USD. */
34
+ reusdOracle?: string | null;
35
+ /** reUSD decimals (18). */
36
+ debtDecimals?: number;
37
+ /** Optional allowlist of pair addresses. When set, on-chain discovery is
38
+ * INTERSECTED with it; when absent (the default) every registered pair
39
+ * with a non-zero `borrowLimit` is published. */
40
+ pairAllowlist?: string[] | null;
41
+ };
42
+ export type ResupplyConfigType = {
43
+ [lender: string]: {
44
+ [chainId: string]: ResupplyConfigChain;
45
+ };
46
+ };
47
+ /**
48
+ * Built-in Ethereum deployment seed for Resupply.
49
+ *
50
+ * Every other lender's config comes exclusively from `lender-metadata`, and a
51
+ * published `config/resupply.json` still WINS over this (see
52
+ * `resupplyConfigFor`). The fallback exists because these are immutable
53
+ * protocol singletons — `RouterSwapper` even hardcodes the registry address in
54
+ * its own bytecode — and because the whole market roster is discovered from
55
+ * `registry` at runtime. So the integration is live with nothing to publish,
56
+ * and publishing later is a pure override.
57
+ *
58
+ * Verified on-chain 2026-08-04 (block ~25,683,400). Deliberately NOT taken
59
+ * from the docs' `faq/contract-addresses` page or the repo's
60
+ * `deployment/contracts.json`: both are stale and list a REVOKED Odos swapper.
61
+ * Resolved via `Registry.getAddress(key)` over `getAllKeys()`.
62
+ */
63
+ export declare const RESUPPLY_ETHEREUM_CONFIG: ResupplyConfigChain;
64
+ export declare const resupplyConfig: () => ResupplyConfigType;
65
+ /**
66
+ * Deployment seed for one Resupply lender on a chain. Published metadata wins;
67
+ * the built-in Ethereum row is the fallback so the provider works before
68
+ * `config/resupply.json` exists.
69
+ */
70
+ export declare const resupplyConfigFor: (lender: string, chainId: string | number) => ResupplyConfigChain | undefined;
71
+ /**
72
+ * All Resupply lender keys with config on a chain (drives getLendersForChain).
73
+ * Gated on the REGISTRY — the one address the whole provider is bootstrapped
74
+ * from. Union of published metadata and the built-in row, so the fan-out
75
+ * happens with or without a publish.
76
+ */
77
+ export declare const resupplyLendersByChain: (chainId: string | number) => string[];
@@ -0,0 +1,61 @@
1
+ /** Per-chain River deployment seed (hand-maintained). */
2
+ export type RiverConfigChain = {
3
+ /** SatoshiXApp — the EIP-2535 diamond ALL ops are called on. */
4
+ xapp: string;
5
+ /** The debt token (satUSD — a LayerZero OFT; address differs per chain). */
6
+ debtToken: string;
7
+ /** Debt token decimals (18 on every known deployment). */
8
+ debtDecimals?: number;
9
+ /** SatoshiPeriphery proxy (native wrap + OFT-send legs; optional, skippable). */
10
+ periphery?: string | null;
11
+ };
12
+ export type RiverConfigType = {
13
+ [lender: string]: {
14
+ [chainId: string]: RiverConfigChain;
15
+ };
16
+ };
17
+ /** One River market (= one TroveManager beacon proxy, one collateral). */
18
+ export type RiverMarketConfig = {
19
+ /** Factory index — also the per-market lender-key suffix (`RIVER_<index>`). */
20
+ index: number;
21
+ troveManager: string;
22
+ sortedTroves?: string;
23
+ collToken: string;
24
+ collDecimals: number;
25
+ /** WAD strings, snapshotted on-chain each refresh (owner-mutable params). */
26
+ mcr: string;
27
+ /** Protocol-set interest rate (raw; currently 0 everywhere). */
28
+ interestRate?: string;
29
+ /** Decaying-baseRate mint-fee bounds, WAD (floor 0.5%, cap 5% typical). */
30
+ borrowingFeeFloor?: string;
31
+ maxBorrowingFee?: string;
32
+ /** Per-market debt ceiling in debt-token units (owner-settable). */
33
+ maxSystemDebt?: string;
34
+ /** Debt-side gas compensation (2 satUSD typical) — minted on open, burned on close. */
35
+ debtGasCompensation?: string;
36
+ paused?: boolean;
37
+ sunsetting?: boolean;
38
+ /** Optional display label, e.g. "satUSD / WETH". */
39
+ name?: string;
40
+ };
41
+ /** Generated per-chain data: diamond-level params + the TroveManager list. */
42
+ export type RiverChainData = {
43
+ /** Diamond-level minimum net debt (owner-settable — refreshed each run). */
44
+ minNetDebt: string;
45
+ markets: RiverMarketConfig[];
46
+ };
47
+ export type RiverMarketsType = {
48
+ [lender: string]: {
49
+ [chainId: string]: RiverChainData;
50
+ };
51
+ };
52
+ export declare const riverConfig: () => RiverConfigType;
53
+ /** Deployment seed for one River lender on a chain (undefined if unloaded). */
54
+ export declare const riverConfigFor: (lender: string, chainId: string | number) => RiverConfigChain | undefined;
55
+ export declare const riverMarkets: () => RiverMarketsType;
56
+ /** Generated chain data (minNetDebt + TroveManager list; undefined if unloaded). */
57
+ export declare const riverChainData: (lender: string, chainId: string | number) => RiverChainData | undefined;
58
+ /** Look up one River market by its factory index (the per-market key suffix). */
59
+ export declare const riverMarketByIndex: (lender: string, chainId: string | number, index: number | string) => RiverMarketConfig | undefined;
60
+ /** All River lender keys with config on a chain (drives getLendersForChain). */
61
+ export declare const riverLendersByChain: (chainId: string | number) => string[];