@1delta/data-sdk 0.0.51 → 0.0.52
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 +25 -0
- package/dist/index.mjs +21 -1
- package/dist/lending/flyingTulip.d.ts +91 -0
- package/dist/lending/index.d.ts +1 -0
- package/dist/lending/registry.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -77,6 +77,8 @@ var LENDER_DATA_DEFAULTS = () => ({
|
|
|
77
77
|
termMaxConfig: {},
|
|
78
78
|
exactlyConfig: {},
|
|
79
79
|
exactlyMarkets: {},
|
|
80
|
+
flyingTulipConfig: {},
|
|
81
|
+
flyingTulipAssets: {},
|
|
80
82
|
tellerConfig: {},
|
|
81
83
|
tellerPools: {},
|
|
82
84
|
liquityConfig: {},
|
|
@@ -340,6 +342,24 @@ var isListaSmartLpAsset = (entry, asset) => {
|
|
|
340
342
|
);
|
|
341
343
|
};
|
|
342
344
|
|
|
345
|
+
// src/lending/flyingTulip.ts
|
|
346
|
+
var flyingTulipConfig = () => getGlobalData2()?.flyingTulipConfig;
|
|
347
|
+
var flyingTulipAssets = () => getGlobalData2()?.flyingTulipAssets;
|
|
348
|
+
var flyingTulipConfigFor = (lender, chainId) => getGlobalData2()?.flyingTulipConfig?.[lender]?.[String(chainId)];
|
|
349
|
+
var flyingTulipAssetsFor = (lender, chainId) => getGlobalData2()?.flyingTulipAssets?.[lender]?.[String(chainId)];
|
|
350
|
+
var flyingTulipLendersByChain = (chainId) => {
|
|
351
|
+
const chain = String(chainId);
|
|
352
|
+
const cfg = getGlobalData2()?.flyingTulipConfig ?? {};
|
|
353
|
+
const rosters = getGlobalData2()?.flyingTulipAssets ?? {};
|
|
354
|
+
const keys = [];
|
|
355
|
+
for (const lender of Object.keys(cfg)) {
|
|
356
|
+
if (cfg[lender]?.[chain]?.lendingLens && (rosters[lender]?.[chain]?.assets?.length ?? 0) > 0) {
|
|
357
|
+
keys.push(lender);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
return keys;
|
|
361
|
+
};
|
|
362
|
+
|
|
343
363
|
// src/lending/midnight.ts
|
|
344
364
|
var midnightConfig = () => getGlobalData2()?.midnightConfig;
|
|
345
365
|
var MIDNIGHT_API_OVERRIDE_KEY = "__1delta_midnight_api_base__";
|
|
@@ -1213,6 +1233,11 @@ exports.fluidChains = fluidChains;
|
|
|
1213
1233
|
exports.fluidResolvers = fluidResolvers;
|
|
1214
1234
|
exports.fluidVaultEntries = fluidVaultEntries;
|
|
1215
1235
|
exports.fluidVaults = fluidVaults;
|
|
1236
|
+
exports.flyingTulipAssets = flyingTulipAssets;
|
|
1237
|
+
exports.flyingTulipAssetsFor = flyingTulipAssetsFor;
|
|
1238
|
+
exports.flyingTulipConfig = flyingTulipConfig;
|
|
1239
|
+
exports.flyingTulipConfigFor = flyingTulipConfigFor;
|
|
1240
|
+
exports.flyingTulipLendersByChain = flyingTulipLendersByChain;
|
|
1216
1241
|
exports.frankencoinChainData = frankencoinChainData;
|
|
1217
1242
|
exports.frankencoinConfig = frankencoinConfig;
|
|
1218
1243
|
exports.frankencoinConfigFor = frankencoinConfigFor;
|
package/dist/index.mjs
CHANGED
|
@@ -75,6 +75,8 @@ var LENDER_DATA_DEFAULTS = () => ({
|
|
|
75
75
|
termMaxConfig: {},
|
|
76
76
|
exactlyConfig: {},
|
|
77
77
|
exactlyMarkets: {},
|
|
78
|
+
flyingTulipConfig: {},
|
|
79
|
+
flyingTulipAssets: {},
|
|
78
80
|
tellerConfig: {},
|
|
79
81
|
tellerPools: {},
|
|
80
82
|
liquityConfig: {},
|
|
@@ -338,6 +340,24 @@ var isListaSmartLpAsset = (entry, asset) => {
|
|
|
338
340
|
);
|
|
339
341
|
};
|
|
340
342
|
|
|
343
|
+
// src/lending/flyingTulip.ts
|
|
344
|
+
var flyingTulipConfig = () => getGlobalData2()?.flyingTulipConfig;
|
|
345
|
+
var flyingTulipAssets = () => getGlobalData2()?.flyingTulipAssets;
|
|
346
|
+
var flyingTulipConfigFor = (lender, chainId) => getGlobalData2()?.flyingTulipConfig?.[lender]?.[String(chainId)];
|
|
347
|
+
var flyingTulipAssetsFor = (lender, chainId) => getGlobalData2()?.flyingTulipAssets?.[lender]?.[String(chainId)];
|
|
348
|
+
var flyingTulipLendersByChain = (chainId) => {
|
|
349
|
+
const chain = String(chainId);
|
|
350
|
+
const cfg = getGlobalData2()?.flyingTulipConfig ?? {};
|
|
351
|
+
const rosters = getGlobalData2()?.flyingTulipAssets ?? {};
|
|
352
|
+
const keys = [];
|
|
353
|
+
for (const lender of Object.keys(cfg)) {
|
|
354
|
+
if (cfg[lender]?.[chain]?.lendingLens && (rosters[lender]?.[chain]?.assets?.length ?? 0) > 0) {
|
|
355
|
+
keys.push(lender);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return keys;
|
|
359
|
+
};
|
|
360
|
+
|
|
341
361
|
// src/lending/midnight.ts
|
|
342
362
|
var midnightConfig = () => getGlobalData2()?.midnightConfig;
|
|
343
363
|
var MIDNIGHT_API_OVERRIDE_KEY = "__1delta_midnight_api_base__";
|
|
@@ -1145,4 +1165,4 @@ async function fetchMainTokensMap() {
|
|
|
1145
1165
|
}
|
|
1146
1166
|
}
|
|
1147
1167
|
|
|
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 };
|
|
1168
|
+
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, flyingTulipAssets, flyingTulipAssetsFor, flyingTulipConfig, flyingTulipConfigFor, flyingTulipLendersByChain, 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,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flying Tulip — Andre Cronje's CEX-style CROSS-MARGIN lender on Ethereum (1)
|
|
3
|
+
* and Sonic (146). One `PositionsManager` per chain holds every asset and
|
|
4
|
+
* health is one global check, so `FLYING_TULIP` is both the dispatch key and
|
|
5
|
+
* the market key (the collapsed Exactly shape — see FLYING_TULIP.md).
|
|
6
|
+
*
|
|
7
|
+
* Two published files, both prerequisites (no built-in seed — the risk knobs
|
|
8
|
+
* are one ungated Safe call from moving and the two chains already disagree,
|
|
9
|
+
* so pinning them here is how a stale number outlives a live change):
|
|
10
|
+
* - `config/flying-tulip.json` — per-chain protocol addresses (CREATE2, so
|
|
11
|
+
* address-identical across chains — but NEVER config-identical).
|
|
12
|
+
* - `data/flying-tulip-assets.json` — the `AssetSet`-log-discovered roster
|
|
13
|
+
* plus the per-chain margin knobs, regenerated by lender-metadata's
|
|
14
|
+
* `update:flying-tulip`.
|
|
15
|
+
*/
|
|
16
|
+
export interface FlyingTulipConfigChain {
|
|
17
|
+
/** The one position book per chain — every deposit/borrow write target. */
|
|
18
|
+
positionsManager: string;
|
|
19
|
+
/** LendingLens — the whole public read surface (state, cfg, caps, prices). */
|
|
20
|
+
lendingLens: string;
|
|
21
|
+
/** ConfigRegistry (UNVERIFIED impl) — mmBps, caps, pauses, both HF gates. */
|
|
22
|
+
configRegistry: string;
|
|
23
|
+
/** AccountValuesLens — equity/maint/HF incl. `enginePnLUSDWad`. */
|
|
24
|
+
accountValuesLens: string;
|
|
25
|
+
/** OracleRouter behind the lens's `priceAndDecimals`. */
|
|
26
|
+
oracleRouter: string;
|
|
27
|
+
/** FT token — `collateral: false, mmBps: 0`, unpriceable on-protocol. */
|
|
28
|
+
ft: string;
|
|
29
|
+
/** ftUSD. */
|
|
30
|
+
ftUSD: string;
|
|
31
|
+
/** Registered engines (RFQ / meta-tx); informational for public data. */
|
|
32
|
+
engines?: {
|
|
33
|
+
[name: string]: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export type FlyingTulipConfigType = {
|
|
37
|
+
[lender: string]: {
|
|
38
|
+
[chainId: string]: FlyingTulipConfigChain;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
/** One roster row: the log-discovered listing + a config snapshot. Values are
|
|
42
|
+
* a SNAPSHOT for display/fallback — fetchers read the live `assetCfg`. */
|
|
43
|
+
export interface FlyingTulipAssetRow {
|
|
44
|
+
address: string;
|
|
45
|
+
symbol: string;
|
|
46
|
+
name: string;
|
|
47
|
+
decimals: number;
|
|
48
|
+
irm: string;
|
|
49
|
+
mmBps: number;
|
|
50
|
+
enabled: boolean;
|
|
51
|
+
borrowable: boolean;
|
|
52
|
+
collateral: boolean;
|
|
53
|
+
supplyCap: string;
|
|
54
|
+
borrowCap: string;
|
|
55
|
+
depositPaused: boolean;
|
|
56
|
+
withdrawPaused: boolean;
|
|
57
|
+
borrowPaused: boolean;
|
|
58
|
+
/** false ⇒ the protocol oracle reverts for it (FT itself). NEVER batch an
|
|
59
|
+
* unpriceable asset into `pricesUSD` — the lens loops without a per-item
|
|
60
|
+
* catch, so one bad asset poisons the whole call. */
|
|
61
|
+
priceable: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface FlyingTulipAssetsChain {
|
|
64
|
+
/** Open gate: new borrows/withdrawals must leave HF ≥ this (1e4). */
|
|
65
|
+
marginHfSafeBps: number;
|
|
66
|
+
/** Liquidation trigger: HF < this (1e4) — 12500, NOT 10000. */
|
|
67
|
+
marginHfTargetBps: number;
|
|
68
|
+
/** Minimum account equity while any debt exists — PER CHAIN (wad). */
|
|
69
|
+
marginMinEquityUSDWad: string;
|
|
70
|
+
oracleRouter: string;
|
|
71
|
+
assets: FlyingTulipAssetRow[];
|
|
72
|
+
}
|
|
73
|
+
export type FlyingTulipAssetsType = {
|
|
74
|
+
[lender: string]: {
|
|
75
|
+
[chainId: string]: FlyingTulipAssetsChain;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export declare const flyingTulipConfig: () => FlyingTulipConfigType;
|
|
79
|
+
export declare const flyingTulipAssets: () => FlyingTulipAssetsType;
|
|
80
|
+
/** Deployment config for a Flying Tulip lender key on a chain. */
|
|
81
|
+
export declare const flyingTulipConfigFor: (lender: string, chainId: string | number) => FlyingTulipConfigChain | undefined;
|
|
82
|
+
/** Roster + margin knobs for a Flying Tulip lender key on a chain. */
|
|
83
|
+
export declare const flyingTulipAssetsFor: (lender: string, chainId: string | number) => FlyingTulipAssetsChain | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* All Flying Tulip lender keys with a working deployment on a chain (drives
|
|
86
|
+
* `getLendersForChain`). Gated on BOTH published files: the lens address is
|
|
87
|
+
* what every read bootstraps from, and an empty roster means nothing to fetch
|
|
88
|
+
* — either absent must mean the lender is dark on that chain, never a key
|
|
89
|
+
* that fans out into zero-asset entries.
|
|
90
|
+
*/
|
|
91
|
+
export declare const flyingTulipLendersByChain: (chainId: string | number) => string[];
|
package/dist/lending/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ import type { UsddConfigType, UsddMarketsType } from './dss';
|
|
|
31
31
|
import type { EulerConfigsType, EulerVaultsType } from './euler';
|
|
32
32
|
import type { ExactlyConfigType, ExactlyMarketsType } from './exactly';
|
|
33
33
|
import type { FluidResolversType, FluidVaultsType } from './fluid';
|
|
34
|
+
import type { FlyingTulipAssetsType, FlyingTulipConfigType } from './flyingTulip';
|
|
34
35
|
import type { FrankencoinConfigType, FrankencoinMarketsType } from './frankencoin';
|
|
35
36
|
import type { GearboxResolversType } from './gearbox';
|
|
36
37
|
import type { InitConfigType } from './initProtocol';
|
|
@@ -89,6 +90,8 @@ export interface GlobalLenderDataRegistry {
|
|
|
89
90
|
termMaxConfig: TermMaxConfigType;
|
|
90
91
|
exactlyConfig: ExactlyConfigType;
|
|
91
92
|
exactlyMarkets: ExactlyMarketsType;
|
|
93
|
+
flyingTulipConfig: FlyingTulipConfigType;
|
|
94
|
+
flyingTulipAssets: FlyingTulipAssetsType;
|
|
92
95
|
tellerConfig: TellerConfigType;
|
|
93
96
|
tellerPools: TellerPoolsType;
|
|
94
97
|
liquityConfig: LiquityConfigType;
|