@1delta/data-sdk 0.0.49 → 0.0.51
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 +77 -3
- package/dist/index.mjs +71 -4
- package/dist/lending/cooler.d.ts +64 -0
- package/dist/lending/index.d.ts +1 -0
- package/dist/lending/registry.d.ts +2 -0
- package/dist/lending/term.d.ts +17 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -95,6 +95,7 @@ var LENDER_DATA_DEFAULTS = () => ({
|
|
|
95
95
|
llamaLendMarkets: {},
|
|
96
96
|
resupplyConfig: {},
|
|
97
97
|
curvanceConfig: {},
|
|
98
|
+
coolerConfig: {},
|
|
98
99
|
twyneConfig: {},
|
|
99
100
|
twyneMarkets: {},
|
|
100
101
|
fraxlendConfig: {},
|
|
@@ -372,6 +373,17 @@ var resolveTermApiBase = (chainId) => {
|
|
|
372
373
|
const cfg = termConfig()?.[chainId]?.apiBaseUrl;
|
|
373
374
|
return (cfg && cfg.length > 0 ? cfg : "").replace(/\/+$/, "");
|
|
374
375
|
};
|
|
376
|
+
var TERM_ORDER_STORE_OVERRIDE_KEY = "__1delta_term_order_store_base__";
|
|
377
|
+
var setTermOrderStoreBase = (url) => {
|
|
378
|
+
globalThis[TERM_ORDER_STORE_OVERRIDE_KEY] = url && url.length > 0 ? url : void 0;
|
|
379
|
+
};
|
|
380
|
+
var termOrderStoreBaseOverride = () => globalThis[TERM_ORDER_STORE_OVERRIDE_KEY];
|
|
381
|
+
var resolveTermOrderStoreBase = (chainId) => {
|
|
382
|
+
const override = termOrderStoreBaseOverride();
|
|
383
|
+
if (override) return override.replace(/\/+$/, "");
|
|
384
|
+
const cfg = termConfig()?.[chainId]?.orderStoreUrl;
|
|
385
|
+
return (cfg && cfg.length > 0 ? cfg : "").replace(/\/+$/, "");
|
|
386
|
+
};
|
|
375
387
|
var termMarkets = () => getGlobalData2()?.termMarkets;
|
|
376
388
|
var termMarketsByChain = (chainId) => getGlobalData2()?.termMarkets?.[String(chainId)] ?? [];
|
|
377
389
|
var termMarketById = (chainId, termRepoId) => {
|
|
@@ -747,6 +759,40 @@ var curvancePositionManager = (lender, chainId, marketManager, kind) => {
|
|
|
747
759
|
return pms.simplePositionManager ?? pms.vaultPositionManager ?? pms.nativeVaultPositionManager ?? pms.pendlePtPositionManager;
|
|
748
760
|
};
|
|
749
761
|
|
|
762
|
+
// src/lending/cooler.ts
|
|
763
|
+
var COOLER_ETHEREUM_CONFIG = {
|
|
764
|
+
monoCooler: "0xdb591Ea2e5Db886dA872654D58f6cc584b68e7cC",
|
|
765
|
+
ltvOracle: "0x9ee9f0c2e91E4f6B195B988a9e6e19efcf91e8dc",
|
|
766
|
+
treasuryBorrower: "0xD58d7406E9CE34c90cf849Fc3eed3764EB3779B0",
|
|
767
|
+
composites: "0x6593768feBF9C95aC857Fb7Ef244D5738D1C57Fd",
|
|
768
|
+
treasury: "0xa8687A15D4BE32CC8F0a8a7B9704a4C3993D9613",
|
|
769
|
+
susds: "0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD",
|
|
770
|
+
gohm: "0x0ab87046fBb341D058F17CBC4c1133F25a20a52f",
|
|
771
|
+
usds: "0xdC035D45d973E3EC169d2276DDab16f1e407384F",
|
|
772
|
+
debtDecimals: 18
|
|
773
|
+
};
|
|
774
|
+
var COOLER_BUILTIN = {
|
|
775
|
+
COOLER: { "1": COOLER_ETHEREUM_CONFIG }
|
|
776
|
+
};
|
|
777
|
+
var coolerConfig = () => getGlobalData2()?.coolerConfig;
|
|
778
|
+
var coolerConfigFor = (lender, chainId) => {
|
|
779
|
+
const published = getGlobalData2()?.coolerConfig?.[lender]?.[String(chainId)];
|
|
780
|
+
if (published?.monoCooler) return published;
|
|
781
|
+
return COOLER_BUILTIN[lender]?.[String(chainId)];
|
|
782
|
+
};
|
|
783
|
+
var coolerLendersByChain = (chainId) => {
|
|
784
|
+
const chain = String(chainId);
|
|
785
|
+
const cfg = getGlobalData2()?.coolerConfig ?? {};
|
|
786
|
+
const keys = /* @__PURE__ */ new Set();
|
|
787
|
+
for (const lender of Object.keys(cfg)) {
|
|
788
|
+
if (cfg[lender]?.[chain]?.monoCooler) keys.add(lender);
|
|
789
|
+
}
|
|
790
|
+
for (const lender of Object.keys(COOLER_BUILTIN)) {
|
|
791
|
+
if (COOLER_BUILTIN[lender]?.[chain]?.monoCooler) keys.add(lender);
|
|
792
|
+
}
|
|
793
|
+
return [...keys];
|
|
794
|
+
};
|
|
795
|
+
|
|
750
796
|
// src/lending/twyne.ts
|
|
751
797
|
var twyneConfig = () => getGlobalData2()?.twyneConfig;
|
|
752
798
|
var twyneConfigFor = (lender, chainId) => getGlobalData2()?.twyneConfig?.[twyneBaseKey(lender)]?.[String(chainId)];
|
|
@@ -920,12 +966,15 @@ var parseFraxlendPairKey = (lender) => {
|
|
|
920
966
|
|
|
921
967
|
// src/remoteCache.ts
|
|
922
968
|
var FRESH_TTL_MS = 5 * 60 * 1e3;
|
|
969
|
+
var STALE_WHILE_REVALIDATE_MS = 12 * 60 * 60 * 1e3;
|
|
923
970
|
var REMOTE_CACHE_STORE_TTL_S = 7 * 24 * 60 * 60;
|
|
924
971
|
var STATE_KEY = "__1delta_remote_cache__";
|
|
925
972
|
function getState() {
|
|
926
973
|
const g = globalThis;
|
|
927
|
-
if (!g[STATE_KEY]) g[STATE_KEY] = { memo: /* @__PURE__ */ new Map(), inflight: /* @__PURE__ */ new Map() };
|
|
928
|
-
|
|
974
|
+
if (!g[STATE_KEY]) g[STATE_KEY] = { memo: /* @__PURE__ */ new Map(), inflight: /* @__PURE__ */ new Map(), revalidating: /* @__PURE__ */ new Set() };
|
|
975
|
+
const state = g[STATE_KEY];
|
|
976
|
+
if (!state.revalidating) state.revalidating = /* @__PURE__ */ new Set();
|
|
977
|
+
return state;
|
|
929
978
|
}
|
|
930
979
|
function setRemoteCacheStore(next) {
|
|
931
980
|
getState().store = next;
|
|
@@ -1003,7 +1052,7 @@ async function writeStore(key, entry) {
|
|
|
1003
1052
|
}
|
|
1004
1053
|
}
|
|
1005
1054
|
async function loadCached(key, load, isValid) {
|
|
1006
|
-
const { memo, inflight } = getState();
|
|
1055
|
+
const { memo, inflight, revalidating } = getState();
|
|
1007
1056
|
const cached = memo.get(key);
|
|
1008
1057
|
if (cached && Date.now() - cached.at < FRESH_TTL_MS) return cached.value;
|
|
1009
1058
|
const pending = inflight.get(key);
|
|
@@ -1014,6 +1063,24 @@ async function loadCached(key, load, isValid) {
|
|
|
1014
1063
|
memo.set(key, stored);
|
|
1015
1064
|
return stored.value;
|
|
1016
1065
|
}
|
|
1066
|
+
if (stored && Date.now() - stored.at < STALE_WHILE_REVALIDATE_MS) {
|
|
1067
|
+
memo.set(key, stored);
|
|
1068
|
+
if (revalidating.has(key)) return stored.value;
|
|
1069
|
+
revalidating.add(key);
|
|
1070
|
+
void (async () => {
|
|
1071
|
+
try {
|
|
1072
|
+
const value = await load();
|
|
1073
|
+
const entry = { at: Date.now(), value };
|
|
1074
|
+
const current = memo.get(key);
|
|
1075
|
+
if (!current || current.at <= entry.at) memo.set(key, entry);
|
|
1076
|
+
await writeStore(key, entry);
|
|
1077
|
+
} catch {
|
|
1078
|
+
} finally {
|
|
1079
|
+
revalidating.delete(key);
|
|
1080
|
+
}
|
|
1081
|
+
})();
|
|
1082
|
+
return stored.value;
|
|
1083
|
+
}
|
|
1017
1084
|
try {
|
|
1018
1085
|
const value = await load();
|
|
1019
1086
|
const entry = { at: Date.now(), value };
|
|
@@ -1080,6 +1147,7 @@ async function fetchMainTokensMap() {
|
|
|
1080
1147
|
}
|
|
1081
1148
|
}
|
|
1082
1149
|
|
|
1150
|
+
exports.COOLER_ETHEREUM_CONFIG = COOLER_ETHEREUM_CONFIG;
|
|
1083
1151
|
exports.CURVANCE_MONAD_CONFIG = CURVANCE_MONAD_CONFIG;
|
|
1084
1152
|
exports.FRAXLEND_ETHEREUM_CONFIG = FRAXLEND_ETHEREUM_CONFIG;
|
|
1085
1153
|
exports.GEARBOX_ACCOUNT_COMPRESSOR_V310 = GEARBOX_ACCOUNT_COMPRESSOR_V310;
|
|
@@ -1111,6 +1179,9 @@ exports.compoundV3Bulker = compoundV3Bulker;
|
|
|
1111
1179
|
exports.compoundV3OraclesData = compoundV3OraclesData;
|
|
1112
1180
|
exports.compoundV3Pools = compoundV3Pools;
|
|
1113
1181
|
exports.compoundV3Reserves = compoundV3Reserves;
|
|
1182
|
+
exports.coolerConfig = coolerConfig;
|
|
1183
|
+
exports.coolerConfigFor = coolerConfigFor;
|
|
1184
|
+
exports.coolerLendersByChain = coolerLendersByChain;
|
|
1114
1185
|
exports.curvanceConfig = curvanceConfig;
|
|
1115
1186
|
exports.curvanceConfigFor = curvanceConfigFor;
|
|
1116
1187
|
exports.curvanceLendersByChain = curvanceLendersByChain;
|
|
@@ -1225,6 +1296,7 @@ exports.parseSiloV3LenderKey = parseSiloV3LenderKey;
|
|
|
1225
1296
|
exports.parseTermMaxLenderKey = parseTermMaxLenderKey;
|
|
1226
1297
|
exports.resolveMidnightApiBase = resolveMidnightApiBase;
|
|
1227
1298
|
exports.resolveTermApiBase = resolveTermApiBase;
|
|
1299
|
+
exports.resolveTermOrderStoreBase = resolveTermOrderStoreBase;
|
|
1228
1300
|
exports.resupplyConfig = resupplyConfig;
|
|
1229
1301
|
exports.resupplyConfigFor = resupplyConfigFor;
|
|
1230
1302
|
exports.resupplyLendersByChain = resupplyLendersByChain;
|
|
@@ -1238,6 +1310,7 @@ exports.setMidnightApiBase = setMidnightApiBase;
|
|
|
1238
1310
|
exports.setRemoteCacheGithubToken = setRemoteCacheGithubToken;
|
|
1239
1311
|
exports.setRemoteCacheStore = setRemoteCacheStore;
|
|
1240
1312
|
exports.setTermApiBase = setTermApiBase;
|
|
1313
|
+
exports.setTermOrderStoreBase = setTermOrderStoreBase;
|
|
1241
1314
|
exports.siloMarkets = siloMarkets;
|
|
1242
1315
|
exports.siloMarketsV3 = siloMarketsV3;
|
|
1243
1316
|
exports.siloPeripherals = siloPeripherals;
|
|
@@ -1264,6 +1337,7 @@ exports.termMaxChainIds = termMaxChainIds;
|
|
|
1264
1337
|
exports.termMaxConfig = termMaxConfig;
|
|
1265
1338
|
exports.termMaxConfigByChain = termMaxConfigByChain;
|
|
1266
1339
|
exports.termMaxLenderKey = termMaxLenderKey;
|
|
1340
|
+
exports.termOrderStoreBaseOverride = termOrderStoreBaseOverride;
|
|
1267
1341
|
exports.twyneBaseKey = twyneBaseKey;
|
|
1268
1342
|
exports.twyneBeaconFor = twyneBeaconFor;
|
|
1269
1343
|
exports.twyneChainData = twyneChainData;
|
package/dist/index.mjs
CHANGED
|
@@ -93,6 +93,7 @@ var LENDER_DATA_DEFAULTS = () => ({
|
|
|
93
93
|
llamaLendMarkets: {},
|
|
94
94
|
resupplyConfig: {},
|
|
95
95
|
curvanceConfig: {},
|
|
96
|
+
coolerConfig: {},
|
|
96
97
|
twyneConfig: {},
|
|
97
98
|
twyneMarkets: {},
|
|
98
99
|
fraxlendConfig: {},
|
|
@@ -370,6 +371,17 @@ var resolveTermApiBase = (chainId) => {
|
|
|
370
371
|
const cfg = termConfig()?.[chainId]?.apiBaseUrl;
|
|
371
372
|
return (cfg && cfg.length > 0 ? cfg : "").replace(/\/+$/, "");
|
|
372
373
|
};
|
|
374
|
+
var TERM_ORDER_STORE_OVERRIDE_KEY = "__1delta_term_order_store_base__";
|
|
375
|
+
var setTermOrderStoreBase = (url) => {
|
|
376
|
+
globalThis[TERM_ORDER_STORE_OVERRIDE_KEY] = url && url.length > 0 ? url : void 0;
|
|
377
|
+
};
|
|
378
|
+
var termOrderStoreBaseOverride = () => globalThis[TERM_ORDER_STORE_OVERRIDE_KEY];
|
|
379
|
+
var resolveTermOrderStoreBase = (chainId) => {
|
|
380
|
+
const override = termOrderStoreBaseOverride();
|
|
381
|
+
if (override) return override.replace(/\/+$/, "");
|
|
382
|
+
const cfg = termConfig()?.[chainId]?.orderStoreUrl;
|
|
383
|
+
return (cfg && cfg.length > 0 ? cfg : "").replace(/\/+$/, "");
|
|
384
|
+
};
|
|
373
385
|
var termMarkets = () => getGlobalData2()?.termMarkets;
|
|
374
386
|
var termMarketsByChain = (chainId) => getGlobalData2()?.termMarkets?.[String(chainId)] ?? [];
|
|
375
387
|
var termMarketById = (chainId, termRepoId) => {
|
|
@@ -745,6 +757,40 @@ var curvancePositionManager = (lender, chainId, marketManager, kind) => {
|
|
|
745
757
|
return pms.simplePositionManager ?? pms.vaultPositionManager ?? pms.nativeVaultPositionManager ?? pms.pendlePtPositionManager;
|
|
746
758
|
};
|
|
747
759
|
|
|
760
|
+
// src/lending/cooler.ts
|
|
761
|
+
var COOLER_ETHEREUM_CONFIG = {
|
|
762
|
+
monoCooler: "0xdb591Ea2e5Db886dA872654D58f6cc584b68e7cC",
|
|
763
|
+
ltvOracle: "0x9ee9f0c2e91E4f6B195B988a9e6e19efcf91e8dc",
|
|
764
|
+
treasuryBorrower: "0xD58d7406E9CE34c90cf849Fc3eed3764EB3779B0",
|
|
765
|
+
composites: "0x6593768feBF9C95aC857Fb7Ef244D5738D1C57Fd",
|
|
766
|
+
treasury: "0xa8687A15D4BE32CC8F0a8a7B9704a4C3993D9613",
|
|
767
|
+
susds: "0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD",
|
|
768
|
+
gohm: "0x0ab87046fBb341D058F17CBC4c1133F25a20a52f",
|
|
769
|
+
usds: "0xdC035D45d973E3EC169d2276DDab16f1e407384F",
|
|
770
|
+
debtDecimals: 18
|
|
771
|
+
};
|
|
772
|
+
var COOLER_BUILTIN = {
|
|
773
|
+
COOLER: { "1": COOLER_ETHEREUM_CONFIG }
|
|
774
|
+
};
|
|
775
|
+
var coolerConfig = () => getGlobalData2()?.coolerConfig;
|
|
776
|
+
var coolerConfigFor = (lender, chainId) => {
|
|
777
|
+
const published = getGlobalData2()?.coolerConfig?.[lender]?.[String(chainId)];
|
|
778
|
+
if (published?.monoCooler) return published;
|
|
779
|
+
return COOLER_BUILTIN[lender]?.[String(chainId)];
|
|
780
|
+
};
|
|
781
|
+
var coolerLendersByChain = (chainId) => {
|
|
782
|
+
const chain = String(chainId);
|
|
783
|
+
const cfg = getGlobalData2()?.coolerConfig ?? {};
|
|
784
|
+
const keys = /* @__PURE__ */ new Set();
|
|
785
|
+
for (const lender of Object.keys(cfg)) {
|
|
786
|
+
if (cfg[lender]?.[chain]?.monoCooler) keys.add(lender);
|
|
787
|
+
}
|
|
788
|
+
for (const lender of Object.keys(COOLER_BUILTIN)) {
|
|
789
|
+
if (COOLER_BUILTIN[lender]?.[chain]?.monoCooler) keys.add(lender);
|
|
790
|
+
}
|
|
791
|
+
return [...keys];
|
|
792
|
+
};
|
|
793
|
+
|
|
748
794
|
// src/lending/twyne.ts
|
|
749
795
|
var twyneConfig = () => getGlobalData2()?.twyneConfig;
|
|
750
796
|
var twyneConfigFor = (lender, chainId) => getGlobalData2()?.twyneConfig?.[twyneBaseKey(lender)]?.[String(chainId)];
|
|
@@ -918,12 +964,15 @@ var parseFraxlendPairKey = (lender) => {
|
|
|
918
964
|
|
|
919
965
|
// src/remoteCache.ts
|
|
920
966
|
var FRESH_TTL_MS = 5 * 60 * 1e3;
|
|
967
|
+
var STALE_WHILE_REVALIDATE_MS = 12 * 60 * 60 * 1e3;
|
|
921
968
|
var REMOTE_CACHE_STORE_TTL_S = 7 * 24 * 60 * 60;
|
|
922
969
|
var STATE_KEY = "__1delta_remote_cache__";
|
|
923
970
|
function getState() {
|
|
924
971
|
const g = globalThis;
|
|
925
|
-
if (!g[STATE_KEY]) g[STATE_KEY] = { memo: /* @__PURE__ */ new Map(), inflight: /* @__PURE__ */ new Map() };
|
|
926
|
-
|
|
972
|
+
if (!g[STATE_KEY]) g[STATE_KEY] = { memo: /* @__PURE__ */ new Map(), inflight: /* @__PURE__ */ new Map(), revalidating: /* @__PURE__ */ new Set() };
|
|
973
|
+
const state = g[STATE_KEY];
|
|
974
|
+
if (!state.revalidating) state.revalidating = /* @__PURE__ */ new Set();
|
|
975
|
+
return state;
|
|
927
976
|
}
|
|
928
977
|
function setRemoteCacheStore(next) {
|
|
929
978
|
getState().store = next;
|
|
@@ -1001,7 +1050,7 @@ async function writeStore(key, entry) {
|
|
|
1001
1050
|
}
|
|
1002
1051
|
}
|
|
1003
1052
|
async function loadCached(key, load, isValid) {
|
|
1004
|
-
const { memo, inflight } = getState();
|
|
1053
|
+
const { memo, inflight, revalidating } = getState();
|
|
1005
1054
|
const cached = memo.get(key);
|
|
1006
1055
|
if (cached && Date.now() - cached.at < FRESH_TTL_MS) return cached.value;
|
|
1007
1056
|
const pending = inflight.get(key);
|
|
@@ -1012,6 +1061,24 @@ async function loadCached(key, load, isValid) {
|
|
|
1012
1061
|
memo.set(key, stored);
|
|
1013
1062
|
return stored.value;
|
|
1014
1063
|
}
|
|
1064
|
+
if (stored && Date.now() - stored.at < STALE_WHILE_REVALIDATE_MS) {
|
|
1065
|
+
memo.set(key, stored);
|
|
1066
|
+
if (revalidating.has(key)) return stored.value;
|
|
1067
|
+
revalidating.add(key);
|
|
1068
|
+
void (async () => {
|
|
1069
|
+
try {
|
|
1070
|
+
const value = await load();
|
|
1071
|
+
const entry = { at: Date.now(), value };
|
|
1072
|
+
const current = memo.get(key);
|
|
1073
|
+
if (!current || current.at <= entry.at) memo.set(key, entry);
|
|
1074
|
+
await writeStore(key, entry);
|
|
1075
|
+
} catch {
|
|
1076
|
+
} finally {
|
|
1077
|
+
revalidating.delete(key);
|
|
1078
|
+
}
|
|
1079
|
+
})();
|
|
1080
|
+
return stored.value;
|
|
1081
|
+
}
|
|
1015
1082
|
try {
|
|
1016
1083
|
const value = await load();
|
|
1017
1084
|
const entry = { at: Date.now(), value };
|
|
@@ -1078,4 +1145,4 @@ async function fetchMainTokensMap() {
|
|
|
1078
1145
|
}
|
|
1079
1146
|
}
|
|
1080
1147
|
|
|
1081
|
-
export { CURVANCE_MONAD_CONFIG, FRAXLEND_ETHEREUM_CONFIG, GEARBOX_ACCOUNT_COMPRESSOR_V310, REMOTE_CACHE_STORE_TTL_S, RESUPPLY_ETHEREUM_CONFIG, RemoteFetchError, aaveOracles, aaveOraclesConfig, aavePools, aaveReserves, aaveTokens, aaveV4Oracles, aaveV4Peripherals, aaveV4SpokeLenderKey, aaveV4Spokes, aaveWethGateway, assertTwyneKeysUnique, chainLogoURI, chains, clearRemoteCache, compoundV2Oracles, compoundV2OraclesConfig, compoundV2Pools, compoundV2Reserves, compoundV2TokenArray, compoundV2Tokens, compoundV3BaseData, compoundV3Bulker, compoundV3OraclesData, compoundV3Pools, compoundV3Reserves, curvanceConfig, curvanceConfigFor, curvanceLendersByChain, curvancePositionManager, curvancePositionManagersFor, dolomiteChains, dolomiteConfigs, dolomiteEmode, dolomiteMarketIdByToken, dssChainData, dssConfigFor, dssDebtJoin, dssDebtToken, dssMarketByIlk, eulerConfigs, eulerVaults, exactlyConfig, exactlyMarketByAddress, exactlyMarketByAsset, exactlyMarkets, exactlyMarketsByChain, fetchMainTokensMap, fetchRemoteJson, fetchTokenList, fetchTokenListFile, fetchTokenLists, findAaveV4PositionManager, fluidChains, fluidResolvers, fluidVaultEntries, fluidVaults, frankencoinChainData, frankencoinConfig, frankencoinConfigFor, frankencoinLendersByChain, frankencoinMarketByPosition, frankencoinMarkets, fraxlendConfig, fraxlendConfigFor, fraxlendLendersByChain, fraxlendPairKey, fraxlendPairsFor, gearboxAccountCompressor, gearboxAddressProviderV310, gearboxBotListV3, gearboxChains, gearboxMarketCompressor, gearboxMarketConfigurators, gearboxResolvers, gearboxV3LenderKey, getAaveV4GatewayAddresses, getAaveV4PositionManagers, getAaveV4SpokeAccess, getAaveV4SpokeEntry, getAaveV4SpokePeripherals, getChainEntries, getSiloV2MarketEntry, getSiloV3MarketEntry, initConfig, initializeChainData, initializeLenderData, inverseChainData, inverseConfig, inverseConfigFor, inverseLendersByChain, inverseMarketByAddress, inverseMarkets, isAaveV4OperationRestricted, isListaSmartLpAsset, liquityBranchByIndex, liquityBranchByTroveManager, liquityBranchesByChain, liquityConfig, liquityConfigFor, liquityLendersByChain, liquityMarkets, listaCollateralProvider, listaCollateralProviders, listaNativeProvider, listaSmartLpByCollateral, llamaLendApiBaseUrl, llamaLendChainData, llamaLendConfig, llamaLendConfigFor, llamaLendLenderKey, llamaLendLendersByChain, llamaLendLeverageZap, llamaLendMarketByController, llamaLendMarketByVault, llamaLendMarkets, llamaLendSupportsDelegation, llamaLendSupportsLeverage, loadCached, loadCachedJson, midnightApiBaseOverride, midnightConfig, midnightMarketById, midnightMarkets, midnightMarketsByChain, morphoBundler3, morphoOracles, morphoPools, morphoTypeMarkets, morphoTypeOracles, morphoTypeVaults, parseAaveV4SpokeLenderKey, parseFraxlendPairKey, parseGearboxV3LenderKey, parseLlamaLendLenderKey, parseSiloV2LenderKey, parseSiloV3LenderKey, parseTermMaxLenderKey, resolveMidnightApiBase, resolveTermApiBase, resupplyConfig, resupplyConfigFor, resupplyLendersByChain, riverChainData, riverConfig, riverConfigFor, riverLendersByChain, riverMarketByIndex, riverMarkets, setMidnightApiBase, setRemoteCacheGithubToken, setRemoteCacheStore, setTermApiBase, siloMarkets, siloMarketsV3, siloPeripherals, siloPeripheralsV3, siloV2LenderKey, siloV3LenderKey, skyChainData, skyConfig, skyConfigFor, skyLendersByChain, skyMarkets, tellerConfig, tellerConfigByChain, tellerPoolByAddress, tellerPools, tellerPoolsByChain, termApiBaseOverride, termConfig, termMarketById, termMarkets, termMarketsByChain, termMaxApiBaseUrl, termMaxChainIds, termMaxConfig, termMaxConfigByChain, termMaxLenderKey, twyneBaseKey, twyneBeaconFor, twyneChainData, twyneConfig, twyneConfigFor, twyneLendersByChain, twyneMarketByKey, twyneMarketFor, twyneMarketKey, twyneMarkets, twyneMarketsForIntermediateVault, twyneOperator, usddChainData, usddConfig, usddConfigFor, usddLendersByChain, usddMarketByIlk, usddMarkets };
|
|
1148
|
+
export { COOLER_ETHEREUM_CONFIG, CURVANCE_MONAD_CONFIG, FRAXLEND_ETHEREUM_CONFIG, GEARBOX_ACCOUNT_COMPRESSOR_V310, REMOTE_CACHE_STORE_TTL_S, RESUPPLY_ETHEREUM_CONFIG, RemoteFetchError, aaveOracles, aaveOraclesConfig, aavePools, aaveReserves, aaveTokens, aaveV4Oracles, aaveV4Peripherals, aaveV4SpokeLenderKey, aaveV4Spokes, aaveWethGateway, assertTwyneKeysUnique, chainLogoURI, chains, clearRemoteCache, compoundV2Oracles, compoundV2OraclesConfig, compoundV2Pools, compoundV2Reserves, compoundV2TokenArray, compoundV2Tokens, compoundV3BaseData, compoundV3Bulker, compoundV3OraclesData, compoundV3Pools, compoundV3Reserves, coolerConfig, coolerConfigFor, coolerLendersByChain, curvanceConfig, curvanceConfigFor, curvanceLendersByChain, curvancePositionManager, curvancePositionManagersFor, dolomiteChains, dolomiteConfigs, dolomiteEmode, dolomiteMarketIdByToken, dssChainData, dssConfigFor, dssDebtJoin, dssDebtToken, dssMarketByIlk, eulerConfigs, eulerVaults, exactlyConfig, exactlyMarketByAddress, exactlyMarketByAsset, exactlyMarkets, exactlyMarketsByChain, fetchMainTokensMap, fetchRemoteJson, fetchTokenList, fetchTokenListFile, fetchTokenLists, findAaveV4PositionManager, fluidChains, fluidResolvers, fluidVaultEntries, fluidVaults, frankencoinChainData, frankencoinConfig, frankencoinConfigFor, frankencoinLendersByChain, frankencoinMarketByPosition, frankencoinMarkets, fraxlendConfig, fraxlendConfigFor, fraxlendLendersByChain, fraxlendPairKey, fraxlendPairsFor, gearboxAccountCompressor, gearboxAddressProviderV310, gearboxBotListV3, gearboxChains, gearboxMarketCompressor, gearboxMarketConfigurators, gearboxResolvers, gearboxV3LenderKey, getAaveV4GatewayAddresses, getAaveV4PositionManagers, getAaveV4SpokeAccess, getAaveV4SpokeEntry, getAaveV4SpokePeripherals, getChainEntries, getSiloV2MarketEntry, getSiloV3MarketEntry, initConfig, initializeChainData, initializeLenderData, inverseChainData, inverseConfig, inverseConfigFor, inverseLendersByChain, inverseMarketByAddress, inverseMarkets, isAaveV4OperationRestricted, isListaSmartLpAsset, liquityBranchByIndex, liquityBranchByTroveManager, liquityBranchesByChain, liquityConfig, liquityConfigFor, liquityLendersByChain, liquityMarkets, listaCollateralProvider, listaCollateralProviders, listaNativeProvider, listaSmartLpByCollateral, llamaLendApiBaseUrl, llamaLendChainData, llamaLendConfig, llamaLendConfigFor, llamaLendLenderKey, llamaLendLendersByChain, llamaLendLeverageZap, llamaLendMarketByController, llamaLendMarketByVault, llamaLendMarkets, llamaLendSupportsDelegation, llamaLendSupportsLeverage, loadCached, loadCachedJson, midnightApiBaseOverride, midnightConfig, midnightMarketById, midnightMarkets, midnightMarketsByChain, morphoBundler3, morphoOracles, morphoPools, morphoTypeMarkets, morphoTypeOracles, morphoTypeVaults, parseAaveV4SpokeLenderKey, parseFraxlendPairKey, parseGearboxV3LenderKey, parseLlamaLendLenderKey, parseSiloV2LenderKey, parseSiloV3LenderKey, parseTermMaxLenderKey, resolveMidnightApiBase, resolveTermApiBase, resolveTermOrderStoreBase, resupplyConfig, resupplyConfigFor, resupplyLendersByChain, riverChainData, riverConfig, riverConfigFor, riverLendersByChain, riverMarketByIndex, riverMarkets, setMidnightApiBase, setRemoteCacheGithubToken, setRemoteCacheStore, setTermApiBase, setTermOrderStoreBase, siloMarkets, siloMarketsV3, siloPeripherals, siloPeripheralsV3, siloV2LenderKey, siloV3LenderKey, skyChainData, skyConfig, skyConfigFor, skyLendersByChain, skyMarkets, tellerConfig, tellerConfigByChain, tellerPoolByAddress, tellerPools, tellerPoolsByChain, termApiBaseOverride, termConfig, termMarketById, termMarkets, termMarketsByChain, termMaxApiBaseUrl, termMaxChainIds, termMaxConfig, termMaxConfigByChain, termMaxLenderKey, termOrderStoreBaseOverride, twyneBaseKey, twyneBeaconFor, twyneChainData, twyneConfig, twyneConfigFor, twyneLendersByChain, twyneMarketByKey, twyneMarketFor, twyneMarketKey, twyneMarkets, twyneMarketsForIntermediateVault, twyneOperator, usddChainData, usddConfig, usddConfigFor, usddLendersByChain, usddMarketByIlk, usddMarkets };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Olympus Cooler V2 (MonoCooler) — Ethereum-only single-market CDP: gOHM
|
|
3
|
+
* collateral → USDS debt at a protocol-set rate, positions keyed by account
|
|
4
|
+
* address on ONE monolithic contract. `COOLER` is both the dispatch key and
|
|
5
|
+
* the market key — there is exactly one market and no roster to curate, so
|
|
6
|
+
* this module follows the Curvance built-in-seed pattern: published metadata
|
|
7
|
+
* wins if it ever exists, the built-in Ethereum row is the working fallback,
|
|
8
|
+
* and there is NO `coolerMarkets` registry slot.
|
|
9
|
+
*
|
|
10
|
+
* Address provenance: every address verified on-chain 2026-08-19 against the
|
|
11
|
+
* live MonoCooler's own getters (`collateralToken()`, `debtToken()`,
|
|
12
|
+
* `ltvOracle()`, `treasuryBorrower()`) — see OLYMPUS_COOLER.md. The debt
|
|
13
|
+
* token is governance-swappable via a new CoolerTreasuryBorrower, which is
|
|
14
|
+
* why fetchers must read `debtToken()` live and treat the seed's `usds` as
|
|
15
|
+
* a display/approval hint, not an invariant.
|
|
16
|
+
*/
|
|
17
|
+
export interface CoolerConfigChain {
|
|
18
|
+
/** The MonoCooler position book — the one write/read surface. */
|
|
19
|
+
monoCooler: string;
|
|
20
|
+
/** CoolerLtvOracle — the governance OLTV drip (prices, not ratios). */
|
|
21
|
+
ltvOracle: string;
|
|
22
|
+
/** CoolerTreasuryBorrower — funds borrows from TRSRY. */
|
|
23
|
+
treasuryBorrower: string;
|
|
24
|
+
/**
|
|
25
|
+
* CoolerV2Composites — Olympus's own atomic deposit+borrow /
|
|
26
|
+
* repay+withdraw batcher. `onlyEnabled` and owner-disableable: routes
|
|
27
|
+
* MUST read `isEnabled()` live and fall back to sequential when off.
|
|
28
|
+
* Acts strictly for `msg.sender`, so a user's authorization grant to it
|
|
29
|
+
* is only exercisable by the user's own calls.
|
|
30
|
+
*
|
|
31
|
+
* OPTIONAL: an absent router is the same case as a disabled one — the
|
|
32
|
+
* one-shots fall back to the sequential two-tx build either way.
|
|
33
|
+
*/
|
|
34
|
+
composites?: string;
|
|
35
|
+
/** Olympus treasury (TRSRY) — holds the sUSDS that caps instant borrows. */
|
|
36
|
+
treasury: string;
|
|
37
|
+
/** sUSDS — `maxWithdraw(treasury)` is the live borrow headroom. */
|
|
38
|
+
susds: string;
|
|
39
|
+
/** gOHM collateral token (18 dec). */
|
|
40
|
+
gohm: string;
|
|
41
|
+
/** USDS debt token AT SEED TIME (18 dec) — read `debtToken()` live. */
|
|
42
|
+
usds: string;
|
|
43
|
+
/** Debt-token decimals (MonoCooler math is WAD regardless). */
|
|
44
|
+
debtDecimals?: number;
|
|
45
|
+
}
|
|
46
|
+
export type CoolerConfigType = {
|
|
47
|
+
[lender: string]: {
|
|
48
|
+
[chainId: string]: CoolerConfigChain;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export declare const COOLER_ETHEREUM_CONFIG: CoolerConfigChain;
|
|
52
|
+
export declare const coolerConfig: () => CoolerConfigType;
|
|
53
|
+
/**
|
|
54
|
+
* Deployment config for the Cooler lender on a chain. Published metadata
|
|
55
|
+
* wins; the built-in Ethereum row is the fallback so the provider works
|
|
56
|
+
* with no `config/cooler.json` publish (none is planned — the deployment
|
|
57
|
+
* is a single immutable policy set).
|
|
58
|
+
*/
|
|
59
|
+
export declare const coolerConfigFor: (lender: string, chainId: string | number) => CoolerConfigChain | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* All Cooler lender keys with config on a chain (drives getLendersForChain).
|
|
62
|
+
* Gated on `monoCooler` — the one address everything bootstraps from.
|
|
63
|
+
*/
|
|
64
|
+
export declare const coolerLendersByChain: (chainId: string | number) => string[];
|
package/dist/lending/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ import type { GeneralReservesMap, OracleMap } from './common';
|
|
|
24
24
|
import type { CompoundV2OraclesConfigType, CompoundV2PoolsType, CompoundV2TokenArrayType, CompoundV2TokensType } from './compoundV2';
|
|
25
25
|
import type { CompoundV3BaseDataType, CompoundV3BulkerType, CompoundV3OracleDataMap, CompoundV3PoolsType } from './compoundV3';
|
|
26
26
|
import type { CurvanceConfigType } from './curvance';
|
|
27
|
+
import type { CoolerConfigType } from './cooler';
|
|
27
28
|
import type { TwyneConfigType, TwyneMarketsType } from './twyne';
|
|
28
29
|
import type { DolomiteConfigsType, DolomiteEmodeType } from './dolomite';
|
|
29
30
|
import type { UsddConfigType, UsddMarketsType } from './dss';
|
|
@@ -106,6 +107,7 @@ export interface GlobalLenderDataRegistry {
|
|
|
106
107
|
llamaLendMarkets: LlamaLendMarketsType;
|
|
107
108
|
resupplyConfig: ResupplyConfigType;
|
|
108
109
|
curvanceConfig: CurvanceConfigType;
|
|
110
|
+
coolerConfig: CoolerConfigType;
|
|
109
111
|
twyneConfig: TwyneConfigType;
|
|
110
112
|
twyneMarkets: TwyneMarketsType;
|
|
111
113
|
fraxlendConfig: FraxlendConfigType;
|
package/dist/lending/term.d.ts
CHANGED
|
@@ -14,6 +14,14 @@ export type TermConfigChain = {
|
|
|
14
14
|
priceOracle?: string | null;
|
|
15
15
|
/** Term data endpoint base (subgraph/HTTP) for listings + auction state. */
|
|
16
16
|
apiBaseUrl?: string | null;
|
|
17
|
+
/** Terminal 1 order-store REST base (fill-now limit orders). */
|
|
18
|
+
orderStoreUrl?: string | null;
|
|
19
|
+
/** Terminal 1 intent diamond override. Normally resolved LIVE from the
|
|
20
|
+
* subgraph (`termDiamonds`) — the diamond is upgradeable and per-chain, so a
|
|
21
|
+
* pin can go stale; this field exists for tests/emergencies only. */
|
|
22
|
+
intentDiamond?: string | null;
|
|
23
|
+
/** EIP-712 domain version of the Terminal 1 diamond (order signing). */
|
|
24
|
+
eip712DomainVersion?: string | null;
|
|
17
25
|
};
|
|
18
26
|
export type TermConfigType = {
|
|
19
27
|
[chainId: string]: TermConfigChain;
|
|
@@ -75,6 +83,15 @@ export declare const termApiBaseOverride: () => string | undefined;
|
|
|
75
83
|
* source configured" and callers fall back to static config / on-chain reads.
|
|
76
84
|
*/
|
|
77
85
|
export declare const resolveTermApiBase: (chainId: string) => string;
|
|
86
|
+
export declare const setTermOrderStoreBase: (url: string | undefined | null) => void;
|
|
87
|
+
export declare const termOrderStoreBaseOverride: () => string | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* Resolve the Terminal 1 order-store base for a chain: override → config → ''.
|
|
90
|
+
* Unlike the subgraph base, consumers fall back to the public hosted store
|
|
91
|
+
* (`https://api.global.termfinance.io/protocol`) when this is empty — the
|
|
92
|
+
* constant lives with the fetcher (margin-fetcher / worker-api), not here.
|
|
93
|
+
*/
|
|
94
|
+
export declare const resolveTermOrderStoreBase: (chainId: string) => string;
|
|
78
95
|
export declare const termMarkets: () => TermMarketsType;
|
|
79
96
|
/** All Term Finance market configs on a chain (empty array if none/unloaded). */
|
|
80
97
|
export declare const termMarketsByChain: (chainId: string | number) => TermMarketConfig[];
|