@defisaver/positions-sdk 2.1.7 → 2.1.8
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/.mocharc.json +4 -4
- package/.nvmrc +1 -1
- package/README.md +64 -64
- package/cjs/aaveV3/index.js +3 -3
- package/cjs/aaveV3/merit.js +3 -0
- package/cjs/aaveV3/merkl.d.ts +1 -1
- package/cjs/config/contracts.d.ts +20 -0
- package/cjs/config/contracts.js +20 -0
- package/cjs/helpers/aaveHelpers/index.d.ts +1 -1
- package/cjs/helpers/aaveHelpers/index.js +6 -4
- package/cjs/helpers/morphoBlueHelpers/index.d.ts +1 -1
- package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
- package/cjs/markets/aave/index.js +1 -1
- package/cjs/markets/aave/marketAssets.d.ts +4 -0
- package/cjs/markets/aave/marketAssets.js +5 -1
- package/cjs/markets/compound/index.js +11 -0
- package/cjs/markets/compound/marketsAssets.d.ts +7 -0
- package/cjs/markets/compound/marketsAssets.js +7 -0
- package/cjs/markets/spark/marketAssets.d.ts +1 -0
- package/cjs/markets/spark/marketAssets.js +1 -0
- package/cjs/services/utils.d.ts +8 -4
- package/cjs/services/utils.js +30 -10
- package/cjs/services/viem.d.ts +54 -15
- package/cjs/services/viem.js +2 -0
- package/cjs/staking/eligibility.js +1 -6
- package/cjs/types/common.d.ts +4 -2
- package/cjs/types/common.js +2 -0
- package/esm/aaveV3/index.js +4 -4
- package/esm/aaveV3/merit.js +3 -0
- package/esm/aaveV3/merkl.d.ts +1 -1
- package/esm/config/contracts.d.ts +20 -0
- package/esm/config/contracts.js +20 -0
- package/esm/helpers/aaveHelpers/index.d.ts +1 -1
- package/esm/helpers/aaveHelpers/index.js +7 -5
- package/esm/helpers/morphoBlueHelpers/index.d.ts +1 -1
- package/esm/helpers/morphoBlueHelpers/index.js +66 -66
- package/esm/markets/aave/index.js +1 -1
- package/esm/markets/aave/marketAssets.d.ts +4 -0
- package/esm/markets/aave/marketAssets.js +4 -0
- package/esm/markets/compound/index.js +11 -0
- package/esm/markets/compound/marketsAssets.d.ts +7 -0
- package/esm/markets/compound/marketsAssets.js +7 -0
- package/esm/markets/spark/marketAssets.d.ts +1 -0
- package/esm/markets/spark/marketAssets.js +1 -0
- package/esm/services/utils.d.ts +8 -4
- package/esm/services/utils.js +21 -5
- package/esm/services/viem.d.ts +54 -15
- package/esm/services/viem.js +3 -1
- package/esm/staking/eligibility.js +1 -6
- package/esm/types/common.d.ts +4 -2
- package/esm/types/common.js +2 -0
- package/package.json +47 -47
- package/src/aaveV2/index.ts +240 -240
- package/src/aaveV3/index.ts +614 -614
- package/src/aaveV3/merit.ts +97 -94
- package/src/aaveV3/merkl.ts +74 -74
- package/src/claiming/aaveV3.ts +154 -154
- package/src/claiming/compV3.ts +22 -22
- package/src/claiming/index.ts +12 -12
- package/src/claiming/king.ts +66 -66
- package/src/claiming/morphoBlue.ts +118 -118
- package/src/claiming/spark.ts +225 -225
- package/src/compoundV2/index.ts +244 -244
- package/src/compoundV3/index.ts +274 -274
- package/src/config/contracts.ts +1251 -1231
- package/src/constants/index.ts +10 -10
- package/src/contracts.ts +120 -120
- package/src/curveUsd/index.ts +254 -254
- package/src/eulerV2/index.ts +324 -324
- package/src/exchange/index.ts +25 -25
- package/src/fluid/index.ts +1638 -1638
- package/src/helpers/aaveHelpers/index.ts +187 -185
- package/src/helpers/compoundHelpers/index.ts +283 -283
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/eulerHelpers/index.ts +222 -222
- package/src/helpers/fluidHelpers/index.ts +326 -326
- package/src/helpers/index.ts +10 -10
- package/src/helpers/liquityV2Helpers/index.ts +82 -82
- package/src/helpers/llamaLendHelpers/index.ts +53 -53
- package/src/helpers/makerHelpers/index.ts +52 -52
- package/src/helpers/morphoBlueHelpers/index.ts +396 -396
- package/src/helpers/sparkHelpers/index.ts +155 -155
- package/src/index.ts +47 -47
- package/src/liquity/index.ts +159 -159
- package/src/liquityV2/index.ts +657 -657
- package/src/llamaLend/index.ts +305 -305
- package/src/maker/index.ts +223 -223
- package/src/markets/aave/index.ts +116 -116
- package/src/markets/aave/marketAssets.ts +54 -49
- package/src/markets/compound/index.ts +238 -227
- package/src/markets/compound/marketsAssets.ts +97 -90
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/euler/index.ts +26 -26
- package/src/markets/fluid/index.ts +2456 -2456
- package/src/markets/index.ts +25 -25
- package/src/markets/liquityV2/index.ts +102 -102
- package/src/markets/llamaLend/contractAddresses.ts +141 -141
- package/src/markets/llamaLend/index.ts +235 -235
- package/src/markets/morphoBlue/index.ts +895 -895
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +12 -11
- package/src/moneymarket/moneymarketCommonService.ts +80 -80
- package/src/morphoBlue/index.ts +274 -274
- package/src/portfolio/index.ts +570 -570
- package/src/services/priceService.ts +159 -159
- package/src/services/utils.ts +115 -99
- package/src/services/viem.ts +34 -32
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +445 -445
- package/src/staking/eligibility.ts +53 -59
- package/src/staking/index.ts +1 -1
- package/src/staking/staking.ts +170 -170
- package/src/types/aave.ts +189 -189
- package/src/types/claiming.ts +109 -109
- package/src/types/common.ts +107 -105
- package/src/types/compound.ts +136 -136
- package/src/types/curveUsd.ts +123 -123
- package/src/types/euler.ts +175 -175
- package/src/types/fluid.ts +448 -448
- package/src/types/index.ts +13 -13
- package/src/types/liquity.ts +30 -30
- package/src/types/liquityV2.ts +126 -126
- package/src/types/llamaLend.ts +159 -159
- package/src/types/maker.ts +63 -63
- package/src/types/merit.ts +1 -1
- package/src/types/merkl.ts +70 -70
- package/src/types/morphoBlue.ts +194 -194
- package/src/types/portfolio.ts +60 -60
- package/src/types/spark.ts +135 -135
- package/src/umbrella/index.ts +69 -69
- package/src/umbrella/umbrellaUtils.ts +29 -29
- package/CLAUDE.md +0 -32
|
@@ -18,6 +18,7 @@ exports.v3USDCCollAssets = {
|
|
|
18
18
|
[common_1.NetworkNumber.Arb]: exports.v3USDCCollAssetsArb,
|
|
19
19
|
[common_1.NetworkNumber.Base]: exports.v3USDCCollAssetsBase,
|
|
20
20
|
[common_1.NetworkNumber.Linea]: [],
|
|
21
|
+
[common_1.NetworkNumber.Plasma]: [],
|
|
21
22
|
};
|
|
22
23
|
exports.v3USDCeCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC'];
|
|
23
24
|
// @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
|
|
@@ -27,6 +28,7 @@ exports.v3USDCeCollAssets = {
|
|
|
27
28
|
[common_1.NetworkNumber.Arb]: exports.v3USDCeCollAssetsArb,
|
|
28
29
|
[common_1.NetworkNumber.Base]: [],
|
|
29
30
|
[common_1.NetworkNumber.Linea]: [],
|
|
31
|
+
[common_1.NetworkNumber.Plasma]: [],
|
|
30
32
|
};
|
|
31
33
|
exports.v3ETHCollAssetsEth = ['cbETH', 'wstETH', 'rETH', 'rsETH', 'weETH', 'osETH', 'WBTC', 'ezETH', 'cbBTC', 'rswETH', 'tBTC', 'ETHx', 'tETH', 'pufETH', 'wOETH'];
|
|
32
34
|
exports.v3ETHCollAssetsBase = ['cbETH', 'ezETH', 'wstETH', 'USDC', 'weETH', 'wrsETH', 'cbBTC', 'wsuperOETHb'];
|
|
@@ -39,6 +41,7 @@ exports.v3ETHCollAssets = {
|
|
|
39
41
|
[common_1.NetworkNumber.Arb]: exports.v3ETHCollAssetsArb,
|
|
40
42
|
[common_1.NetworkNumber.Base]: exports.v3ETHCollAssetsBase,
|
|
41
43
|
[common_1.NetworkNumber.Linea]: [],
|
|
44
|
+
[common_1.NetworkNumber.Plasma]: [],
|
|
42
45
|
};
|
|
43
46
|
exports.v3USDbCCollAssetsBase = ['ETH', 'cbETH'];
|
|
44
47
|
// @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
|
|
@@ -48,6 +51,7 @@ exports.v3USDbCCollAssets = {
|
|
|
48
51
|
[common_1.NetworkNumber.Arb]: [],
|
|
49
52
|
[common_1.NetworkNumber.Base]: exports.v3USDbCCollAssetsBase,
|
|
50
53
|
[common_1.NetworkNumber.Linea]: [],
|
|
54
|
+
[common_1.NetworkNumber.Plasma]: [],
|
|
51
55
|
};
|
|
52
56
|
exports.v3USDTCollAssetsEth = ['COMP', 'ETH', 'WBTC', 'UNI', 'LINK', 'wstETH', 'cbBTC', 'tBTC', 'wUSDM', 'sFRAX', 'mETH', 'weETH', 'sdeUSD', 'deUSD'];
|
|
53
57
|
exports.v3USDTCollAssetsArb = ['ETH', 'WBTC', 'wstETH', 'ARB', 'GMX'];
|
|
@@ -59,6 +63,7 @@ exports.v3USDTCollAssets = {
|
|
|
59
63
|
[common_1.NetworkNumber.Arb]: exports.v3USDTCollAssetsArb,
|
|
60
64
|
[common_1.NetworkNumber.Base]: [],
|
|
61
65
|
[common_1.NetworkNumber.Linea]: [],
|
|
66
|
+
[common_1.NetworkNumber.Plasma]: [],
|
|
62
67
|
};
|
|
63
68
|
exports.v3USDSCollAssetsEth = ['wstETH', 'ETH', 'sUSDS', 'cbETH', 'tBTC', 'USDe'];
|
|
64
69
|
exports.v3USDSCollAssetsBase = ['sUSDS', 'cbBTC'];
|
|
@@ -68,6 +73,7 @@ exports.v3USDSCollAssets = {
|
|
|
68
73
|
[common_1.NetworkNumber.Arb]: [],
|
|
69
74
|
[common_1.NetworkNumber.Base]: exports.v3USDSCollAssetsBase,
|
|
70
75
|
[common_1.NetworkNumber.Linea]: [],
|
|
76
|
+
[common_1.NetworkNumber.Plasma]: [],
|
|
71
77
|
};
|
|
72
78
|
exports.v3wstETHCollAssetsEth = ['rsETH', 'ezETH'];
|
|
73
79
|
exports.v3wstETHCollAssets = {
|
|
@@ -76,4 +82,5 @@ exports.v3wstETHCollAssets = {
|
|
|
76
82
|
[common_1.NetworkNumber.Arb]: [],
|
|
77
83
|
[common_1.NetworkNumber.Base]: [],
|
|
78
84
|
[common_1.NetworkNumber.Linea]: [],
|
|
85
|
+
[common_1.NetworkNumber.Plasma]: [],
|
|
79
86
|
};
|
package/cjs/services/utils.d.ts
CHANGED
|
@@ -2,8 +2,6 @@ import { NetworkNumber } from '../types/common';
|
|
|
2
2
|
export declare const isLayer2Network: (networkId: NetworkNumber) => boolean;
|
|
3
3
|
export declare const addToObjectIf: (condition: any, item: any) => any;
|
|
4
4
|
export declare const addToArrayIf: (condition: any, ...items: any[]) => any[];
|
|
5
|
-
export declare const ethToWeth: (maybeEth: any) => any;
|
|
6
|
-
export declare const wethToEth: (maybeWeth: any) => any;
|
|
7
5
|
export declare const stEthToWstEth: (maybeStEth: any) => any;
|
|
8
6
|
export declare const wstEthToStEth: (maybeStEth: any) => any;
|
|
9
7
|
export declare const getAbiItem: (abi: any, methodName: string) => any;
|
|
@@ -13,8 +11,6 @@ export declare const compareAddresses: (addr1?: string, addr2?: string) => boole
|
|
|
13
11
|
export declare const getWeiAmountForDecimals: (amount: string | number, decimals: number) => string;
|
|
14
12
|
export declare const getEthAmountForDecimals: (amount: string | number, decimals: string | number) => string;
|
|
15
13
|
export declare const handleWbtcLegacy: (asset: string) => string;
|
|
16
|
-
export declare const wethToEthByAddress: (maybeWethAddr: string, chainId?: NetworkNumber) => string;
|
|
17
|
-
export declare const ethToWethByAddress: (maybeEthAddr: string, chainId?: NetworkNumber) => string;
|
|
18
14
|
export declare const bytesToString: (hex: string) => string;
|
|
19
15
|
/**
|
|
20
16
|
* Map an input value from one range (minInput, maxInput) to a value in another range (minOutput, maxOutput)
|
|
@@ -30,3 +26,11 @@ export declare const DEFAULT_TIMEOUT = 2000;
|
|
|
30
26
|
* @param value
|
|
31
27
|
*/
|
|
32
28
|
export declare const convertHybridArraysToObjects: (value: any) => any;
|
|
29
|
+
export declare const ethToWeth: (maybeEth: string) => string;
|
|
30
|
+
export declare const wethToEth: (maybeWeth: string) => string;
|
|
31
|
+
export declare const wethToEthByAddress: (maybeWethAddr: string, chainId?: NetworkNumber) => string;
|
|
32
|
+
export declare const ethToWethByAddress: (maybeEthAddr: string, chainId?: NetworkNumber) => string;
|
|
33
|
+
export declare const xplToWxpl: (maybeXpl: string) => string;
|
|
34
|
+
export declare const wxplToXpl: (maybeWxpl: string) => string;
|
|
35
|
+
export declare const getWrappedNativeAssetFromUnwrapped: (symbol: string) => string;
|
|
36
|
+
export declare const getNativeAssetFromWrapped: (symbol: string) => string;
|
package/cjs/services/utils.js
CHANGED
|
@@ -3,20 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getNativeAssetFromWrapped = exports.getWrappedNativeAssetFromUnwrapped = exports.wxplToXpl = exports.xplToWxpl = exports.ethToWethByAddress = exports.wethToEthByAddress = exports.wethToEth = exports.ethToWeth = exports.convertHybridArraysToObjects = exports.DEFAULT_TIMEOUT = exports.isMainnetNetwork = exports.isMaxuint = exports.MAXUINT = exports.isEnabledOnBitmap = exports.mapRange = exports.bytesToString = exports.handleWbtcLegacy = exports.getEthAmountForDecimals = exports.getWeiAmountForDecimals = exports.compareAddresses = exports.isAddress = exports.ADDRESS_REGEX = exports.getAbiItem = exports.wstEthToStEth = exports.stEthToWstEth = exports.addToArrayIf = exports.addToObjectIf = exports.isLayer2Network = void 0;
|
|
7
7
|
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
8
8
|
const tokens_1 = require("@defisaver/tokens");
|
|
9
9
|
const common_1 = require("../types/common");
|
|
10
|
-
const isLayer2Network = (networkId) => [common_1.NetworkNumber.Opt, common_1.NetworkNumber.Arb, common_1.NetworkNumber.Base, common_1.NetworkNumber.Linea].includes(+networkId);
|
|
10
|
+
const isLayer2Network = (networkId) => [common_1.NetworkNumber.Opt, common_1.NetworkNumber.Arb, common_1.NetworkNumber.Base, common_1.NetworkNumber.Linea, common_1.NetworkNumber.Plasma].includes(+networkId);
|
|
11
11
|
exports.isLayer2Network = isLayer2Network;
|
|
12
12
|
const addToObjectIf = (condition, item) => (condition ? item : {});
|
|
13
13
|
exports.addToObjectIf = addToObjectIf;
|
|
14
14
|
const addToArrayIf = (condition, ...items) => (condition ? items : []);
|
|
15
15
|
exports.addToArrayIf = addToArrayIf;
|
|
16
|
-
const ethToWeth = (maybeEth) => maybeEth === null || maybeEth === void 0 ? void 0 : maybeEth.replace(/^ETH$/, 'WETH');
|
|
17
|
-
exports.ethToWeth = ethToWeth;
|
|
18
|
-
const wethToEth = (maybeWeth) => maybeWeth === null || maybeWeth === void 0 ? void 0 : maybeWeth.replace(/^WETH$/, 'ETH');
|
|
19
|
-
exports.wethToEth = wethToEth;
|
|
20
16
|
const stEthToWstEth = (maybeStEth) => maybeStEth === null || maybeStEth === void 0 ? void 0 : maybeStEth.replace(/^stETH$/, 'wstETH');
|
|
21
17
|
exports.stEthToWstEth = stEthToWstEth;
|
|
22
18
|
const wstEthToStEth = (maybeStEth) => maybeStEth === null || maybeStEth === void 0 ? void 0 : maybeStEth.replace(/^wstETH$/, 'stETH');
|
|
@@ -34,10 +30,6 @@ const getEthAmountForDecimals = (amount, decimals) => new decimal_js_1.default(a
|
|
|
34
30
|
exports.getEthAmountForDecimals = getEthAmountForDecimals;
|
|
35
31
|
const handleWbtcLegacy = (asset) => (asset === 'WBTC Legacy' ? 'WBTC' : asset);
|
|
36
32
|
exports.handleWbtcLegacy = handleWbtcLegacy;
|
|
37
|
-
const wethToEthByAddress = (maybeWethAddr, chainId = common_1.NetworkNumber.Eth) => (0, tokens_1.getAssetInfo)((0, exports.wethToEth)((0, tokens_1.getAssetInfoByAddress)(maybeWethAddr, chainId).symbol), chainId).address;
|
|
38
|
-
exports.wethToEthByAddress = wethToEthByAddress;
|
|
39
|
-
const ethToWethByAddress = (maybeEthAddr, chainId = common_1.NetworkNumber.Eth) => (0, tokens_1.getAssetInfo)((0, exports.ethToWeth)((0, tokens_1.getAssetInfoByAddress)(maybeEthAddr, chainId).symbol), chainId).address;
|
|
40
|
-
exports.ethToWethByAddress = ethToWethByAddress;
|
|
41
33
|
const bytesToString = (hex) => Buffer.from(hex.replace(/^0x/, ''), 'hex')
|
|
42
34
|
.toString()
|
|
43
35
|
// eslint-disable-next-line no-control-regex
|
|
@@ -96,3 +88,31 @@ const convertHybridArraysToObjects = (value) => {
|
|
|
96
88
|
return value;
|
|
97
89
|
};
|
|
98
90
|
exports.convertHybridArraysToObjects = convertHybridArraysToObjects;
|
|
91
|
+
const ethToWeth = (maybeEth) => maybeEth === null || maybeEth === void 0 ? void 0 : maybeEth.replace(/^ETH$/, 'WETH');
|
|
92
|
+
exports.ethToWeth = ethToWeth;
|
|
93
|
+
const wethToEth = (maybeWeth) => maybeWeth === null || maybeWeth === void 0 ? void 0 : maybeWeth.replace(/^WETH$/, 'ETH');
|
|
94
|
+
exports.wethToEth = wethToEth;
|
|
95
|
+
const wethToEthByAddress = (maybeWethAddr, chainId = common_1.NetworkNumber.Eth) => (0, tokens_1.getAssetInfo)((0, exports.wethToEth)((0, tokens_1.getAssetInfoByAddress)(maybeWethAddr, chainId).symbol), chainId).address;
|
|
96
|
+
exports.wethToEthByAddress = wethToEthByAddress;
|
|
97
|
+
const ethToWethByAddress = (maybeEthAddr, chainId = common_1.NetworkNumber.Eth) => (0, tokens_1.getAssetInfo)((0, exports.ethToWeth)((0, tokens_1.getAssetInfoByAddress)(maybeEthAddr, chainId).symbol), chainId).address;
|
|
98
|
+
exports.ethToWethByAddress = ethToWethByAddress;
|
|
99
|
+
const xplToWxpl = (maybeXpl) => maybeXpl === null || maybeXpl === void 0 ? void 0 : maybeXpl.replace(/^XPL$/, 'WXPL');
|
|
100
|
+
exports.xplToWxpl = xplToWxpl;
|
|
101
|
+
const wxplToXpl = (maybeWxpl) => maybeWxpl === null || maybeWxpl === void 0 ? void 0 : maybeWxpl.replace(/^WXPL$/, 'XPL');
|
|
102
|
+
exports.wxplToXpl = wxplToXpl;
|
|
103
|
+
const getWrappedNativeAssetFromUnwrapped = (symbol) => {
|
|
104
|
+
if (symbol === 'ETH')
|
|
105
|
+
return 'WETH';
|
|
106
|
+
if (symbol === 'XPL')
|
|
107
|
+
return 'WXPL';
|
|
108
|
+
return symbol;
|
|
109
|
+
};
|
|
110
|
+
exports.getWrappedNativeAssetFromUnwrapped = getWrappedNativeAssetFromUnwrapped;
|
|
111
|
+
const getNativeAssetFromWrapped = (symbol) => {
|
|
112
|
+
if (symbol === 'WETH')
|
|
113
|
+
return 'ETH';
|
|
114
|
+
if (symbol === 'WXPL')
|
|
115
|
+
return 'XPL';
|
|
116
|
+
return symbol;
|
|
117
|
+
};
|
|
118
|
+
exports.getNativeAssetFromWrapped = getNativeAssetFromWrapped;
|
package/cjs/services/viem.d.ts
CHANGED
|
@@ -7,14 +7,11 @@ export declare const getViemChain: (network: NetworkNumber) => {
|
|
|
7
7
|
readonly apiUrl: "https://api.etherscan.io/api";
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
blockTime
|
|
10
|
+
blockTime: 12000;
|
|
11
11
|
contracts: {
|
|
12
|
-
readonly ensRegistry: {
|
|
13
|
-
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
|
|
14
|
-
};
|
|
15
12
|
readonly ensUniversalResolver: {
|
|
16
|
-
readonly address: "
|
|
17
|
-
readonly blockCreated:
|
|
13
|
+
readonly address: "0xeeeeeeee14d718c2b47d9923deab1335e144eeee";
|
|
14
|
+
readonly blockCreated: 23085558;
|
|
18
15
|
};
|
|
19
16
|
readonly multicall3: {
|
|
20
17
|
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
@@ -29,6 +26,7 @@ export declare const getViemChain: (network: NetworkNumber) => {
|
|
|
29
26
|
readonly symbol: "ETH";
|
|
30
27
|
readonly decimals: 18;
|
|
31
28
|
};
|
|
29
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
32
30
|
rpcUrls: {
|
|
33
31
|
readonly default: {
|
|
34
32
|
readonly http: readonly ["https://eth.merkle.io"];
|
|
@@ -101,6 +99,7 @@ export declare const getViemChain: (network: NetworkNumber) => {
|
|
|
101
99
|
readonly symbol: "ETH";
|
|
102
100
|
readonly decimals: 18;
|
|
103
101
|
};
|
|
102
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
104
103
|
rpcUrls: {
|
|
105
104
|
readonly default: {
|
|
106
105
|
readonly http: readonly ["https://mainnet.optimism.io"];
|
|
@@ -174,16 +173,16 @@ export declare const getViemChain: (network: NetworkNumber) => {
|
|
|
174
173
|
r: import("viem").Hex;
|
|
175
174
|
s: import("viem").Hex;
|
|
176
175
|
v: bigint;
|
|
176
|
+
value: bigint;
|
|
177
|
+
gas: bigint;
|
|
177
178
|
to: import("viem").Address | null;
|
|
178
179
|
from: import("viem").Address;
|
|
179
|
-
gas: bigint;
|
|
180
180
|
nonce: number;
|
|
181
|
-
value: bigint;
|
|
182
181
|
blockHash: `0x${string}` | null;
|
|
183
182
|
blockNumber: bigint | null;
|
|
183
|
+
transactionIndex: number | null;
|
|
184
184
|
hash: import("viem").Hash;
|
|
185
185
|
input: import("viem").Hex;
|
|
186
|
-
transactionIndex: number | null;
|
|
187
186
|
typeHex: import("viem").Hex | null;
|
|
188
187
|
accessList?: undefined | undefined;
|
|
189
188
|
authorizationList?: undefined | undefined;
|
|
@@ -352,7 +351,7 @@ export declare const getViemChain: (network: NetworkNumber) => {
|
|
|
352
351
|
readonly apiUrl: "https://api.arbiscan.io/api";
|
|
353
352
|
};
|
|
354
353
|
};
|
|
355
|
-
blockTime
|
|
354
|
+
blockTime: 250;
|
|
356
355
|
contracts: {
|
|
357
356
|
readonly multicall3: {
|
|
358
357
|
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
@@ -367,6 +366,7 @@ export declare const getViemChain: (network: NetworkNumber) => {
|
|
|
367
366
|
readonly symbol: "ETH";
|
|
368
367
|
readonly decimals: 18;
|
|
369
368
|
};
|
|
369
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
370
370
|
rpcUrls: {
|
|
371
371
|
readonly default: {
|
|
372
372
|
readonly http: readonly ["https://arb1.arbitrum.io/rpc"];
|
|
@@ -441,6 +441,7 @@ export declare const getViemChain: (network: NetworkNumber) => {
|
|
|
441
441
|
readonly symbol: "ETH";
|
|
442
442
|
readonly decimals: 18;
|
|
443
443
|
};
|
|
444
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
444
445
|
rpcUrls: {
|
|
445
446
|
readonly default: {
|
|
446
447
|
readonly http: readonly ["https://mainnet.base.org"];
|
|
@@ -514,16 +515,16 @@ export declare const getViemChain: (network: NetworkNumber) => {
|
|
|
514
515
|
r: import("viem").Hex;
|
|
515
516
|
s: import("viem").Hex;
|
|
516
517
|
v: bigint;
|
|
518
|
+
value: bigint;
|
|
519
|
+
gas: bigint;
|
|
517
520
|
to: import("viem").Address | null;
|
|
518
521
|
from: import("viem").Address;
|
|
519
|
-
gas: bigint;
|
|
520
522
|
nonce: number;
|
|
521
|
-
value: bigint;
|
|
522
523
|
blockHash: `0x${string}` | null;
|
|
523
524
|
blockNumber: bigint | null;
|
|
525
|
+
transactionIndex: number | null;
|
|
524
526
|
hash: import("viem").Hash;
|
|
525
527
|
input: import("viem").Hex;
|
|
526
|
-
transactionIndex: number | null;
|
|
527
528
|
typeHex: import("viem").Hex | null;
|
|
528
529
|
accessList?: undefined | undefined;
|
|
529
530
|
authorizationList?: undefined | undefined;
|
|
@@ -703,8 +704,8 @@ export declare const getViemChain: (network: NetworkNumber) => {
|
|
|
703
704
|
readonly blockCreated: 6682888;
|
|
704
705
|
};
|
|
705
706
|
readonly ensUniversalResolver: {
|
|
706
|
-
readonly address: "
|
|
707
|
-
readonly blockCreated:
|
|
707
|
+
readonly address: "0x4D41762915F83c76EcaF6776d9b08076aA32b492";
|
|
708
|
+
readonly blockCreated: 22222151;
|
|
708
709
|
};
|
|
709
710
|
};
|
|
710
711
|
ensTlds: readonly [".linea.eth"];
|
|
@@ -715,6 +716,7 @@ export declare const getViemChain: (network: NetworkNumber) => {
|
|
|
715
716
|
readonly symbol: "ETH";
|
|
716
717
|
readonly decimals: 18;
|
|
717
718
|
};
|
|
719
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
718
720
|
rpcUrls: {
|
|
719
721
|
readonly default: {
|
|
720
722
|
readonly http: readonly ["https://rpc.linea.build"];
|
|
@@ -730,6 +732,40 @@ export declare const getViemChain: (network: NetworkNumber) => {
|
|
|
730
732
|
};
|
|
731
733
|
formatters?: undefined;
|
|
732
734
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
735
|
+
} | {
|
|
736
|
+
blockExplorers: {
|
|
737
|
+
readonly default: {
|
|
738
|
+
readonly name: "PlasmaScan";
|
|
739
|
+
readonly url: "https://plasmascan.to";
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
blockTime?: number | undefined | undefined;
|
|
743
|
+
contracts: {
|
|
744
|
+
readonly multicall3: {
|
|
745
|
+
readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
746
|
+
readonly blockCreated: 0;
|
|
747
|
+
};
|
|
748
|
+
};
|
|
749
|
+
ensTlds?: readonly string[] | undefined;
|
|
750
|
+
id: 9745;
|
|
751
|
+
name: "Plasma";
|
|
752
|
+
nativeCurrency: {
|
|
753
|
+
readonly name: "Plasma";
|
|
754
|
+
readonly symbol: "XPL";
|
|
755
|
+
readonly decimals: 18;
|
|
756
|
+
};
|
|
757
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
758
|
+
rpcUrls: {
|
|
759
|
+
readonly default: {
|
|
760
|
+
readonly http: readonly ["https://rpc.plasma.to"];
|
|
761
|
+
};
|
|
762
|
+
};
|
|
763
|
+
sourceId?: number | undefined | undefined;
|
|
764
|
+
testnet?: boolean | undefined | undefined;
|
|
765
|
+
custom?: Record<string, unknown> | undefined;
|
|
766
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
767
|
+
formatters?: undefined;
|
|
768
|
+
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
733
769
|
};
|
|
734
770
|
export declare const getViemProvider: (provider: EthereumProvider, network: NetworkNumber, options?: any) => {
|
|
735
771
|
account: undefined;
|
|
@@ -741,6 +777,7 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
741
777
|
request?: (parameters: import("viem").CcipRequestParameters) => Promise<`0x${string}`>;
|
|
742
778
|
} | undefined;
|
|
743
779
|
chain: undefined;
|
|
780
|
+
experimental_blockTag?: import("viem").BlockTag | undefined;
|
|
744
781
|
key: string;
|
|
745
782
|
name: string;
|
|
746
783
|
pollingInterval: number;
|
|
@@ -7579,6 +7616,7 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
7579
7616
|
simulateBlocks: <const calls extends readonly unknown[]>(args: import("viem").SimulateBlocksParameters<calls>) => Promise<import("viem").SimulateBlocksReturnType<calls>>;
|
|
7580
7617
|
simulateCalls: <const calls extends readonly unknown[]>(args: import("viem").SimulateCallsParameters<calls>) => Promise<import("viem").SimulateCallsReturnType<calls>>;
|
|
7581
7618
|
simulateContract: <const abi extends import("viem").Abi | readonly unknown[], functionName extends import("viem").ContractFunctionName<abi, "nonpayable" | "payable">, const args_1 extends import("viem").ContractFunctionArgs<abi, "nonpayable" | "payable", functionName>, chainOverride extends import("viem").Chain | undefined, accountOverride extends import("viem").Account | import("viem").Address | undefined = undefined>(args: import("viem").SimulateContractParameters<abi, functionName, args_1, undefined, chainOverride, accountOverride>) => Promise<import("viem").SimulateContractReturnType<abi, functionName, args_1, undefined, import("viem").Account | undefined, chainOverride, accountOverride>>;
|
|
7619
|
+
verifyHash: (args: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>;
|
|
7582
7620
|
verifyMessage: (args: import("viem").VerifyMessageActionParameters) => Promise<import("viem").VerifyMessageActionReturnType>;
|
|
7583
7621
|
verifySiweMessage: (args: {
|
|
7584
7622
|
blockNumber?: bigint | undefined | undefined;
|
|
@@ -7606,6 +7644,7 @@ export declare const getViemProvider: (provider: EthereumProvider, network: Netw
|
|
|
7606
7644
|
cacheTime?: undefined;
|
|
7607
7645
|
ccipRead?: undefined;
|
|
7608
7646
|
chain?: undefined;
|
|
7647
|
+
experimental_blockTag?: undefined;
|
|
7609
7648
|
key?: undefined;
|
|
7610
7649
|
name?: undefined;
|
|
7611
7650
|
pollingInterval?: undefined;
|
package/cjs/services/viem.js
CHANGED
|
@@ -16,6 +16,8 @@ const getViemChain = (network) => {
|
|
|
16
16
|
return chains_1.base;
|
|
17
17
|
case common_1.NetworkNumber.Linea:
|
|
18
18
|
return chains_1.linea;
|
|
19
|
+
case common_1.NetworkNumber.Plasma:
|
|
20
|
+
return chains_1.plasma;
|
|
19
21
|
default:
|
|
20
22
|
throw new Error(`Unsupported network: ${network}`);
|
|
21
23
|
}
|
|
@@ -24,12 +24,6 @@ const isEligibleForEthenaUSDeRewards = (usedAssets, { healthRatio }) => {
|
|
|
24
24
|
const anythingBorrowedNotAllowed = Object.values(usedAssets).some((asset) => asset.isBorrowed && !allowedBorrowAssets.includes(asset.symbol));
|
|
25
25
|
if (anythingBorrowedNotAllowed)
|
|
26
26
|
return { isEligible: false, eligibleUSDAmount: '0' };
|
|
27
|
-
const totalAmountBorrowed = Object.values(usedAssets).reduce((acc, asset) => {
|
|
28
|
-
if (asset.isBorrowed) {
|
|
29
|
-
return acc.add(asset.borrowedUsd);
|
|
30
|
-
}
|
|
31
|
-
return acc;
|
|
32
|
-
}, new decimal_js_1.default(0)).toString();
|
|
33
27
|
if (new decimal_js_1.default(healthRatio).gte(2.5))
|
|
34
28
|
return { isEligible: false, eligibleUSDAmount: '0' }; // health ratio must be below 2.5
|
|
35
29
|
const halfAmountSupplied = new decimal_js_1.default(totalAmountSupplied).div(2).toString();
|
|
@@ -63,4 +57,5 @@ exports.EligibilityMapping = {
|
|
|
63
57
|
[common_1.IncentiveEligibilityId.AaveV3EthenaLiquidLeverage]: exports.isEligibleForEthenaUSDeRewards,
|
|
64
58
|
[common_1.IncentiveEligibilityId.AaveV3ArbitrumEthSupply]: exports.isEligibleForAaveV3ArbitrumEthSupply,
|
|
65
59
|
[common_1.IncentiveEligibilityId.AaveV3ArbitrumETHLSBorrow]: exports.isEligibleForAaveV3ArbitrumETHLSBorrow,
|
|
60
|
+
[common_1.IncentiveEligibilityId.AaveV3EthenaLiquidLeveragePlasma]: exports.isEligibleForEthenaUSDeRewards,
|
|
66
61
|
};
|
package/cjs/types/common.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ export declare enum IncentiveKind {
|
|
|
5
5
|
export declare enum IncentiveEligibilityId {
|
|
6
6
|
AaveV3EthenaLiquidLeverage = "0x7361e6f04060154e0268a8402b073cbf97e11ae3BORROW_BL",
|
|
7
7
|
AaveV3ArbitrumEthSupply = "0x5d16261c6715a653248269861bbacf68a9774cde",
|
|
8
|
-
AaveV3ArbitrumETHLSBorrow = "0x0c84331e39d6658Cd6e6b9ba04736cC4c4734351"
|
|
8
|
+
AaveV3ArbitrumETHLSBorrow = "0x0c84331e39d6658Cd6e6b9ba04736cC4c4734351",
|
|
9
|
+
AaveV3EthenaLiquidLeveragePlasma = "0x67264783f1e9a2af8627a235853057a6fc975bd2BORROW_BL"
|
|
9
10
|
}
|
|
10
11
|
export interface IncentiveData {
|
|
11
12
|
token: string;
|
|
@@ -23,7 +24,8 @@ export declare enum NetworkNumber {
|
|
|
23
24
|
Opt = 10,
|
|
24
25
|
Arb = 42161,
|
|
25
26
|
Base = 8453,
|
|
26
|
-
Linea = 59144
|
|
27
|
+
Linea = 59144,
|
|
28
|
+
Plasma = 9745
|
|
27
29
|
}
|
|
28
30
|
export type Networkish = string | NetworkNumber;
|
|
29
31
|
export interface MMAssetData {
|
package/cjs/types/common.js
CHANGED
|
@@ -11,6 +11,7 @@ var IncentiveEligibilityId;
|
|
|
11
11
|
IncentiveEligibilityId["AaveV3EthenaLiquidLeverage"] = "0x7361e6f04060154e0268a8402b073cbf97e11ae3BORROW_BL";
|
|
12
12
|
IncentiveEligibilityId["AaveV3ArbitrumEthSupply"] = "0x5d16261c6715a653248269861bbacf68a9774cde";
|
|
13
13
|
IncentiveEligibilityId["AaveV3ArbitrumETHLSBorrow"] = "0x0c84331e39d6658Cd6e6b9ba04736cC4c4734351";
|
|
14
|
+
IncentiveEligibilityId["AaveV3EthenaLiquidLeveragePlasma"] = "0x67264783f1e9a2af8627a235853057a6fc975bd2BORROW_BL";
|
|
14
15
|
})(IncentiveEligibilityId || (exports.IncentiveEligibilityId = IncentiveEligibilityId = {}));
|
|
15
16
|
var NetworkNumber;
|
|
16
17
|
(function (NetworkNumber) {
|
|
@@ -19,4 +20,5 @@ var NetworkNumber;
|
|
|
19
20
|
NetworkNumber[NetworkNumber["Arb"] = 42161] = "Arb";
|
|
20
21
|
NetworkNumber[NetworkNumber["Base"] = 8453] = "Base";
|
|
21
22
|
NetworkNumber[NetworkNumber["Linea"] = 59144] = "Linea";
|
|
23
|
+
NetworkNumber[NetworkNumber["Plasma"] = 9745] = "Plasma";
|
|
22
24
|
})(NetworkNumber || (exports.NetworkNumber = NetworkNumber = {}));
|
package/esm/aaveV3/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { AaveIncentiveDataProviderV3ContractViem, AaveIncentivesControllerViem,
|
|
|
13
13
|
import { aaveAnyGetAggregatedPositionData, aaveV3IsInIsolationMode, aaveV3IsInSiloedMode } from '../helpers/aaveHelpers';
|
|
14
14
|
import { AAVE_V3 } from '../markets/aave';
|
|
15
15
|
import { aprToApy, calculateBorrowingAssetLimit } from '../moneymarket';
|
|
16
|
-
import {
|
|
16
|
+
import { getWrappedNativeAssetFromUnwrapped, isEnabledOnBitmap, isLayer2Network, wethToEth, wethToEthByAddress, } from '../services/utils';
|
|
17
17
|
import { getStakingApy, STAKING_ASSETS } from '../staking';
|
|
18
18
|
import { IncentiveKind, NetworkNumber, } from '../types/common';
|
|
19
19
|
import { getViemProvider, setViemBlockNumber } from '../services/viem';
|
|
@@ -47,12 +47,12 @@ export const aaveV3EmodeCategoriesMapping = (extractedState, usedAssets) => {
|
|
|
47
47
|
};
|
|
48
48
|
export function _getAaveV3MarketData(provider_1, network_1, market_1) {
|
|
49
49
|
return __awaiter(this, arguments, void 0, function* (provider, network, market, blockNumber = 'latest') {
|
|
50
|
-
const _addresses = market.assets.map(a => getAssetInfo(
|
|
50
|
+
const _addresses = market.assets.map(a => getAssetInfo(getWrappedNativeAssetFromUnwrapped(a), network).address);
|
|
51
51
|
const isL2 = isLayer2Network(network);
|
|
52
52
|
const loanInfoContract = AaveV3ViewContractViem(provider, network);
|
|
53
53
|
const aaveIncentivesContract = AaveIncentiveDataProviderV3ContractViem(provider, network);
|
|
54
54
|
const marketAddress = market.providerAddress;
|
|
55
|
-
const networksWithIncentives = [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Opt, NetworkNumber.Linea];
|
|
55
|
+
const networksWithIncentives = [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Opt, NetworkNumber.Linea, NetworkNumber.Plasma];
|
|
56
56
|
// eslint-disable-next-line prefer-const
|
|
57
57
|
let [loanInfo, eModesInfo, isBorrowAllowed, rewardInfo, merkleRewardsMap, meritRewardsMap] = yield Promise.all([
|
|
58
58
|
loanInfoContract.read.getFullTokensInfo([marketAddress, _addresses], setViemBlockNumber(blockNumber)),
|
|
@@ -353,7 +353,7 @@ export const _getAaveV3AccountData = (provider_1, network_1, address_1, extracte
|
|
|
353
353
|
const loanInfoContract = AaveV3ViewContractViem(provider, network);
|
|
354
354
|
const lendingPoolContract = createViemContractFromConfigFunc(market.lendingPool, market.lendingPoolAddress)(provider, network);
|
|
355
355
|
const marketAddress = market.providerAddress;
|
|
356
|
-
const _addresses = market.assets.map((a) => getAssetInfo(
|
|
356
|
+
const _addresses = market.assets.map((a) => getAssetInfo(getWrappedNativeAssetFromUnwrapped(a), network).address);
|
|
357
357
|
const middleAddressIndex = Math.floor(_addresses.length / 2); // split addresses in half to avoid gas limit by multicall
|
|
358
358
|
const [eModeCategory, tokenBalances1, tokenBalances2] = yield Promise.all([
|
|
359
359
|
lendingPoolContract.read.getUserEMode([address], setViemBlockNumber(blockNumber)),
|
package/esm/aaveV3/merit.js
CHANGED
package/esm/aaveV3/merkl.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MerkleRewardMap } from '../types';
|
|
2
2
|
import { NetworkNumber } from '../types/common';
|
|
3
|
-
export declare const getAaveUnderlyingSymbol: (_symbol?: string) =>
|
|
3
|
+
export declare const getAaveUnderlyingSymbol: (_symbol?: string) => string;
|
|
4
4
|
/**
|
|
5
5
|
* aEthLidoUSDC -> aUSDC
|
|
6
6
|
* USDC -> USDC
|
|
@@ -28303,6 +28303,11 @@ export declare const AaveV3View: {
|
|
|
28303
28303
|
};
|
|
28304
28304
|
};
|
|
28305
28305
|
};
|
|
28306
|
+
readonly "9745": {
|
|
28307
|
+
readonly address: "0xD8E67968d8a0df4beCf2D50daE1e34d4d80C701C";
|
|
28308
|
+
readonly createdBlock: 1880799;
|
|
28309
|
+
readonly oldVersions: {};
|
|
28310
|
+
};
|
|
28306
28311
|
};
|
|
28307
28312
|
};
|
|
28308
28313
|
export declare const AaveV3PoolAddressesProvider: {
|
|
@@ -28763,6 +28768,9 @@ export declare const AaveV3PoolAddressesProvider: {
|
|
|
28763
28768
|
readonly "59144": {
|
|
28764
28769
|
readonly address: "0x89502c3731F69DDC95B65753708A07F8Cd0373F4";
|
|
28765
28770
|
};
|
|
28771
|
+
readonly "9745": {
|
|
28772
|
+
readonly address: "0x061D8e131F26512348ee5FA42e2DF1bA9d6505E9";
|
|
28773
|
+
};
|
|
28766
28774
|
};
|
|
28767
28775
|
};
|
|
28768
28776
|
export declare const AaveV3LidoPoolAddressesProvider: {
|
|
@@ -31133,6 +31141,9 @@ export declare const AaveV3LendingPool: {
|
|
|
31133
31141
|
readonly "59144": {
|
|
31134
31142
|
readonly address: "0xc47b8C00b0f69a36fa203Ffeac0334874574a8Ac";
|
|
31135
31143
|
};
|
|
31144
|
+
readonly "9745": {
|
|
31145
|
+
readonly address: "0x925a2A7214Ed92428B5b1B090F80b25700095e12";
|
|
31146
|
+
};
|
|
31136
31147
|
};
|
|
31137
31148
|
};
|
|
31138
31149
|
export declare const AaveV3LidoLendingPool: {
|
|
@@ -34467,6 +34478,9 @@ export declare const AaveV3ProtocolDataProvider: {
|
|
|
34467
34478
|
readonly "59144": {
|
|
34468
34479
|
readonly address: "0x47cd4b507B81cB831669c71c7077f4daF6762FF4";
|
|
34469
34480
|
};
|
|
34481
|
+
readonly "9745": {
|
|
34482
|
+
readonly address: "0xf2D6E38B407e31E7E7e4a16E6769728b76c7419F";
|
|
34483
|
+
};
|
|
34470
34484
|
};
|
|
34471
34485
|
};
|
|
34472
34486
|
export declare const AaveV3LidoProtocolDataProvider: {
|
|
@@ -35805,6 +35819,9 @@ export declare const AaveUiIncentiveDataProviderV3: {
|
|
|
35805
35819
|
readonly "59144": {
|
|
35806
35820
|
readonly address: "0x117684358D990E42Eb1649E7e8C4691951dc1E71";
|
|
35807
35821
|
};
|
|
35822
|
+
readonly "9745": {
|
|
35823
|
+
readonly address: "0xcb85C501B3A5e9851850d66648d69B26A4c90942";
|
|
35824
|
+
};
|
|
35808
35825
|
};
|
|
35809
35826
|
};
|
|
35810
35827
|
export declare const cUSDCv3: {
|
|
@@ -84964,6 +84981,9 @@ export declare const AaveRewardsController: {
|
|
|
84964
84981
|
readonly "59144": {
|
|
84965
84982
|
readonly address: "0xc67bb8F2314fA0df50cBa314c6509A7bdAD500C0";
|
|
84966
84983
|
};
|
|
84984
|
+
readonly "9745": {
|
|
84985
|
+
readonly address: "0x3A57eAa3Ca3794D66977326af7991eB3F6dD5a5A";
|
|
84986
|
+
};
|
|
84967
84987
|
};
|
|
84968
84988
|
};
|
|
84969
84989
|
export declare const LiquityV2ActivePool: {
|
package/esm/config/contracts.js
CHANGED
|
@@ -227,6 +227,11 @@ export const AaveV3View = {
|
|
|
227
227
|
"address": "0xc9D6EfA6e08B66a5Cdc516Bcd5807c2fa69E0f2A"
|
|
228
228
|
}
|
|
229
229
|
},
|
|
230
|
+
},
|
|
231
|
+
"9745": {
|
|
232
|
+
"address": "0xD8E67968d8a0df4beCf2D50daE1e34d4d80C701C",
|
|
233
|
+
"createdBlock": 1880799,
|
|
234
|
+
"oldVersions": {},
|
|
230
235
|
}
|
|
231
236
|
}
|
|
232
237
|
};
|
|
@@ -247,6 +252,9 @@ export const AaveV3PoolAddressesProvider = {
|
|
|
247
252
|
},
|
|
248
253
|
"59144": {
|
|
249
254
|
"address": "0x89502c3731F69DDC95B65753708A07F8Cd0373F4"
|
|
255
|
+
},
|
|
256
|
+
"9745": {
|
|
257
|
+
"address": "0x061D8e131F26512348ee5FA42e2DF1bA9d6505E9"
|
|
250
258
|
}
|
|
251
259
|
}
|
|
252
260
|
};
|
|
@@ -283,6 +291,9 @@ export const AaveV3LendingPool = {
|
|
|
283
291
|
},
|
|
284
292
|
"59144": {
|
|
285
293
|
"address": "0xc47b8C00b0f69a36fa203Ffeac0334874574a8Ac"
|
|
294
|
+
},
|
|
295
|
+
"9745": {
|
|
296
|
+
"address": "0x925a2A7214Ed92428B5b1B090F80b25700095e12"
|
|
286
297
|
}
|
|
287
298
|
}
|
|
288
299
|
};
|
|
@@ -319,6 +330,9 @@ export const AaveV3ProtocolDataProvider = {
|
|
|
319
330
|
},
|
|
320
331
|
"59144": {
|
|
321
332
|
"address": "0x47cd4b507B81cB831669c71c7077f4daF6762FF4"
|
|
333
|
+
},
|
|
334
|
+
"9745": {
|
|
335
|
+
"address": "0xf2D6E38B407e31E7E7e4a16E6769728b76c7419F"
|
|
322
336
|
}
|
|
323
337
|
}
|
|
324
338
|
};
|
|
@@ -355,6 +369,9 @@ export const AaveUiIncentiveDataProviderV3 = {
|
|
|
355
369
|
},
|
|
356
370
|
"59144": {
|
|
357
371
|
"address": "0x117684358D990E42Eb1649E7e8C4691951dc1E71"
|
|
372
|
+
},
|
|
373
|
+
"9745": {
|
|
374
|
+
"address": "0xcb85C501B3A5e9851850d66648d69B26A4c90942"
|
|
358
375
|
}
|
|
359
376
|
}
|
|
360
377
|
};
|
|
@@ -1205,6 +1222,9 @@ export const AaveRewardsController = {
|
|
|
1205
1222
|
},
|
|
1206
1223
|
"59144": {
|
|
1207
1224
|
"address": "0xc67bb8F2314fA0df50cBa314c6509A7bdAD500C0"
|
|
1225
|
+
},
|
|
1226
|
+
"9745": {
|
|
1227
|
+
"address": "0x3A57eAa3Ca3794D66977326af7991eB3F6dD5a5A"
|
|
1208
1228
|
}
|
|
1209
1229
|
}
|
|
1210
1230
|
};
|
|
@@ -44,4 +44,4 @@ export declare const getApyAfterValuesEstimation: (selectedMarket: AaveMarketInf
|
|
|
44
44
|
/**
|
|
45
45
|
* won't cover all cases
|
|
46
46
|
*/
|
|
47
|
-
export declare const getAaveUnderlyingSymbol: (_symbol?: string) =>
|
|
47
|
+
export declare const getAaveUnderlyingSymbol: (_symbol?: string) => string;
|
|
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
import Dec from 'decimal.js';
|
|
22
22
|
import { assetAmountInWei, getAssetInfo, getAssetInfoByAddress } from '@defisaver/tokens';
|
|
23
23
|
import { AaveVersions, } from '../../types';
|
|
24
|
-
import {
|
|
24
|
+
import { getNativeAssetFromWrapped, getWrappedNativeAssetFromUnwrapped } from '../../services/utils';
|
|
25
25
|
import { aprToApy, calcLeverageLiqPrice, getAssetsTotal, isLeveragedPos, } from '../../moneymarket';
|
|
26
26
|
import { calculateNetApy } from '../../staking';
|
|
27
27
|
import { borrowOperations } from '../../constants';
|
|
@@ -52,7 +52,7 @@ export const aaveAnyGetSuppliableAsCollAssets = (_a) => {
|
|
|
52
52
|
return aaveAnyGetSuppliableAssets(Object.assign({ usedAssets, eModeCategory, assetsData, selectedMarket, network }, rest)).filter(({ canBeCollateral }) => canBeCollateral);
|
|
53
53
|
};
|
|
54
54
|
export const aaveAnyGetEmodeMutableProps = ({ eModeCategory, eModeCategoriesData, assetsData, }, _asset) => {
|
|
55
|
-
const asset =
|
|
55
|
+
const asset = getNativeAssetFromWrapped(_asset);
|
|
56
56
|
const assetData = assetsData[asset];
|
|
57
57
|
const eModeCategoryData = (eModeCategoriesData === null || eModeCategoriesData === void 0 ? void 0 : eModeCategoriesData[eModeCategory]) || { collateralAssets: [], collateralFactor: '0', liquidationRatio: '0' };
|
|
58
58
|
if (eModeCategory === 0
|
|
@@ -110,7 +110,7 @@ const getApyAfterValuesEstimationInner = (selectedMarket, actions, client, netwo
|
|
|
110
110
|
const params = actions.map(({ action, asset, amount }) => {
|
|
111
111
|
const isDebtAsset = borrowOperations.includes(action);
|
|
112
112
|
const amountInWei = assetAmountInWei(amount, asset);
|
|
113
|
-
const assetInfo = getAssetInfo(
|
|
113
|
+
const assetInfo = getAssetInfo(getWrappedNativeAssetFromUnwrapped(asset), network);
|
|
114
114
|
let liquidityAdded;
|
|
115
115
|
let liquidityTaken;
|
|
116
116
|
if (isDebtAsset) {
|
|
@@ -132,7 +132,7 @@ const getApyAfterValuesEstimationInner = (selectedMarket, actions, client, netwo
|
|
|
132
132
|
const data = yield viewContract.read.getApyAfterValuesEstimation([selectedMarket.providerAddress, params]);
|
|
133
133
|
const rates = {};
|
|
134
134
|
data.forEach((d) => {
|
|
135
|
-
const asset =
|
|
135
|
+
const asset = getNativeAssetFromWrapped(getAssetInfoByAddress(d.reserveAddress, network).symbol);
|
|
136
136
|
rates[asset] = {
|
|
137
137
|
supplyRate: aprToApy(new Dec(d.supplyRate.toString()).div(1e25).toString()),
|
|
138
138
|
borrowRate: aprToApy(new Dec(d.variableBorrowRate.toString()).div(1e25).toString()),
|
|
@@ -151,8 +151,10 @@ export const getAaveUnderlyingSymbol = (_symbol = '') => {
|
|
|
151
151
|
.replace(/^aEth/, '')
|
|
152
152
|
.replace(/^aArb/, '')
|
|
153
153
|
.replace(/^aOpt/, '')
|
|
154
|
+
.replace(/^aLin/, '')
|
|
155
|
+
.replace(/^aPla/, '')
|
|
154
156
|
.replace(/^aBas/, '');
|
|
155
157
|
if (symbol.startsWith('a'))
|
|
156
158
|
symbol = symbol.slice(1);
|
|
157
|
-
return
|
|
159
|
+
return getNativeAssetFromWrapped(symbol);
|
|
158
160
|
};
|
|
@@ -56,4 +56,4 @@ export declare const getRewardsForMarket: (marketId: string, network?: NetworkNu
|
|
|
56
56
|
supplyApy: string;
|
|
57
57
|
borrowApy: string;
|
|
58
58
|
}>;
|
|
59
|
-
export declare const getMorphoUnderlyingSymbol: (_symbol: string) =>
|
|
59
|
+
export declare const getMorphoUnderlyingSymbol: (_symbol: string) => string;
|