@1delta/data-sdk 0.0.60 → 0.0.61
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 +158 -0
- package/dist/index.mjs +147 -1
- package/dist/lending/alchemix.d.ts +57 -0
- package/dist/lending/index.d.ts +1 -0
- package/dist/lending/registry.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -99,6 +99,7 @@ var LENDER_DATA_DEFAULTS = () => ({
|
|
|
99
99
|
curvanceConfig: {},
|
|
100
100
|
coolerConfig: {},
|
|
101
101
|
ripeConfig: {},
|
|
102
|
+
alchemixConfig: {},
|
|
102
103
|
twyneConfig: {},
|
|
103
104
|
twyneMarkets: {},
|
|
104
105
|
fraxlendConfig: {},
|
|
@@ -934,6 +935,151 @@ var ripeLendersByChain = (chainId) => {
|
|
|
934
935
|
return [...keys];
|
|
935
936
|
};
|
|
936
937
|
|
|
938
|
+
// src/lending/alchemix.ts
|
|
939
|
+
var ALCHEMIX_ETHEREUM_CONFIG = {
|
|
940
|
+
markets: [
|
|
941
|
+
{
|
|
942
|
+
alchemist: "0xfa995B6ABc387376C3e7De5f6d394Ab5B6beE26B",
|
|
943
|
+
positionNft: "0x15da4c7db6404b92894d5214FAc92057Fb8a263d",
|
|
944
|
+
myt: "0x29bcfeD246ce37319d94eBa107db90C453D4c43D",
|
|
945
|
+
debtToken: "0x0100546F2cD4C9D97f798fFC9755E47865FF7Ee6",
|
|
946
|
+
underlying: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
|
947
|
+
transmuter: "0x073598132f37756a7E665FB52f1757463120bd3C",
|
|
948
|
+
router: "0xDb852896A23c7E2519b75AeA692caCf834d086Ab",
|
|
949
|
+
mytSymbol: "mixWETH",
|
|
950
|
+
debtSymbol: "alETH",
|
|
951
|
+
isEth: true
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
alchemist: "0xeB83112d925268BeDe86654C13D423a987587e3E",
|
|
955
|
+
positionNft: "0x872a03FabC86b59c883CD9c439E969321b719bEB",
|
|
956
|
+
myt: "0x9B44efCa3e2a707B63Dc00CE79d646E5E5D24bA5",
|
|
957
|
+
debtToken: "0xBC6DA0FE9aD5f3b0d58160288917AA56653660E9",
|
|
958
|
+
underlying: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
959
|
+
transmuter: "0x2584E8b0616b3E750492c9629a3b27679C410cb9",
|
|
960
|
+
router: "0x6733Aa6b2A622e43e8fF61945E8Fbe5f1b6b00FD",
|
|
961
|
+
mytSymbol: "mixUSDC",
|
|
962
|
+
debtSymbol: "alUSD",
|
|
963
|
+
isEth: false
|
|
964
|
+
}
|
|
965
|
+
]
|
|
966
|
+
};
|
|
967
|
+
var ALCHEMIX_OPTIMISM_CONFIG = {
|
|
968
|
+
markets: [
|
|
969
|
+
{
|
|
970
|
+
alchemist: "0xDeD3A04612FF12b57317abE38e68026Fc9D28114",
|
|
971
|
+
positionNft: "0x763F5d567403add750e13234DB896CFe6b423059",
|
|
972
|
+
myt: "0x91b8657aea26Caa8A0E9D6DD4E24727Ccf32F822",
|
|
973
|
+
debtToken: "0x3E29D3A9316dAB217754d13b28646B76607c5f04",
|
|
974
|
+
underlying: "0x4200000000000000000000000000000000000006",
|
|
975
|
+
transmuter: "0x2584E8b0616b3E750492c9629a3b27679C410cb9",
|
|
976
|
+
router: "0xC774F30484818F06a261A89A1d66367e6BBE3e5A",
|
|
977
|
+
mytSymbol: "mixWETH",
|
|
978
|
+
debtSymbol: "alETH",
|
|
979
|
+
isEth: true
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
alchemist: "0x930750a3510E703535e943E826ABa3c364fFC1De",
|
|
983
|
+
positionNft: "0xF700c7e40efCA6f7a810e172AFCee3592ff4aD33",
|
|
984
|
+
myt: "0xAf510a560744880410f0f65e3341A020FBC2cA41",
|
|
985
|
+
debtToken: "0xCB8FA9a76b8e203D8C3797bF438d8FB81Ea3326A",
|
|
986
|
+
underlying: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
|
|
987
|
+
transmuter: "0x693b7594Ae0633d9c5574D0da46a040f92F5b281",
|
|
988
|
+
router: "0x3c0546587d27354635a4972390a7B96F962d8BBd",
|
|
989
|
+
mytSymbol: "mixUSDC",
|
|
990
|
+
debtSymbol: "alUSD",
|
|
991
|
+
isEth: false
|
|
992
|
+
}
|
|
993
|
+
]
|
|
994
|
+
};
|
|
995
|
+
var ALCHEMIX_ARBITRUM_CONFIG = {
|
|
996
|
+
markets: [
|
|
997
|
+
{
|
|
998
|
+
alchemist: "0xDeD3A04612FF12b57317abE38e68026Fc9D28114",
|
|
999
|
+
positionNft: "0x763F5d567403add750e13234DB896CFe6b423059",
|
|
1000
|
+
myt: "0xfe8F223F3d81462F55bf8609897B8cEcfA4B195C",
|
|
1001
|
+
debtToken: "0x17573150d67d820542EFb24210371545a4868B03",
|
|
1002
|
+
underlying: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
|
|
1003
|
+
transmuter: "0x2584E8b0616b3E750492c9629a3b27679C410cb9",
|
|
1004
|
+
router: "0xC774F30484818F06a261A89A1d66367e6BBE3e5A",
|
|
1005
|
+
mytSymbol: "mixWETH",
|
|
1006
|
+
debtSymbol: "alETH",
|
|
1007
|
+
isEth: true
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
// `loansPaused` at integration — served (repay/withdraw must keep
|
|
1011
|
+
// working for existing positions); borrows refuse off the live flag.
|
|
1012
|
+
alchemist: "0x930750a3510E703535e943E826ABa3c364fFC1De",
|
|
1013
|
+
positionNft: "0xF700c7e40efCA6f7a810e172AFCee3592ff4aD33",
|
|
1014
|
+
myt: "0xEba62B842081CeF5a8184318Dc5C4E4aACa9f651",
|
|
1015
|
+
debtToken: "0xCB8FA9a76b8e203D8C3797bF438d8FB81Ea3326A",
|
|
1016
|
+
underlying: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
1017
|
+
transmuter: "0x693b7594Ae0633d9c5574D0da46a040f92F5b281",
|
|
1018
|
+
router: "0x3c0546587d27354635a4972390a7B96F962d8BBd",
|
|
1019
|
+
mytSymbol: "mixUSDC",
|
|
1020
|
+
debtSymbol: "alUSD",
|
|
1021
|
+
isEth: false
|
|
1022
|
+
}
|
|
1023
|
+
]
|
|
1024
|
+
};
|
|
1025
|
+
var ALCHEMIX_BASE_CONFIG = {
|
|
1026
|
+
markets: [
|
|
1027
|
+
{
|
|
1028
|
+
alchemist: "0xEb380d86EeD275C9F2eD77745aB1B2ccf364BF7A",
|
|
1029
|
+
positionNft: "0xDeD3A04612FF12b57317abE38e68026Fc9D28114",
|
|
1030
|
+
myt: "0xb8BeFE5a6941ca4022a52042075ff269C3C67467",
|
|
1031
|
+
debtToken: "0x877014E21c32feA108B6A1f45f367efc9a2d9B9F",
|
|
1032
|
+
underlying: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
1033
|
+
transmuter: "0x5B1c7180C630d3B2b6782Df70f43aE5Ea80425ba",
|
|
1034
|
+
router: "0x720D1F945279A6D82EeDcC9B7f85767279Ea2F96",
|
|
1035
|
+
mytSymbol: "mixUSDC",
|
|
1036
|
+
debtSymbol: "alUSDb",
|
|
1037
|
+
isEth: false
|
|
1038
|
+
}
|
|
1039
|
+
]
|
|
1040
|
+
};
|
|
1041
|
+
var ALCHEMIX_BUILTIN = {
|
|
1042
|
+
ALCHEMIX: {
|
|
1043
|
+
"1": ALCHEMIX_ETHEREUM_CONFIG,
|
|
1044
|
+
"10": ALCHEMIX_OPTIMISM_CONFIG,
|
|
1045
|
+
"42161": ALCHEMIX_ARBITRUM_CONFIG,
|
|
1046
|
+
"8453": ALCHEMIX_BASE_CONFIG
|
|
1047
|
+
}
|
|
1048
|
+
};
|
|
1049
|
+
var alchemixConfig = () => getGlobalData2()?.alchemixConfig;
|
|
1050
|
+
var alchemixBaseKey = (lender) => lender?.toUpperCase().startsWith("ALCHEMIX") ? "ALCHEMIX" : lender;
|
|
1051
|
+
var alchemixConfigFor = (lender, chainId) => {
|
|
1052
|
+
const base = alchemixBaseKey(lender);
|
|
1053
|
+
const published = getGlobalData2()?.alchemixConfig?.[base]?.[String(chainId)];
|
|
1054
|
+
if (published?.markets?.length) return published;
|
|
1055
|
+
return ALCHEMIX_BUILTIN[base]?.[String(chainId)];
|
|
1056
|
+
};
|
|
1057
|
+
var alchemixMarketsFor = (lender, chainId) => alchemixConfigFor(lender, chainId)?.markets ?? [];
|
|
1058
|
+
var alchemixLendersByChain = (chainId) => {
|
|
1059
|
+
const chain = String(chainId);
|
|
1060
|
+
const cfg = getGlobalData2()?.alchemixConfig ?? {};
|
|
1061
|
+
const keys = /* @__PURE__ */ new Set();
|
|
1062
|
+
for (const lender of Object.keys(cfg)) {
|
|
1063
|
+
if (cfg[lender]?.[chain]?.markets?.length) keys.add(lender);
|
|
1064
|
+
}
|
|
1065
|
+
for (const lender of Object.keys(ALCHEMIX_BUILTIN)) {
|
|
1066
|
+
if (ALCHEMIX_BUILTIN[lender]?.[chain]?.markets?.length) keys.add(lender);
|
|
1067
|
+
}
|
|
1068
|
+
return [...keys];
|
|
1069
|
+
};
|
|
1070
|
+
var alchemixMarketKey = (chainId, alchemist) => `ALCHEMIX_${String(chainId)}_${alchemist.replace(/^0x/i, "").toUpperCase()}`;
|
|
1071
|
+
var parseAlchemixMarketKey = (lender) => {
|
|
1072
|
+
const m = /^ALCHEMIX_(\d+)_(?:0x)?([0-9a-fA-F]{40})$/i.exec(lender ?? "");
|
|
1073
|
+
if (!m) return void 0;
|
|
1074
|
+
return { chainId: m[1], alchemist: `0x${m[2].toLowerCase()}` };
|
|
1075
|
+
};
|
|
1076
|
+
var alchemixMarketByKey = (lender, chainId) => {
|
|
1077
|
+
const parsed = parseAlchemixMarketKey(lender);
|
|
1078
|
+
if (!parsed) return void 0;
|
|
1079
|
+
if (chainId !== void 0 && String(chainId) !== parsed.chainId) return void 0;
|
|
1080
|
+
return alchemixMarketsFor("ALCHEMIX", parsed.chainId).find((m) => m.alchemist.toLowerCase() === parsed.alchemist);
|
|
1081
|
+
};
|
|
1082
|
+
|
|
937
1083
|
// src/lending/twyne.ts
|
|
938
1084
|
var twyneConfig = () => getGlobalData2()?.twyneConfig;
|
|
939
1085
|
var twyneConfigFor = (lender, chainId) => getGlobalData2()?.twyneConfig?.[twyneBaseKey(lender)]?.[String(chainId)];
|
|
@@ -1381,6 +1527,10 @@ async function fetchMainTokensMap() {
|
|
|
1381
1527
|
}
|
|
1382
1528
|
}
|
|
1383
1529
|
|
|
1530
|
+
exports.ALCHEMIX_ARBITRUM_CONFIG = ALCHEMIX_ARBITRUM_CONFIG;
|
|
1531
|
+
exports.ALCHEMIX_BASE_CONFIG = ALCHEMIX_BASE_CONFIG;
|
|
1532
|
+
exports.ALCHEMIX_ETHEREUM_CONFIG = ALCHEMIX_ETHEREUM_CONFIG;
|
|
1533
|
+
exports.ALCHEMIX_OPTIMISM_CONFIG = ALCHEMIX_OPTIMISM_CONFIG;
|
|
1384
1534
|
exports.COOLER_ETHEREUM_CONFIG = COOLER_ETHEREUM_CONFIG;
|
|
1385
1535
|
exports.CURVANCE_MONAD_CONFIG = CURVANCE_MONAD_CONFIG;
|
|
1386
1536
|
exports.DOLOMITE_ROUTER_DEFAULTS = DOLOMITE_ROUTER_DEFAULTS;
|
|
@@ -1402,6 +1552,13 @@ exports.aaveV4Peripherals = aaveV4Peripherals;
|
|
|
1402
1552
|
exports.aaveV4SpokeLenderKey = aaveV4SpokeLenderKey;
|
|
1403
1553
|
exports.aaveV4Spokes = aaveV4Spokes;
|
|
1404
1554
|
exports.aaveWethGateway = aaveWethGateway;
|
|
1555
|
+
exports.alchemixBaseKey = alchemixBaseKey;
|
|
1556
|
+
exports.alchemixConfig = alchemixConfig;
|
|
1557
|
+
exports.alchemixConfigFor = alchemixConfigFor;
|
|
1558
|
+
exports.alchemixLendersByChain = alchemixLendersByChain;
|
|
1559
|
+
exports.alchemixMarketByKey = alchemixMarketByKey;
|
|
1560
|
+
exports.alchemixMarketKey = alchemixMarketKey;
|
|
1561
|
+
exports.alchemixMarketsFor = alchemixMarketsFor;
|
|
1405
1562
|
exports.assertTwyneKeysUnique = assertTwyneKeysUnique;
|
|
1406
1563
|
exports.chainLogoURI = chainLogoURI;
|
|
1407
1564
|
exports.chains = chains;
|
|
@@ -1540,6 +1697,7 @@ exports.morphoTypeMarkets = morphoTypeMarkets;
|
|
|
1540
1697
|
exports.morphoTypeOracles = morphoTypeOracles;
|
|
1541
1698
|
exports.morphoTypeVaults = morphoTypeVaults;
|
|
1542
1699
|
exports.parseAaveV4SpokeLenderKey = parseAaveV4SpokeLenderKey;
|
|
1700
|
+
exports.parseAlchemixMarketKey = parseAlchemixMarketKey;
|
|
1543
1701
|
exports.parseFraxlendPairKey = parseFraxlendPairKey;
|
|
1544
1702
|
exports.parseGearboxV3LenderKey = parseGearboxV3LenderKey;
|
|
1545
1703
|
exports.parseLlamaLendLenderKey = parseLlamaLendLenderKey;
|
package/dist/index.mjs
CHANGED
|
@@ -97,6 +97,7 @@ var LENDER_DATA_DEFAULTS = () => ({
|
|
|
97
97
|
curvanceConfig: {},
|
|
98
98
|
coolerConfig: {},
|
|
99
99
|
ripeConfig: {},
|
|
100
|
+
alchemixConfig: {},
|
|
100
101
|
twyneConfig: {},
|
|
101
102
|
twyneMarkets: {},
|
|
102
103
|
fraxlendConfig: {},
|
|
@@ -932,6 +933,151 @@ var ripeLendersByChain = (chainId) => {
|
|
|
932
933
|
return [...keys];
|
|
933
934
|
};
|
|
934
935
|
|
|
936
|
+
// src/lending/alchemix.ts
|
|
937
|
+
var ALCHEMIX_ETHEREUM_CONFIG = {
|
|
938
|
+
markets: [
|
|
939
|
+
{
|
|
940
|
+
alchemist: "0xfa995B6ABc387376C3e7De5f6d394Ab5B6beE26B",
|
|
941
|
+
positionNft: "0x15da4c7db6404b92894d5214FAc92057Fb8a263d",
|
|
942
|
+
myt: "0x29bcfeD246ce37319d94eBa107db90C453D4c43D",
|
|
943
|
+
debtToken: "0x0100546F2cD4C9D97f798fFC9755E47865FF7Ee6",
|
|
944
|
+
underlying: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
|
945
|
+
transmuter: "0x073598132f37756a7E665FB52f1757463120bd3C",
|
|
946
|
+
router: "0xDb852896A23c7E2519b75AeA692caCf834d086Ab",
|
|
947
|
+
mytSymbol: "mixWETH",
|
|
948
|
+
debtSymbol: "alETH",
|
|
949
|
+
isEth: true
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
alchemist: "0xeB83112d925268BeDe86654C13D423a987587e3E",
|
|
953
|
+
positionNft: "0x872a03FabC86b59c883CD9c439E969321b719bEB",
|
|
954
|
+
myt: "0x9B44efCa3e2a707B63Dc00CE79d646E5E5D24bA5",
|
|
955
|
+
debtToken: "0xBC6DA0FE9aD5f3b0d58160288917AA56653660E9",
|
|
956
|
+
underlying: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
957
|
+
transmuter: "0x2584E8b0616b3E750492c9629a3b27679C410cb9",
|
|
958
|
+
router: "0x6733Aa6b2A622e43e8fF61945E8Fbe5f1b6b00FD",
|
|
959
|
+
mytSymbol: "mixUSDC",
|
|
960
|
+
debtSymbol: "alUSD",
|
|
961
|
+
isEth: false
|
|
962
|
+
}
|
|
963
|
+
]
|
|
964
|
+
};
|
|
965
|
+
var ALCHEMIX_OPTIMISM_CONFIG = {
|
|
966
|
+
markets: [
|
|
967
|
+
{
|
|
968
|
+
alchemist: "0xDeD3A04612FF12b57317abE38e68026Fc9D28114",
|
|
969
|
+
positionNft: "0x763F5d567403add750e13234DB896CFe6b423059",
|
|
970
|
+
myt: "0x91b8657aea26Caa8A0E9D6DD4E24727Ccf32F822",
|
|
971
|
+
debtToken: "0x3E29D3A9316dAB217754d13b28646B76607c5f04",
|
|
972
|
+
underlying: "0x4200000000000000000000000000000000000006",
|
|
973
|
+
transmuter: "0x2584E8b0616b3E750492c9629a3b27679C410cb9",
|
|
974
|
+
router: "0xC774F30484818F06a261A89A1d66367e6BBE3e5A",
|
|
975
|
+
mytSymbol: "mixWETH",
|
|
976
|
+
debtSymbol: "alETH",
|
|
977
|
+
isEth: true
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
alchemist: "0x930750a3510E703535e943E826ABa3c364fFC1De",
|
|
981
|
+
positionNft: "0xF700c7e40efCA6f7a810e172AFCee3592ff4aD33",
|
|
982
|
+
myt: "0xAf510a560744880410f0f65e3341A020FBC2cA41",
|
|
983
|
+
debtToken: "0xCB8FA9a76b8e203D8C3797bF438d8FB81Ea3326A",
|
|
984
|
+
underlying: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
|
|
985
|
+
transmuter: "0x693b7594Ae0633d9c5574D0da46a040f92F5b281",
|
|
986
|
+
router: "0x3c0546587d27354635a4972390a7B96F962d8BBd",
|
|
987
|
+
mytSymbol: "mixUSDC",
|
|
988
|
+
debtSymbol: "alUSD",
|
|
989
|
+
isEth: false
|
|
990
|
+
}
|
|
991
|
+
]
|
|
992
|
+
};
|
|
993
|
+
var ALCHEMIX_ARBITRUM_CONFIG = {
|
|
994
|
+
markets: [
|
|
995
|
+
{
|
|
996
|
+
alchemist: "0xDeD3A04612FF12b57317abE38e68026Fc9D28114",
|
|
997
|
+
positionNft: "0x763F5d567403add750e13234DB896CFe6b423059",
|
|
998
|
+
myt: "0xfe8F223F3d81462F55bf8609897B8cEcfA4B195C",
|
|
999
|
+
debtToken: "0x17573150d67d820542EFb24210371545a4868B03",
|
|
1000
|
+
underlying: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
|
|
1001
|
+
transmuter: "0x2584E8b0616b3E750492c9629a3b27679C410cb9",
|
|
1002
|
+
router: "0xC774F30484818F06a261A89A1d66367e6BBE3e5A",
|
|
1003
|
+
mytSymbol: "mixWETH",
|
|
1004
|
+
debtSymbol: "alETH",
|
|
1005
|
+
isEth: true
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
// `loansPaused` at integration — served (repay/withdraw must keep
|
|
1009
|
+
// working for existing positions); borrows refuse off the live flag.
|
|
1010
|
+
alchemist: "0x930750a3510E703535e943E826ABa3c364fFC1De",
|
|
1011
|
+
positionNft: "0xF700c7e40efCA6f7a810e172AFCee3592ff4aD33",
|
|
1012
|
+
myt: "0xEba62B842081CeF5a8184318Dc5C4E4aACa9f651",
|
|
1013
|
+
debtToken: "0xCB8FA9a76b8e203D8C3797bF438d8FB81Ea3326A",
|
|
1014
|
+
underlying: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
1015
|
+
transmuter: "0x693b7594Ae0633d9c5574D0da46a040f92F5b281",
|
|
1016
|
+
router: "0x3c0546587d27354635a4972390a7B96F962d8BBd",
|
|
1017
|
+
mytSymbol: "mixUSDC",
|
|
1018
|
+
debtSymbol: "alUSD",
|
|
1019
|
+
isEth: false
|
|
1020
|
+
}
|
|
1021
|
+
]
|
|
1022
|
+
};
|
|
1023
|
+
var ALCHEMIX_BASE_CONFIG = {
|
|
1024
|
+
markets: [
|
|
1025
|
+
{
|
|
1026
|
+
alchemist: "0xEb380d86EeD275C9F2eD77745aB1B2ccf364BF7A",
|
|
1027
|
+
positionNft: "0xDeD3A04612FF12b57317abE38e68026Fc9D28114",
|
|
1028
|
+
myt: "0xb8BeFE5a6941ca4022a52042075ff269C3C67467",
|
|
1029
|
+
debtToken: "0x877014E21c32feA108B6A1f45f367efc9a2d9B9F",
|
|
1030
|
+
underlying: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
1031
|
+
transmuter: "0x5B1c7180C630d3B2b6782Df70f43aE5Ea80425ba",
|
|
1032
|
+
router: "0x720D1F945279A6D82EeDcC9B7f85767279Ea2F96",
|
|
1033
|
+
mytSymbol: "mixUSDC",
|
|
1034
|
+
debtSymbol: "alUSDb",
|
|
1035
|
+
isEth: false
|
|
1036
|
+
}
|
|
1037
|
+
]
|
|
1038
|
+
};
|
|
1039
|
+
var ALCHEMIX_BUILTIN = {
|
|
1040
|
+
ALCHEMIX: {
|
|
1041
|
+
"1": ALCHEMIX_ETHEREUM_CONFIG,
|
|
1042
|
+
"10": ALCHEMIX_OPTIMISM_CONFIG,
|
|
1043
|
+
"42161": ALCHEMIX_ARBITRUM_CONFIG,
|
|
1044
|
+
"8453": ALCHEMIX_BASE_CONFIG
|
|
1045
|
+
}
|
|
1046
|
+
};
|
|
1047
|
+
var alchemixConfig = () => getGlobalData2()?.alchemixConfig;
|
|
1048
|
+
var alchemixBaseKey = (lender) => lender?.toUpperCase().startsWith("ALCHEMIX") ? "ALCHEMIX" : lender;
|
|
1049
|
+
var alchemixConfigFor = (lender, chainId) => {
|
|
1050
|
+
const base = alchemixBaseKey(lender);
|
|
1051
|
+
const published = getGlobalData2()?.alchemixConfig?.[base]?.[String(chainId)];
|
|
1052
|
+
if (published?.markets?.length) return published;
|
|
1053
|
+
return ALCHEMIX_BUILTIN[base]?.[String(chainId)];
|
|
1054
|
+
};
|
|
1055
|
+
var alchemixMarketsFor = (lender, chainId) => alchemixConfigFor(lender, chainId)?.markets ?? [];
|
|
1056
|
+
var alchemixLendersByChain = (chainId) => {
|
|
1057
|
+
const chain = String(chainId);
|
|
1058
|
+
const cfg = getGlobalData2()?.alchemixConfig ?? {};
|
|
1059
|
+
const keys = /* @__PURE__ */ new Set();
|
|
1060
|
+
for (const lender of Object.keys(cfg)) {
|
|
1061
|
+
if (cfg[lender]?.[chain]?.markets?.length) keys.add(lender);
|
|
1062
|
+
}
|
|
1063
|
+
for (const lender of Object.keys(ALCHEMIX_BUILTIN)) {
|
|
1064
|
+
if (ALCHEMIX_BUILTIN[lender]?.[chain]?.markets?.length) keys.add(lender);
|
|
1065
|
+
}
|
|
1066
|
+
return [...keys];
|
|
1067
|
+
};
|
|
1068
|
+
var alchemixMarketKey = (chainId, alchemist) => `ALCHEMIX_${String(chainId)}_${alchemist.replace(/^0x/i, "").toUpperCase()}`;
|
|
1069
|
+
var parseAlchemixMarketKey = (lender) => {
|
|
1070
|
+
const m = /^ALCHEMIX_(\d+)_(?:0x)?([0-9a-fA-F]{40})$/i.exec(lender ?? "");
|
|
1071
|
+
if (!m) return void 0;
|
|
1072
|
+
return { chainId: m[1], alchemist: `0x${m[2].toLowerCase()}` };
|
|
1073
|
+
};
|
|
1074
|
+
var alchemixMarketByKey = (lender, chainId) => {
|
|
1075
|
+
const parsed = parseAlchemixMarketKey(lender);
|
|
1076
|
+
if (!parsed) return void 0;
|
|
1077
|
+
if (chainId !== void 0 && String(chainId) !== parsed.chainId) return void 0;
|
|
1078
|
+
return alchemixMarketsFor("ALCHEMIX", parsed.chainId).find((m) => m.alchemist.toLowerCase() === parsed.alchemist);
|
|
1079
|
+
};
|
|
1080
|
+
|
|
935
1081
|
// src/lending/twyne.ts
|
|
936
1082
|
var twyneConfig = () => getGlobalData2()?.twyneConfig;
|
|
937
1083
|
var twyneConfigFor = (lender, chainId) => getGlobalData2()?.twyneConfig?.[twyneBaseKey(lender)]?.[String(chainId)];
|
|
@@ -1379,4 +1525,4 @@ async function fetchMainTokensMap() {
|
|
|
1379
1525
|
}
|
|
1380
1526
|
}
|
|
1381
1527
|
|
|
1382
|
-
export { COOLER_ETHEREUM_CONFIG, CURVANCE_MONAD_CONFIG, DOLOMITE_ROUTER_DEFAULTS, FRAXLEND_ETHEREUM_CONFIG, GEARBOX_ACCOUNT_COMPRESSOR_V310, REMOTE_CACHE_STORE_TTL_S, RESUPPLY_ETHEREUM_CONFIG, RIPE_BASE_CONFIG, RIPE_HQ_IDS, RIPE_ROBINHOOD_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, dolomiteIsolation, dolomiteIsolationMarket, dolomiteMarketIdByToken, dolomiteOdosExecutorShim, dolomiteRouters, 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, isMidnightCollateralRef, 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, midnightCollateralRef, midnightConfig, midnightLoanRef, midnightMarketById, midnightMarketIsEnterable, midnightMarkets, midnightMarketsByChain, midnightNotEnterableReason, morphoBundler3, morphoOracles, morphoPools, morphoTypeMarkets, morphoTypeOracles, morphoTypeVaults, parseAaveV4SpokeLenderKey, parseFraxlendPairKey, parseGearboxV3LenderKey, parseLlamaLendLenderKey, parseMidnightRef, parseSiloV2LenderKey, parseSiloV3LenderKey, parseTermMaxLenderKey, refreshRemoteCache, resolveMidnightApiBase, resolveTenorApiUrl, resolveTermApiBase, resolveTermOrderStoreBase, resupplyConfig, resupplyConfigFor, resupplyLendersByChain, ripeConfig, ripeConfigFor, ripeLendersByChain, riverChainData, riverConfig, riverConfigFor, riverLendersByChain, riverMarketByIndex, riverMarkets, setMidnightApiBase, setRemoteCacheGithubToken, setRemoteCacheStore, setRemoteCacheWaitUntil, setTenorApiUrl, setTermApiBase, setTermOrderStoreBase, siloMarkets, siloMarketsV3, siloPeripherals, siloPeripheralsV3, siloV2LenderKey, siloV3LenderKey, skyChainData, skyConfig, skyConfigFor, skyLendersByChain, skyMarkets, tellerConfig, tellerConfigByChain, tellerPoolByAddress, tellerPools, tellerPoolsByChain, tenorApiUrlOverride, termApiBaseOverride, termConfig, termMarketById, termMarkets, termMarketsByChain, termMaxApiBaseUrl, termMaxChainIds, termMaxConfig, termMaxConfigByChain, termMaxLenderKey, termOrderStoreBaseOverride, tokenListCacheKey, twyneBaseKey, twyneBeaconFor, twyneChainData, twyneConfig, twyneConfigFor, twyneLendersByChain, twyneMarketByKey, twyneMarketFor, twyneMarketKey, twyneMarkets, twyneMarketsForIntermediateVault, twyneOperator, usddChainData, usddConfig, usddConfigFor, usddLendersByChain, usddMarketByIlk, usddMarkets };
|
|
1528
|
+
export { ALCHEMIX_ARBITRUM_CONFIG, ALCHEMIX_BASE_CONFIG, ALCHEMIX_ETHEREUM_CONFIG, ALCHEMIX_OPTIMISM_CONFIG, COOLER_ETHEREUM_CONFIG, CURVANCE_MONAD_CONFIG, DOLOMITE_ROUTER_DEFAULTS, FRAXLEND_ETHEREUM_CONFIG, GEARBOX_ACCOUNT_COMPRESSOR_V310, REMOTE_CACHE_STORE_TTL_S, RESUPPLY_ETHEREUM_CONFIG, RIPE_BASE_CONFIG, RIPE_HQ_IDS, RIPE_ROBINHOOD_CONFIG, RemoteFetchError, aaveOracles, aaveOraclesConfig, aavePools, aaveReserves, aaveTokens, aaveV4Oracles, aaveV4Peripherals, aaveV4SpokeLenderKey, aaveV4Spokes, aaveWethGateway, alchemixBaseKey, alchemixConfig, alchemixConfigFor, alchemixLendersByChain, alchemixMarketByKey, alchemixMarketKey, alchemixMarketsFor, 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, dolomiteIsolation, dolomiteIsolationMarket, dolomiteMarketIdByToken, dolomiteOdosExecutorShim, dolomiteRouters, 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, isMidnightCollateralRef, 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, midnightCollateralRef, midnightConfig, midnightLoanRef, midnightMarketById, midnightMarketIsEnterable, midnightMarkets, midnightMarketsByChain, midnightNotEnterableReason, morphoBundler3, morphoOracles, morphoPools, morphoTypeMarkets, morphoTypeOracles, morphoTypeVaults, parseAaveV4SpokeLenderKey, parseAlchemixMarketKey, parseFraxlendPairKey, parseGearboxV3LenderKey, parseLlamaLendLenderKey, parseMidnightRef, parseSiloV2LenderKey, parseSiloV3LenderKey, parseTermMaxLenderKey, refreshRemoteCache, resolveMidnightApiBase, resolveTenorApiUrl, resolveTermApiBase, resolveTermOrderStoreBase, resupplyConfig, resupplyConfigFor, resupplyLendersByChain, ripeConfig, ripeConfigFor, ripeLendersByChain, riverChainData, riverConfig, riverConfigFor, riverLendersByChain, riverMarketByIndex, riverMarkets, setMidnightApiBase, setRemoteCacheGithubToken, setRemoteCacheStore, setRemoteCacheWaitUntil, setTenorApiUrl, setTermApiBase, setTermOrderStoreBase, siloMarkets, siloMarketsV3, siloPeripherals, siloPeripheralsV3, siloV2LenderKey, siloV3LenderKey, skyChainData, skyConfig, skyConfigFor, skyLendersByChain, skyMarkets, tellerConfig, tellerConfigByChain, tellerPoolByAddress, tellerPools, tellerPoolsByChain, tenorApiUrlOverride, termApiBaseOverride, termConfig, termMarketById, termMarkets, termMarketsByChain, termMaxApiBaseUrl, termMaxChainIds, termMaxConfig, termMaxConfigByChain, termMaxLenderKey, termOrderStoreBaseOverride, tokenListCacheKey, twyneBaseKey, twyneBeaconFor, twyneChainData, twyneConfig, twyneConfigFor, twyneLendersByChain, twyneMarketByKey, twyneMarketFor, twyneMarketKey, twyneMarkets, twyneMarketsForIntermediateVault, twyneOperator, usddChainData, usddConfig, usddConfigFor, usddLendersByChain, usddMarketByIlk, usddMarkets };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export type AlchemixMarketEntry = {
|
|
2
|
+
/** The Alchemist (a transparent proxy) — doubles as the market id. */
|
|
3
|
+
alchemist: string;
|
|
4
|
+
/** The ERC721Enumerable position NFT (`alchemistPositionNFT()`). */
|
|
5
|
+
positionNft: string;
|
|
6
|
+
/** The MYT — the collateral, an ERC-4626 Morpho Vault V2 (18-dec shares). */
|
|
7
|
+
myt: string;
|
|
8
|
+
/** The alAsset minted as debt (`debtToken()`), 18 decimals everywhere. */
|
|
9
|
+
debtToken: string;
|
|
10
|
+
/** The MYT's `asset()` and the Alchemist's `underlyingToken()`. */
|
|
11
|
+
underlying: string;
|
|
12
|
+
/** The Transmuter mapped to this Alchemist (redeems alAsset 1:1). */
|
|
13
|
+
transmuter: string;
|
|
14
|
+
/** The immutable per-Alchemist `AlchemistRouter`. */
|
|
15
|
+
router: string;
|
|
16
|
+
/** Display symbols — labelling only, never dispatch. */
|
|
17
|
+
mytSymbol: string;
|
|
18
|
+
debtSymbol: string;
|
|
19
|
+
/** True when the underlying is the chain's wrapped native (router has the
|
|
20
|
+
* `*ETH` entrypoints). */
|
|
21
|
+
isEth: boolean;
|
|
22
|
+
};
|
|
23
|
+
export type AlchemixConfigChain = {
|
|
24
|
+
markets: AlchemixMarketEntry[];
|
|
25
|
+
};
|
|
26
|
+
export type AlchemixConfigType = {
|
|
27
|
+
[lender: string]: {
|
|
28
|
+
[chainId: string]: AlchemixConfigChain;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare const ALCHEMIX_ETHEREUM_CONFIG: AlchemixConfigChain;
|
|
32
|
+
export declare const ALCHEMIX_OPTIMISM_CONFIG: AlchemixConfigChain;
|
|
33
|
+
export declare const ALCHEMIX_ARBITRUM_CONFIG: AlchemixConfigChain;
|
|
34
|
+
export declare const ALCHEMIX_BASE_CONFIG: AlchemixConfigChain;
|
|
35
|
+
export declare const alchemixConfig: () => AlchemixConfigType;
|
|
36
|
+
/** The bare dispatch key for any `ALCHEMIX*` key. */
|
|
37
|
+
export declare const alchemixBaseKey: (lender: string) => string;
|
|
38
|
+
/**
|
|
39
|
+
* Deployment roster for the Alchemix lender on a chain. Published metadata
|
|
40
|
+
* wins; the built-in rows are the fallback (the Curvance/Ripe pattern), so the
|
|
41
|
+
* provider works with no `config/alchemix.json` publish. Accepts the bare key
|
|
42
|
+
* or a per-market key.
|
|
43
|
+
*/
|
|
44
|
+
export declare const alchemixConfigFor: (lender: string, chainId: string | number) => AlchemixConfigChain | undefined;
|
|
45
|
+
/** All markets on a chain, or `[]`. */
|
|
46
|
+
export declare const alchemixMarketsFor: (lender: string, chainId: string | number) => AlchemixMarketEntry[];
|
|
47
|
+
/** Bare Alchemix lender keys with a roster on a chain (drives `getLendersForChain`). */
|
|
48
|
+
export declare const alchemixLendersByChain: (chainId: string | number) => string[];
|
|
49
|
+
/** Per-market lender key: `ALCHEMIX_<chainId>_<ALCHEMIST_HEX_UPPER>` (no `0x`). */
|
|
50
|
+
export declare const alchemixMarketKey: (chainId: string | number, alchemist: string) => string;
|
|
51
|
+
/** Inverse of {@link alchemixMarketKey}; undefined for the bare key. Case-insensitive. */
|
|
52
|
+
export declare const parseAlchemixMarketKey: (lender: string) => {
|
|
53
|
+
chainId: string;
|
|
54
|
+
alchemist: string;
|
|
55
|
+
} | undefined;
|
|
56
|
+
/** Resolve a per-market key (or `(chainId, alchemist)`) to its roster entry. */
|
|
57
|
+
export declare const alchemixMarketByKey: (lender: string, chainId?: string | number) => AlchemixMarketEntry | undefined;
|
package/dist/lending/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ import type { CompoundV3BaseDataType, CompoundV3BulkerType, CompoundV3OracleData
|
|
|
26
26
|
import type { CurvanceConfigType } from './curvance';
|
|
27
27
|
import type { CoolerConfigType } from './cooler';
|
|
28
28
|
import type { RipeConfigType } from './ripe';
|
|
29
|
+
import type { AlchemixConfigType } from './alchemix';
|
|
29
30
|
import type { TwyneConfigType, TwyneMarketsType } from './twyne';
|
|
30
31
|
import type { DolomiteConfigsType, DolomiteEmodeType, DolomiteIsolationType } from './dolomite';
|
|
31
32
|
import type { UsddConfigType, UsddMarketsType } from './dss';
|
|
@@ -113,6 +114,7 @@ export interface GlobalLenderDataRegistry {
|
|
|
113
114
|
curvanceConfig: CurvanceConfigType;
|
|
114
115
|
coolerConfig: CoolerConfigType;
|
|
115
116
|
ripeConfig: RipeConfigType;
|
|
117
|
+
alchemixConfig: AlchemixConfigType;
|
|
116
118
|
twyneConfig: TwyneConfigType;
|
|
117
119
|
twyneMarkets: TwyneMarketsType;
|
|
118
120
|
fraxlendConfig: FraxlendConfigType;
|