@1delta/data-sdk 0.0.21 → 0.0.22
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/dist/index.js +69 -2
- package/dist/index.mjs +60 -3
- package/dist/lending.d.ts +134 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -41,7 +41,11 @@ globalThis[GLOBAL_LENDER_DATA_KEY] = {
|
|
|
41
41
|
eulerVaults: {},
|
|
42
42
|
aaveV4Spokes: {},
|
|
43
43
|
aaveV4Oracles: {},
|
|
44
|
-
aaveV4Peripherals: {}
|
|
44
|
+
aaveV4Peripherals: {},
|
|
45
|
+
siloMarkets: {},
|
|
46
|
+
siloPeripherals: {},
|
|
47
|
+
siloMarketsV3: {},
|
|
48
|
+
siloPeripheralsV3: {}
|
|
45
49
|
};
|
|
46
50
|
function getGlobalData2() {
|
|
47
51
|
return globalThis[GLOBAL_LENDER_DATA_KEY];
|
|
@@ -74,7 +78,11 @@ function initializeLenderData({
|
|
|
74
78
|
eulerVaultsOverride,
|
|
75
79
|
aaveV4SpokesOverride,
|
|
76
80
|
aaveV4OraclesOverride,
|
|
77
|
-
aaveV4PeripheralsOverride
|
|
81
|
+
aaveV4PeripheralsOverride,
|
|
82
|
+
siloMarketsOverride,
|
|
83
|
+
siloPeripheralsOverride,
|
|
84
|
+
siloMarketsV3Override,
|
|
85
|
+
siloPeripheralsV3Override
|
|
78
86
|
}) {
|
|
79
87
|
const data = getGlobalData2();
|
|
80
88
|
if (aaveTokensOverride) data.aaveTokens = aaveTokensOverride;
|
|
@@ -106,6 +114,11 @@ function initializeLenderData({
|
|
|
106
114
|
if (aaveV4OraclesOverride) data.aaveV4Oracles = aaveV4OraclesOverride;
|
|
107
115
|
if (aaveV4PeripheralsOverride)
|
|
108
116
|
data.aaveV4Peripherals = aaveV4PeripheralsOverride;
|
|
117
|
+
if (siloMarketsOverride) data.siloMarkets = siloMarketsOverride;
|
|
118
|
+
if (siloPeripheralsOverride) data.siloPeripherals = siloPeripheralsOverride;
|
|
119
|
+
if (siloMarketsV3Override) data.siloMarketsV3 = siloMarketsV3Override;
|
|
120
|
+
if (siloPeripheralsV3Override)
|
|
121
|
+
data.siloPeripheralsV3 = siloPeripheralsV3Override;
|
|
109
122
|
}
|
|
110
123
|
var aaveTokens = () => getGlobalData2()?.aaveTokens;
|
|
111
124
|
var aavePools = () => getGlobalData2()?.aavePools;
|
|
@@ -135,6 +148,10 @@ var eulerVaults = () => getGlobalData2()?.eulerVaults;
|
|
|
135
148
|
var aaveV4Spokes = () => getGlobalData2()?.aaveV4Spokes;
|
|
136
149
|
var aaveV4Oracles = () => getGlobalData2()?.aaveV4Oracles;
|
|
137
150
|
var aaveV4Peripherals = () => getGlobalData2()?.aaveV4Peripherals;
|
|
151
|
+
var siloMarkets = () => getGlobalData2()?.siloMarkets;
|
|
152
|
+
var siloPeripherals = () => getGlobalData2()?.siloPeripherals;
|
|
153
|
+
var siloMarketsV3 = () => getGlobalData2()?.siloMarketsV3;
|
|
154
|
+
var siloPeripheralsV3 = () => getGlobalData2()?.siloPeripheralsV3;
|
|
138
155
|
function getAaveV4SpokeEntry(chainId, lenderKey) {
|
|
139
156
|
const parsed = parseAaveV4SpokeLenderKey(lenderKey);
|
|
140
157
|
if (!parsed) return void 0;
|
|
@@ -184,6 +201,46 @@ function parseAaveV4SpokeLenderKey(lenderKey) {
|
|
|
184
201
|
if (!match) return void 0;
|
|
185
202
|
return { spokeAddrLower: "0x" + match[1].toLowerCase() };
|
|
186
203
|
}
|
|
204
|
+
function siloV2LenderKey(siloConfig) {
|
|
205
|
+
if (!siloConfig || !siloConfig.startsWith("0x") || siloConfig.length !== 42) {
|
|
206
|
+
throw new Error(`siloV2LenderKey: invalid siloConfig address ${siloConfig}`);
|
|
207
|
+
}
|
|
208
|
+
return `SILO_V2_${siloConfig.slice(2).toUpperCase()}`;
|
|
209
|
+
}
|
|
210
|
+
function parseSiloV2LenderKey(lenderKey) {
|
|
211
|
+
const match = lenderKey.match(/^SILO_V2_([0-9A-F]{40})$/);
|
|
212
|
+
if (!match) return void 0;
|
|
213
|
+
return { siloConfigAddrLower: "0x" + match[1].toLowerCase() };
|
|
214
|
+
}
|
|
215
|
+
function getSiloV2MarketEntry(chainId, lenderKey) {
|
|
216
|
+
const parsed = parseSiloV2LenderKey(lenderKey);
|
|
217
|
+
if (!parsed) return void 0;
|
|
218
|
+
const list = getGlobalData2()?.siloMarkets?.[chainId];
|
|
219
|
+
if (!list) return void 0;
|
|
220
|
+
return list.find(
|
|
221
|
+
(m) => m.siloConfig.toLowerCase() === parsed.siloConfigAddrLower
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
function siloV3LenderKey(siloConfig) {
|
|
225
|
+
if (!siloConfig || !siloConfig.startsWith("0x") || siloConfig.length !== 42) {
|
|
226
|
+
throw new Error(`siloV3LenderKey: invalid siloConfig address ${siloConfig}`);
|
|
227
|
+
}
|
|
228
|
+
return `SILO_V3_${siloConfig.slice(2).toUpperCase()}`;
|
|
229
|
+
}
|
|
230
|
+
function parseSiloV3LenderKey(lenderKey) {
|
|
231
|
+
const match = lenderKey.match(/^SILO_V3_([0-9A-F]{40})$/);
|
|
232
|
+
if (!match) return void 0;
|
|
233
|
+
return { siloConfigAddrLower: "0x" + match[1].toLowerCase() };
|
|
234
|
+
}
|
|
235
|
+
function getSiloV3MarketEntry(chainId, lenderKey) {
|
|
236
|
+
const parsed = parseSiloV3LenderKey(lenderKey);
|
|
237
|
+
if (!parsed) return void 0;
|
|
238
|
+
const list = getGlobalData2()?.siloMarketsV3?.[chainId];
|
|
239
|
+
if (!list) return void 0;
|
|
240
|
+
return list.find(
|
|
241
|
+
(m) => m.siloConfig.toLowerCase() === parsed.siloConfigAddrLower
|
|
242
|
+
);
|
|
243
|
+
}
|
|
187
244
|
|
|
188
245
|
// src/tokens.ts
|
|
189
246
|
var getListUrl = (chainId) => `https://raw.githubusercontent.com/1delta-DAO/token-lists/main/${chainId}.json`;
|
|
@@ -231,6 +288,8 @@ exports.getAaveV4GatewayAddresses = getAaveV4GatewayAddresses;
|
|
|
231
288
|
exports.getAaveV4PositionManagers = getAaveV4PositionManagers;
|
|
232
289
|
exports.getAaveV4SpokeEntry = getAaveV4SpokeEntry;
|
|
233
290
|
exports.getAaveV4SpokePeripherals = getAaveV4SpokePeripherals;
|
|
291
|
+
exports.getSiloV2MarketEntry = getSiloV2MarketEntry;
|
|
292
|
+
exports.getSiloV3MarketEntry = getSiloV3MarketEntry;
|
|
234
293
|
exports.initConfig = initConfig;
|
|
235
294
|
exports.initializeChainData = initializeChainData;
|
|
236
295
|
exports.initializeLenderData = initializeLenderData;
|
|
@@ -241,3 +300,11 @@ exports.morphoPools = morphoPools;
|
|
|
241
300
|
exports.morphoTypeMarkets = morphoTypeMarkets;
|
|
242
301
|
exports.morphoTypeOracles = morphoTypeOracles;
|
|
243
302
|
exports.parseAaveV4SpokeLenderKey = parseAaveV4SpokeLenderKey;
|
|
303
|
+
exports.parseSiloV2LenderKey = parseSiloV2LenderKey;
|
|
304
|
+
exports.parseSiloV3LenderKey = parseSiloV3LenderKey;
|
|
305
|
+
exports.siloMarkets = siloMarkets;
|
|
306
|
+
exports.siloMarketsV3 = siloMarketsV3;
|
|
307
|
+
exports.siloPeripherals = siloPeripherals;
|
|
308
|
+
exports.siloPeripheralsV3 = siloPeripheralsV3;
|
|
309
|
+
exports.siloV2LenderKey = siloV2LenderKey;
|
|
310
|
+
exports.siloV3LenderKey = siloV3LenderKey;
|
package/dist/index.mjs
CHANGED
|
@@ -39,7 +39,11 @@ globalThis[GLOBAL_LENDER_DATA_KEY] = {
|
|
|
39
39
|
eulerVaults: {},
|
|
40
40
|
aaveV4Spokes: {},
|
|
41
41
|
aaveV4Oracles: {},
|
|
42
|
-
aaveV4Peripherals: {}
|
|
42
|
+
aaveV4Peripherals: {},
|
|
43
|
+
siloMarkets: {},
|
|
44
|
+
siloPeripherals: {},
|
|
45
|
+
siloMarketsV3: {},
|
|
46
|
+
siloPeripheralsV3: {}
|
|
43
47
|
};
|
|
44
48
|
function getGlobalData2() {
|
|
45
49
|
return globalThis[GLOBAL_LENDER_DATA_KEY];
|
|
@@ -72,7 +76,11 @@ function initializeLenderData({
|
|
|
72
76
|
eulerVaultsOverride,
|
|
73
77
|
aaveV4SpokesOverride,
|
|
74
78
|
aaveV4OraclesOverride,
|
|
75
|
-
aaveV4PeripheralsOverride
|
|
79
|
+
aaveV4PeripheralsOverride,
|
|
80
|
+
siloMarketsOverride,
|
|
81
|
+
siloPeripheralsOverride,
|
|
82
|
+
siloMarketsV3Override,
|
|
83
|
+
siloPeripheralsV3Override
|
|
76
84
|
}) {
|
|
77
85
|
const data = getGlobalData2();
|
|
78
86
|
if (aaveTokensOverride) data.aaveTokens = aaveTokensOverride;
|
|
@@ -104,6 +112,11 @@ function initializeLenderData({
|
|
|
104
112
|
if (aaveV4OraclesOverride) data.aaveV4Oracles = aaveV4OraclesOverride;
|
|
105
113
|
if (aaveV4PeripheralsOverride)
|
|
106
114
|
data.aaveV4Peripherals = aaveV4PeripheralsOverride;
|
|
115
|
+
if (siloMarketsOverride) data.siloMarkets = siloMarketsOverride;
|
|
116
|
+
if (siloPeripheralsOverride) data.siloPeripherals = siloPeripheralsOverride;
|
|
117
|
+
if (siloMarketsV3Override) data.siloMarketsV3 = siloMarketsV3Override;
|
|
118
|
+
if (siloPeripheralsV3Override)
|
|
119
|
+
data.siloPeripheralsV3 = siloPeripheralsV3Override;
|
|
107
120
|
}
|
|
108
121
|
var aaveTokens = () => getGlobalData2()?.aaveTokens;
|
|
109
122
|
var aavePools = () => getGlobalData2()?.aavePools;
|
|
@@ -133,6 +146,10 @@ var eulerVaults = () => getGlobalData2()?.eulerVaults;
|
|
|
133
146
|
var aaveV4Spokes = () => getGlobalData2()?.aaveV4Spokes;
|
|
134
147
|
var aaveV4Oracles = () => getGlobalData2()?.aaveV4Oracles;
|
|
135
148
|
var aaveV4Peripherals = () => getGlobalData2()?.aaveV4Peripherals;
|
|
149
|
+
var siloMarkets = () => getGlobalData2()?.siloMarkets;
|
|
150
|
+
var siloPeripherals = () => getGlobalData2()?.siloPeripherals;
|
|
151
|
+
var siloMarketsV3 = () => getGlobalData2()?.siloMarketsV3;
|
|
152
|
+
var siloPeripheralsV3 = () => getGlobalData2()?.siloPeripheralsV3;
|
|
136
153
|
function getAaveV4SpokeEntry(chainId, lenderKey) {
|
|
137
154
|
const parsed = parseAaveV4SpokeLenderKey(lenderKey);
|
|
138
155
|
if (!parsed) return void 0;
|
|
@@ -182,6 +199,46 @@ function parseAaveV4SpokeLenderKey(lenderKey) {
|
|
|
182
199
|
if (!match) return void 0;
|
|
183
200
|
return { spokeAddrLower: "0x" + match[1].toLowerCase() };
|
|
184
201
|
}
|
|
202
|
+
function siloV2LenderKey(siloConfig) {
|
|
203
|
+
if (!siloConfig || !siloConfig.startsWith("0x") || siloConfig.length !== 42) {
|
|
204
|
+
throw new Error(`siloV2LenderKey: invalid siloConfig address ${siloConfig}`);
|
|
205
|
+
}
|
|
206
|
+
return `SILO_V2_${siloConfig.slice(2).toUpperCase()}`;
|
|
207
|
+
}
|
|
208
|
+
function parseSiloV2LenderKey(lenderKey) {
|
|
209
|
+
const match = lenderKey.match(/^SILO_V2_([0-9A-F]{40})$/);
|
|
210
|
+
if (!match) return void 0;
|
|
211
|
+
return { siloConfigAddrLower: "0x" + match[1].toLowerCase() };
|
|
212
|
+
}
|
|
213
|
+
function getSiloV2MarketEntry(chainId, lenderKey) {
|
|
214
|
+
const parsed = parseSiloV2LenderKey(lenderKey);
|
|
215
|
+
if (!parsed) return void 0;
|
|
216
|
+
const list = getGlobalData2()?.siloMarkets?.[chainId];
|
|
217
|
+
if (!list) return void 0;
|
|
218
|
+
return list.find(
|
|
219
|
+
(m) => m.siloConfig.toLowerCase() === parsed.siloConfigAddrLower
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
function siloV3LenderKey(siloConfig) {
|
|
223
|
+
if (!siloConfig || !siloConfig.startsWith("0x") || siloConfig.length !== 42) {
|
|
224
|
+
throw new Error(`siloV3LenderKey: invalid siloConfig address ${siloConfig}`);
|
|
225
|
+
}
|
|
226
|
+
return `SILO_V3_${siloConfig.slice(2).toUpperCase()}`;
|
|
227
|
+
}
|
|
228
|
+
function parseSiloV3LenderKey(lenderKey) {
|
|
229
|
+
const match = lenderKey.match(/^SILO_V3_([0-9A-F]{40})$/);
|
|
230
|
+
if (!match) return void 0;
|
|
231
|
+
return { siloConfigAddrLower: "0x" + match[1].toLowerCase() };
|
|
232
|
+
}
|
|
233
|
+
function getSiloV3MarketEntry(chainId, lenderKey) {
|
|
234
|
+
const parsed = parseSiloV3LenderKey(lenderKey);
|
|
235
|
+
if (!parsed) return void 0;
|
|
236
|
+
const list = getGlobalData2()?.siloMarketsV3?.[chainId];
|
|
237
|
+
if (!list) return void 0;
|
|
238
|
+
return list.find(
|
|
239
|
+
(m) => m.siloConfig.toLowerCase() === parsed.siloConfigAddrLower
|
|
240
|
+
);
|
|
241
|
+
}
|
|
185
242
|
|
|
186
243
|
// src/tokens.ts
|
|
187
244
|
var getListUrl = (chainId) => `https://raw.githubusercontent.com/1delta-DAO/token-lists/main/${chainId}.json`;
|
|
@@ -199,4 +256,4 @@ async function fetchTokenLists(chainIds) {
|
|
|
199
256
|
return Object.fromEntries(results);
|
|
200
257
|
}
|
|
201
258
|
|
|
202
|
-
export { aaveOracles, aaveOraclesConfig, aavePools, aaveReserves, aaveTokens, aaveV4Oracles, aaveV4Peripherals, aaveV4SpokeLenderKey, aaveV4Spokes, aaveWethGateway, chains, compoundV2Oracles, compoundV2Pools, compoundV2Reserves, compoundV2TokenArray, compoundV2Tokens, compoundV3BaseData, compoundV3Bulker, compoundV3OraclesData, compoundV3Pools, compoundV3Reserves, eulerConfigs, eulerVaults, fetchTokenList, fetchTokenLists, findAaveV4PositionManager, getAaveV4GatewayAddresses, getAaveV4PositionManagers, getAaveV4SpokeEntry, getAaveV4SpokePeripherals, initConfig, initializeChainData, initializeLenderData, listaNativeProvider, morphoBundler3, morphoOracles, morphoPools, morphoTypeMarkets, morphoTypeOracles, parseAaveV4SpokeLenderKey };
|
|
259
|
+
export { aaveOracles, aaveOraclesConfig, aavePools, aaveReserves, aaveTokens, aaveV4Oracles, aaveV4Peripherals, aaveV4SpokeLenderKey, aaveV4Spokes, aaveWethGateway, chains, compoundV2Oracles, compoundV2Pools, compoundV2Reserves, compoundV2TokenArray, compoundV2Tokens, compoundV3BaseData, compoundV3Bulker, compoundV3OraclesData, compoundV3Pools, compoundV3Reserves, eulerConfigs, eulerVaults, fetchTokenList, fetchTokenLists, findAaveV4PositionManager, getAaveV4GatewayAddresses, getAaveV4PositionManagers, getAaveV4SpokeEntry, getAaveV4SpokePeripherals, getSiloV2MarketEntry, getSiloV3MarketEntry, initConfig, initializeChainData, initializeLenderData, listaNativeProvider, morphoBundler3, morphoOracles, morphoPools, morphoTypeMarkets, morphoTypeOracles, parseAaveV4SpokeLenderKey, parseSiloV2LenderKey, parseSiloV3LenderKey, siloMarkets, siloMarketsV3, siloPeripherals, siloPeripheralsV3, siloV2LenderKey, siloV3LenderKey };
|
package/dist/lending.d.ts
CHANGED
|
@@ -174,6 +174,80 @@ type EulerVaultsType = {
|
|
|
174
174
|
[chainId: string]: EulerVaultEntry[];
|
|
175
175
|
};
|
|
176
176
|
};
|
|
177
|
+
export type SiloHalfStatic = {
|
|
178
|
+
/** silo (vault) address */
|
|
179
|
+
silo: string;
|
|
180
|
+
/** underlying borrowable asset for this side */
|
|
181
|
+
token: string;
|
|
182
|
+
/** ERC-20 decimals for `token`, cached to avoid an extra RPC */
|
|
183
|
+
decimals: number;
|
|
184
|
+
/** Optional symbol cache for UI; not consumed by the fetcher */
|
|
185
|
+
symbol?: string;
|
|
186
|
+
/** Share-token addresses (for user-data fetchers / liquidations) */
|
|
187
|
+
protectedShareToken: string;
|
|
188
|
+
collateralShareToken: string;
|
|
189
|
+
debtShareToken: string;
|
|
190
|
+
/** Per-side oracles (1e18-scaled price quoting) */
|
|
191
|
+
solvencyOracle: string;
|
|
192
|
+
maxLtvOracle: string;
|
|
193
|
+
/** Interest rate model contract */
|
|
194
|
+
interestRateModel: string;
|
|
195
|
+
/** LTV at 1e18 scale */
|
|
196
|
+
maxLtv: string;
|
|
197
|
+
/** Liquidation threshold (LLTV) at 1e18 scale */
|
|
198
|
+
lt: string;
|
|
199
|
+
/** Target LTV after liquidation (1e18) */
|
|
200
|
+
liquidationTargetLtv: string;
|
|
201
|
+
/** Fee parameters (1e18) */
|
|
202
|
+
liquidationFee: string;
|
|
203
|
+
flashloanFee: string;
|
|
204
|
+
daoFee: string;
|
|
205
|
+
deployerFee: string;
|
|
206
|
+
/** Optional hook receiver / quote-before flag */
|
|
207
|
+
hookReceiver?: string;
|
|
208
|
+
callBeforeQuote?: boolean;
|
|
209
|
+
};
|
|
210
|
+
export type SiloMarketEntry = {
|
|
211
|
+
/** Shared SiloConfig address (one per pair) */
|
|
212
|
+
siloConfig: string;
|
|
213
|
+
/** Optional human-readable name from the factory event / curated list */
|
|
214
|
+
name?: string;
|
|
215
|
+
silo0: SiloHalfStatic;
|
|
216
|
+
silo1: SiloHalfStatic;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* chainId → list of (silo0, silo1) pairs.
|
|
220
|
+
*
|
|
221
|
+
* Stored as an array to match the on-disk `silo-v2-markets.json` shape.
|
|
222
|
+
* Per-chain pair counts are small (~100 max), so the linear lookup in
|
|
223
|
+
* `getSiloV2MarketEntry` is fine. If that ever changes, build an index
|
|
224
|
+
* lazily here.
|
|
225
|
+
*/
|
|
226
|
+
export type SiloMarketsType = {
|
|
227
|
+
[chainId: string]: SiloMarketEntry[];
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* Per-chain Silo v2 peripheral / singleton addresses.
|
|
231
|
+
*
|
|
232
|
+
* Both `lens` and `factory` are deployed once per chain and shared by every
|
|
233
|
+
* Silo v2 market on that chain, so they live together in one map instead of
|
|
234
|
+
* being split across `siloLens` / `siloFactory`. Add new chain-wide
|
|
235
|
+
* singletons (e.g. `siloRouter`, `siloIncentivesController`) here.
|
|
236
|
+
*/
|
|
237
|
+
export type SiloPeripheralsEntry = {
|
|
238
|
+
/** SiloLens (v2) — exposes getDepositAPR / getBorrowAPR / getUtilization */
|
|
239
|
+
lens: string;
|
|
240
|
+
/** SiloFactory — used by the initializer to discover deployed silo pairs */
|
|
241
|
+
factory: string;
|
|
242
|
+
/** Optional: router / wrapped-native gateway, populated when needed */
|
|
243
|
+
router?: string;
|
|
244
|
+
/** Optional: incentives controller for reward APR */
|
|
245
|
+
incentivesController?: string;
|
|
246
|
+
};
|
|
247
|
+
/** chainId → Silo v2 peripheral addresses */
|
|
248
|
+
export type SiloPeripheralsType = {
|
|
249
|
+
[chainId: string]: SiloPeripheralsEntry;
|
|
250
|
+
};
|
|
177
251
|
export type AaveV4ReserveEntry = {
|
|
178
252
|
reserveId: number;
|
|
179
253
|
/** Hub-side asset id (scoped to the entry's `hub`) */
|
|
@@ -255,7 +329,7 @@ export type AaveV4PeripheralsType = {
|
|
|
255
329
|
[chainId: string]: AaveV4ChainPeripherals;
|
|
256
330
|
};
|
|
257
331
|
/** Override datas used in the SDK - works across all module instances */
|
|
258
|
-
export declare function initializeLenderData({ aaveTokensOverride, aavePoolsOverride, aaveOraclesOverride, compoundV2OraclesOverride, compoundV3OraclesDataOverride, compoundV3PoolsOverride, compoundV3BaseDataOverride, morphoPoolsOverride, compoundV2TokensOverride, compoundV2TokenArrayOverride, compoundV2PoolsOverride, initConfigOverride, aaveReservesOverride, compoundV3ReservesOverride, compoundV2ReservesOverride, morphoOraclesOverride, morphoTypeOraclesOverride, morphoTypeMarketsOverride, aaveOraclesConfigOverride, aaveWethGatewayOverride, morphoBundler3Override, listaNativeProviderOverride, compoundV3BulkerOverride, eulerConfigsOverride, eulerVaultsOverride, aaveV4SpokesOverride, aaveV4OraclesOverride, aaveV4PeripheralsOverride, }: {
|
|
332
|
+
export declare function initializeLenderData({ aaveTokensOverride, aavePoolsOverride, aaveOraclesOverride, compoundV2OraclesOverride, compoundV3OraclesDataOverride, compoundV3PoolsOverride, compoundV3BaseDataOverride, morphoPoolsOverride, compoundV2TokensOverride, compoundV2TokenArrayOverride, compoundV2PoolsOverride, initConfigOverride, aaveReservesOverride, compoundV3ReservesOverride, compoundV2ReservesOverride, morphoOraclesOverride, morphoTypeOraclesOverride, morphoTypeMarketsOverride, aaveOraclesConfigOverride, aaveWethGatewayOverride, morphoBundler3Override, listaNativeProviderOverride, compoundV3BulkerOverride, eulerConfigsOverride, eulerVaultsOverride, aaveV4SpokesOverride, aaveV4OraclesOverride, aaveV4PeripheralsOverride, siloMarketsOverride, siloPeripheralsOverride, siloMarketsV3Override, siloPeripheralsV3Override, }: {
|
|
259
333
|
aaveTokensOverride?: AaveTokensType;
|
|
260
334
|
aavePoolsOverride?: AavePoolsType;
|
|
261
335
|
aaveOraclesOverride?: OracleMap;
|
|
@@ -284,6 +358,10 @@ export declare function initializeLenderData({ aaveTokensOverride, aavePoolsOver
|
|
|
284
358
|
aaveV4SpokesOverride?: AaveV4SpokesType;
|
|
285
359
|
aaveV4OraclesOverride?: AaveV4OraclesType;
|
|
286
360
|
aaveV4PeripheralsOverride?: AaveV4PeripheralsType;
|
|
361
|
+
siloMarketsOverride?: SiloMarketsType;
|
|
362
|
+
siloPeripheralsOverride?: SiloPeripheralsType;
|
|
363
|
+
siloMarketsV3Override?: SiloMarketsType;
|
|
364
|
+
siloPeripheralsV3Override?: SiloPeripheralsType;
|
|
287
365
|
}): void;
|
|
288
366
|
export declare const aaveTokens: () => AaveTokensType;
|
|
289
367
|
export declare const aavePools: () => AavePoolsType;
|
|
@@ -313,6 +391,10 @@ export declare const eulerVaults: () => EulerVaultsType;
|
|
|
313
391
|
export declare const aaveV4Spokes: () => AaveV4SpokesType;
|
|
314
392
|
export declare const aaveV4Oracles: () => AaveV4OraclesType;
|
|
315
393
|
export declare const aaveV4Peripherals: () => AaveV4PeripheralsType;
|
|
394
|
+
export declare const siloMarkets: () => SiloMarketsType;
|
|
395
|
+
export declare const siloPeripherals: () => SiloPeripheralsType;
|
|
396
|
+
export declare const siloMarketsV3: () => SiloMarketsType;
|
|
397
|
+
export declare const siloPeripheralsV3: () => SiloPeripheralsType;
|
|
316
398
|
/**
|
|
317
399
|
* Look up the spoke entry for a per-spoke V4 lender key (`AAVE_V4_<HEX>`).
|
|
318
400
|
* Returns `undefined` if no entry exists for that chain/spoke.
|
|
@@ -398,4 +480,55 @@ export declare function aaveV4SpokeLenderKey(spoke: string): string;
|
|
|
398
480
|
export declare function parseAaveV4SpokeLenderKey(lenderKey: string): {
|
|
399
481
|
spokeAddrLower: string;
|
|
400
482
|
} | undefined;
|
|
483
|
+
/**
|
|
484
|
+
* Synthesize the per-pair lender key for a Silo v2 market.
|
|
485
|
+
*
|
|
486
|
+
* Mirrors `aaveV4SpokeLenderKey` and the Morpho `MORPHO_BLUE_<HEX>`
|
|
487
|
+
* convention so each Silo pair shows up as its own isolated lender —
|
|
488
|
+
* exactly like an Aave V4 spoke or a Morpho Blue market — without any
|
|
489
|
+
* Silo-specific routing logic in the rest of the codebase.
|
|
490
|
+
*
|
|
491
|
+
* Format: `SILO_V2_${siloConfigAddr.slice(2).toUpperCase()}`
|
|
492
|
+
*
|
|
493
|
+
* Keyed by `SiloConfig` rather than either silo because the config is the
|
|
494
|
+
* stable, shared identity of the pair (silo0/silo1 are derived from it).
|
|
495
|
+
*
|
|
496
|
+
* `isSiloV2Type()` works on this because it matches `startsWith('SILO_V2')`.
|
|
497
|
+
*/
|
|
498
|
+
export declare function siloV2LenderKey(siloConfig: string): string;
|
|
499
|
+
/**
|
|
500
|
+
* Inverse of `siloV2LenderKey`: given a per-pair lender key, return
|
|
501
|
+
* `{ siloConfigAddrLower }`. Returns `undefined` if the key isn't a per-pair
|
|
502
|
+
* Silo v2 key (e.g. someone passed the bare prefix `SILO_V2`).
|
|
503
|
+
*/
|
|
504
|
+
export declare function parseSiloV2LenderKey(lenderKey: string): {
|
|
505
|
+
siloConfigAddrLower: string;
|
|
506
|
+
} | undefined;
|
|
507
|
+
/**
|
|
508
|
+
* Look up a Silo v2 market entry by per-pair lender key.
|
|
509
|
+
* Returns `undefined` if no entry exists for that chain/config.
|
|
510
|
+
*/
|
|
511
|
+
export declare function getSiloV2MarketEntry(chainId: string, lenderKey: string): SiloMarketEntry | undefined;
|
|
512
|
+
/**
|
|
513
|
+
* Silo v3 per-pair lender key helpers.
|
|
514
|
+
*
|
|
515
|
+
* Silo v3 uses the exact same on-chain data model and metadata shape as v2
|
|
516
|
+
* (`SiloMarketEntry`/`SiloHalfStatic`) — only the deployment set, factory
|
|
517
|
+
* and indexer protocol tag differ — so v3 pairs get their own isolated
|
|
518
|
+
* lender token namespace (`SILO_V3_<HEX>`) and live in a separate
|
|
519
|
+
* `siloMarketsV3` registry slot. Keeping the two separate means a v2 and
|
|
520
|
+
* v3 pair with the same `SiloConfig` address could in principle coexist
|
|
521
|
+
* without clashing, and downstream consumers can filter by prefix.
|
|
522
|
+
*
|
|
523
|
+
* Format: `SILO_V3_${siloConfigAddr.slice(2).toUpperCase()}`
|
|
524
|
+
*/
|
|
525
|
+
export declare function siloV3LenderKey(siloConfig: string): string;
|
|
526
|
+
export declare function parseSiloV3LenderKey(lenderKey: string): {
|
|
527
|
+
siloConfigAddrLower: string;
|
|
528
|
+
} | undefined;
|
|
529
|
+
/**
|
|
530
|
+
* Look up a Silo v3 market entry by per-pair lender key.
|
|
531
|
+
* Returns `undefined` if no entry exists for that chain/config.
|
|
532
|
+
*/
|
|
533
|
+
export declare function getSiloV3MarketEntry(chainId: string, lenderKey: string): SiloMarketEntry | undefined;
|
|
401
534
|
export {};
|