impermax-sdk 1.2.77 → 1.2.79
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/lib/config/amms.js +10 -0
- package/lib/config/contracts/claim-aggregators.js +1 -0
- package/lib/config/contracts/impermax-chef.js +1 -0
- package/lib/config/contracts/impermax-config-manager.js +1 -0
- package/lib/config/contracts/impermax-factories.js +3 -0
- package/lib/config/contracts/imxes.js +1 -0
- package/lib/config/contracts/lending-vault-watcher.js +1 -0
- package/lib/config/contracts/merkle-distributors.js +3 -0
- package/lib/config/contracts/routers.js +4 -0
- package/lib/config/contracts/simple-uniswap-oracles.js +1 -0
- package/lib/config/contracts/weths.js +2 -1
- package/lib/config/debank-ids.js +1 -0
- package/lib/config/endpoints/merkle-distributors.js +3 -0
- package/lib/config/eth.js +2 -0
- package/lib/config/farms.js +3 -0
- package/lib/config/subgraphs.js +6 -0
- package/lib/config/types.d.ts +2 -1
- package/lib/config/types.js +1 -0
- package/lib/offchain/lendingPool/offchainLendingPool.d.ts +0 -1
- package/lib/offchain/lendingPool/offchainLendingPool.js +4 -13
- package/lib/offchain/offchainAPRHelper.js +1 -0
- package/lib/offchain/offchainInitializer.js +2 -1
- package/package.json +1 -1
package/lib/config/amms.js
CHANGED
|
@@ -168,6 +168,9 @@ exports.AMM_FACTORY = {
|
|
|
168
168
|
},
|
|
169
169
|
[types_1.Networks.Optimism]: {
|
|
170
170
|
[Amms.velodrome]: '0xF1046053aa5682b4F9a81b5481394DA16BE5FF5a',
|
|
171
|
+
},
|
|
172
|
+
[types_1.Networks.Real]: {
|
|
173
|
+
[Amms.pearlStable]: '0x317371f126680734D7dB2aCe2D751Ffc0Bd4b771',
|
|
171
174
|
}
|
|
172
175
|
};
|
|
173
176
|
function getAmmByFactory(network, address) {
|
|
@@ -236,6 +239,7 @@ exports.AMM_SUBGRAPH_URLS = {
|
|
|
236
239
|
},
|
|
237
240
|
[types_1.Networks.Mantle]: {},
|
|
238
241
|
[types_1.Networks.Scroll]: {},
|
|
242
|
+
[types_1.Networks.Real]: {},
|
|
239
243
|
[types_1.Networks.Optimism]: {},
|
|
240
244
|
};
|
|
241
245
|
exports.ADD_LIQUIDITY_URLS = {
|
|
@@ -313,6 +317,9 @@ exports.ADD_LIQUIDITY_URLS = {
|
|
|
313
317
|
},
|
|
314
318
|
[types_1.Networks.Optimism]: {
|
|
315
319
|
[Amms.velodrome]: 'https://velodrome.finance/deposit/',
|
|
320
|
+
},
|
|
321
|
+
[types_1.Networks.Real]: {
|
|
322
|
+
[Amms.pearlStable]: 'https://pearl.exchnage/supply-liquidity/',
|
|
316
323
|
}
|
|
317
324
|
};
|
|
318
325
|
exports.AMM_LP_FEE = {
|
|
@@ -390,5 +397,8 @@ exports.AMM_LP_FEE = {
|
|
|
390
397
|
},
|
|
391
398
|
[types_1.Networks.Optimism]: {
|
|
392
399
|
[Amms.velodrome]: 0,
|
|
400
|
+
},
|
|
401
|
+
[types_1.Networks.Real]: {
|
|
402
|
+
[Amms.pearlStable]: 0,
|
|
393
403
|
}
|
|
394
404
|
};
|
|
@@ -21,4 +21,5 @@ exports.IMPERMAX_CONFIG_MANAGER = {
|
|
|
21
21
|
[types_1.Networks.Scroll]: '0x90869a451f966d848b85Da57e2a65A545AFb6087',
|
|
22
22
|
[types_1.Networks.Mantle]: '0x6daC1AbEA1E903765358EFD4Ac4e6E817F78F4CB',
|
|
23
23
|
[types_1.Networks.Optimism]: '0xC8301bD3f86e642904aeD9b588cA9d9350b3B160',
|
|
24
|
+
[types_1.Networks.Real]: '0x274C36c461C02B39a110A0801EbB218eC076B79B',
|
|
24
25
|
};
|
|
@@ -50,6 +50,9 @@ exports.IMPERMAX_FACTORY = {
|
|
|
50
50
|
[types_1.Factory.SOLV2]: '0x02Ff7B4d96EeBF8c9B34Fae0418E591e11da3099',
|
|
51
51
|
[types_1.Factory.SOL_STABLE]: '0xFBD17F3AA7d6506601D2bF7e15a6C96081296a01',
|
|
52
52
|
},
|
|
53
|
+
[types_1.Networks.Real]: {
|
|
54
|
+
[types_1.Factory.SOL_STABLE]: '0x3B1f3a48A70e372144307A4b126A5cDA46E169AD',
|
|
55
|
+
},
|
|
53
56
|
[types_1.Networks.Mantle]: {
|
|
54
57
|
[types_1.Factory.V2V2]: '0x3047523D5ed0df1545B1C440BdAaB095f1f3cf5C'
|
|
55
58
|
},
|
|
@@ -21,6 +21,7 @@ exports.MERKLE_DISTRIBUTOR_IBEX = {
|
|
|
21
21
|
[types_1.Networks.Mantle]: '',
|
|
22
22
|
[types_1.Networks.Scroll]: '',
|
|
23
23
|
[types_1.Networks.Optimism]: '',
|
|
24
|
+
[types_1.Networks.Real]: '',
|
|
24
25
|
};
|
|
25
26
|
exports.MERKLE_DISTRIBUTOR_IBEX_2 = {
|
|
26
27
|
[types_1.Networks.Polygon]: '0x1c813cDd6dAecE2CB83C52F0798504e42816E9C5',
|
|
@@ -41,6 +42,7 @@ exports.MERKLE_DISTRIBUTOR_IBEX_2 = {
|
|
|
41
42
|
[types_1.Networks.Mantle]: '',
|
|
42
43
|
[types_1.Networks.Scroll]: '',
|
|
43
44
|
[types_1.Networks.Optimism]: '',
|
|
45
|
+
[types_1.Networks.Real]: '',
|
|
44
46
|
};
|
|
45
47
|
exports.MERKLE_DISTRIBUTOR_ETH = {
|
|
46
48
|
[types_1.Networks.Polygon]: '0x7ce2f634f0698ecdca051ef1dc4be96ef3d05a62',
|
|
@@ -61,4 +63,5 @@ exports.MERKLE_DISTRIBUTOR_ETH = {
|
|
|
61
63
|
[types_1.Networks.Mantle]: '',
|
|
62
64
|
[types_1.Networks.Scroll]: '',
|
|
63
65
|
[types_1.Networks.Optimism]: '',
|
|
66
|
+
[types_1.Networks.Real]: '',
|
|
64
67
|
};
|
|
@@ -60,6 +60,9 @@ exports.ROUTER = {
|
|
|
60
60
|
[types_1.Networks.Mantle]: {
|
|
61
61
|
[types_1.Factory.V2V2]: '0xF4A9dda025e65945E7A3F873D6146A12c8110A19'
|
|
62
62
|
},
|
|
63
|
+
[types_1.Networks.Real]: {
|
|
64
|
+
[types_1.Factory.SOL_STABLE]: '0x3784D354863fe8862d60E446E3f29A08c21D1Ea9'
|
|
65
|
+
},
|
|
63
66
|
};
|
|
64
67
|
exports.DEFAULT_ROUTER = {
|
|
65
68
|
[types_1.Networks.Ropsten]: '0xbFf4acF789297A8507Eb7493AE18EB2C3A3A9632',
|
|
@@ -78,6 +81,7 @@ exports.DEFAULT_ROUTER = {
|
|
|
78
81
|
[types_1.Networks.Sxnetwork]: '',
|
|
79
82
|
[types_1.Networks.Base]: '0x1EBC3b5911B99aDdE07944c75D9E03958abdB49f',
|
|
80
83
|
[types_1.Networks.Scroll]: '0xFF8D0CDC9C857c7fA265121394558B26e1eAAffE',
|
|
84
|
+
[types_1.Networks.Real]: '0x3784D354863fe8862d60E446E3f29A08c21D1Ea9',
|
|
81
85
|
[types_1.Networks.Mantle]: '0xF4A9dda025e65945E7A3F873D6146A12c8110A19',
|
|
82
86
|
[types_1.Networks.Optimism]: '0xb5657FA5ba87CaD11b9150c319069625d423aaD4',
|
|
83
87
|
};
|
|
@@ -38,6 +38,7 @@ exports.SIMPLE_UNISWAP_ORACLE = {
|
|
|
38
38
|
[types_1.Factory.V2V2]: "0x1fd55593ccD75e5727bb71bEB155e86d7290eAD6"
|
|
39
39
|
},
|
|
40
40
|
[types_1.Networks.Scroll]: {},
|
|
41
|
+
[types_1.Networks.Real]: {},
|
|
41
42
|
[types_1.Networks.Optimism]: {},
|
|
42
43
|
[types_1.Networks.Mantle]: {
|
|
43
44
|
[types_1.Factory.V2V2]: '0x936c30E14daED88fd29bf4FCe2965EbEDe633846'
|
|
@@ -21,5 +21,6 @@ exports.WETH = {
|
|
|
21
21
|
[types_1.Networks.Base]: '0x4200000000000000000000000000000000000006',
|
|
22
22
|
[types_1.Networks.Mantle]: '0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8',
|
|
23
23
|
[types_1.Networks.Scroll]: '0x5300000000000000000000000000000000000004',
|
|
24
|
-
[types_1.Networks.Optimism]: '0x4200000000000000000000000000000000000006',
|
|
24
|
+
[types_1.Networks.Optimism]: '0x4200000000000000000000000000000000000006',
|
|
25
|
+
[types_1.Networks.Real]: '0x90c6E93849E06EC7478ba24522329d14A5954Df4', // reETH
|
|
25
26
|
};
|
package/lib/config/debank-ids.js
CHANGED
|
@@ -21,6 +21,7 @@ exports.MERKLE_URL_IBEX = {
|
|
|
21
21
|
[types_1.Networks.Mantle]: '',
|
|
22
22
|
[types_1.Networks.Scroll]: '',
|
|
23
23
|
[types_1.Networks.Optimism]: '',
|
|
24
|
+
[types_1.Networks.Real]: '',
|
|
24
25
|
};
|
|
25
26
|
exports.MERKLE_URL_IBEX_2 = {
|
|
26
27
|
[types_1.Networks.Polygon]: 'https://misty-rice-9880.impermax.workers.dev',
|
|
@@ -41,6 +42,7 @@ exports.MERKLE_URL_IBEX_2 = {
|
|
|
41
42
|
[types_1.Networks.Mantle]: '',
|
|
42
43
|
[types_1.Networks.Scroll]: '',
|
|
43
44
|
[types_1.Networks.Optimism]: '',
|
|
45
|
+
[types_1.Networks.Real]: '',
|
|
44
46
|
};
|
|
45
47
|
exports.MERKLE_URL_ETH = {
|
|
46
48
|
[types_1.Networks.Polygon]: 'https://damp-hill-13d0.impermax.workers.dev',
|
|
@@ -61,4 +63,5 @@ exports.MERKLE_URL_ETH = {
|
|
|
61
63
|
[types_1.Networks.Mantle]: '',
|
|
62
64
|
[types_1.Networks.Scroll]: '',
|
|
63
65
|
[types_1.Networks.Optimism]: '',
|
|
66
|
+
[types_1.Networks.Real]: '',
|
|
64
67
|
};
|
package/lib/config/eth.js
CHANGED
|
@@ -21,6 +21,7 @@ exports.ETH_NAME = {
|
|
|
21
21
|
[types_1.Networks.Mantle]: 'Mantle',
|
|
22
22
|
[types_1.Networks.Scroll]: 'Ethereum',
|
|
23
23
|
[types_1.Networks.Optimism]: 'Ethereum',
|
|
24
|
+
[types_1.Networks.Real]: 'Ethereum',
|
|
24
25
|
};
|
|
25
26
|
exports.ETH_SYMBOL = {
|
|
26
27
|
[types_1.Networks.Ropsten]: 'ETH',
|
|
@@ -41,4 +42,5 @@ exports.ETH_SYMBOL = {
|
|
|
41
42
|
[types_1.Networks.Mantle]: 'MNT',
|
|
42
43
|
[types_1.Networks.Scroll]: 'ETH',
|
|
43
44
|
[types_1.Networks.Optimism]: 'ETH',
|
|
45
|
+
[types_1.Networks.Real]: 'reETH',
|
|
44
46
|
};
|
package/lib/config/farms.js
CHANGED
|
@@ -179,6 +179,9 @@ exports.STAKED_LP_FACTORY = {
|
|
|
179
179
|
},
|
|
180
180
|
[types_1.Networks.Optimism]: {
|
|
181
181
|
[Farms.velodrome]: '0x47183bB55AD0F891887E099Cec3570d3C667cD00',
|
|
182
|
+
},
|
|
183
|
+
[types_1.Networks.Real]: {
|
|
184
|
+
[Farms.pearlStable]: '0x317371f126680734D7dB2aCe2D751Ffc0Bd4b771',
|
|
182
185
|
}
|
|
183
186
|
};
|
|
184
187
|
function getFarmByStakedLPFactory(network, address) {
|
package/lib/config/subgraphs.js
CHANGED
|
@@ -56,6 +56,9 @@ exports.IMPERMAX_SUBGRAPH_URL = {
|
|
|
56
56
|
[types_1.Networks.Optimism]: {
|
|
57
57
|
[types_1.Factory.SOLV2]: 'https://api.studio.thegraph.com/query/46041/impermax-optimism-solv2/v0.0.1'
|
|
58
58
|
},
|
|
59
|
+
[types_1.Networks.Real]: {
|
|
60
|
+
[types_1.Factory.SOL_STABLE]: 'https://api.goldsky.com/api/public/project_cm2d5q4l4w31601vz4swb3vmi/subgraphs/impermax-finance/impermax-real-v2-stable/gn'
|
|
61
|
+
},
|
|
59
62
|
};
|
|
60
63
|
exports.IMPERMAX_CHEF_SUBGRAPH_URL = {
|
|
61
64
|
[types_1.Networks.Ropsten]: '',
|
|
@@ -77,6 +80,7 @@ exports.IMPERMAX_CHEF_SUBGRAPH_URL = {
|
|
|
77
80
|
[types_1.Networks.Mantle]: '',
|
|
78
81
|
[types_1.Networks.Scroll]: '',
|
|
79
82
|
[types_1.Networks.Optimism]: '',
|
|
83
|
+
[types_1.Networks.Real]: '',
|
|
80
84
|
};
|
|
81
85
|
exports.LENDING_VAULT_SUBGRAPH_URL = {
|
|
82
86
|
[types_1.Networks.Ropsten]: '',
|
|
@@ -96,6 +100,7 @@ exports.LENDING_VAULT_SUBGRAPH_URL = {
|
|
|
96
100
|
[types_1.Networks.Base]: 'https://api.studio.thegraph.com/query/46041/lending-vault-base/v0.0.1',
|
|
97
101
|
[types_1.Networks.Mantle]: '',
|
|
98
102
|
[types_1.Networks.Optimism]: '',
|
|
103
|
+
[types_1.Networks.Real]: '',
|
|
99
104
|
[types_1.Networks.Scroll]: 'https://api.studio.thegraph.com/query/46041/lending-vault-scroll/v0.0.1',
|
|
100
105
|
};
|
|
101
106
|
exports.BLOCKS_SUBGRAPH_URL = {
|
|
@@ -116,6 +121,7 @@ exports.BLOCKS_SUBGRAPH_URL = {
|
|
|
116
121
|
[types_1.Networks.Base]: 'https://api.thegraph.com/subgraphs/name/blocklytics/base-blocks',
|
|
117
122
|
[types_1.Networks.Mantle]: '',
|
|
118
123
|
[types_1.Networks.Scroll]: '',
|
|
124
|
+
[types_1.Networks.Real]: '',
|
|
119
125
|
[types_1.Networks.Optimism]: '',
|
|
120
126
|
};
|
|
121
127
|
exports.XIMX_SUBGRAPH_URL = "https://api.thegraph.com/subgraphs/name/impermax-finance/imx-staking";
|
package/lib/config/types.d.ts
CHANGED
package/lib/config/types.js
CHANGED
|
@@ -11,7 +11,6 @@ export default class OffchainLendingPool {
|
|
|
11
11
|
private readonly factory;
|
|
12
12
|
private readonly pairAddress;
|
|
13
13
|
private readonly poolTokens;
|
|
14
|
-
private readonly llamaAPRChains;
|
|
15
14
|
constructor(offchain: Offchain, factory: Factory, pairAddress: Address);
|
|
16
15
|
getOffchain: () => Offchain;
|
|
17
16
|
getFactory: () => Factory;
|
|
@@ -21,13 +21,6 @@ const amms_1 = require("../../config/amms");
|
|
|
21
21
|
const factories_1 = require("../../config/factories");
|
|
22
22
|
class OffchainLendingPool {
|
|
23
23
|
constructor(offchain, factory, pairAddress) {
|
|
24
|
-
// NOTE: We try to get the defillama APRs on these chains only, add more if needed
|
|
25
|
-
this.llamaAPRChains = [
|
|
26
|
-
types_1.Networks.Fantom,
|
|
27
|
-
types_1.Networks.Optimism,
|
|
28
|
-
types_1.Networks.Scroll,
|
|
29
|
-
types_1.Networks.Base
|
|
30
|
-
];
|
|
31
24
|
this.getOffchain = () => this.offchain;
|
|
32
25
|
this.getFactory = () => this.factory;
|
|
33
26
|
this.getPairAddress = () => this.pairAddress;
|
|
@@ -225,12 +218,10 @@ class OffchainLendingPool {
|
|
|
225
218
|
getTotalAPR() {
|
|
226
219
|
return __awaiter(this, void 0, void 0, function* () {
|
|
227
220
|
const uniswapV2Pair = (yield this.getLendingPoolData()).pair.uniswapV2PairAddress;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
return apr;
|
|
233
|
-
}
|
|
221
|
+
// If llama fails/apr is 0 we get the uniswapAPR and stakingAPR through subgraph
|
|
222
|
+
const apr = yield this.offchain.getAPRHelper().getLlamaAPR(uniswapV2Pair, this.offchain.network);
|
|
223
|
+
if (apr > 0)
|
|
224
|
+
return apr;
|
|
234
225
|
const [uniswapAPR, stakingAPR] = yield Promise.all([this.getUniswapAPR(), this.getStakingAPR()]);
|
|
235
226
|
return uniswapAPR + stakingAPR;
|
|
236
227
|
});
|
|
@@ -30,6 +30,7 @@ const LlamaChains = {
|
|
|
30
30
|
[types_1.Networks.Mantle]: "mantle",
|
|
31
31
|
[types_1.Networks.Scroll]: "scroll",
|
|
32
32
|
[types_1.Networks.Optimism]: "optimism",
|
|
33
|
+
[types_1.Networks.Real]: "re.al",
|
|
33
34
|
};
|
|
34
35
|
// Class to get the APR from DefiLlama directly, only makes 1 call to api and caches all pools
|
|
35
36
|
class OffchainAPRHelper {
|
|
@@ -468,7 +468,8 @@ function initializeTvlData() {
|
|
|
468
468
|
types_1.Networks.ZksyncEra,
|
|
469
469
|
types_1.Networks.Mantle,
|
|
470
470
|
types_1.Networks.Base,
|
|
471
|
-
types_1.Networks.Scroll
|
|
471
|
+
types_1.Networks.Scroll,
|
|
472
|
+
types_1.Networks.Real
|
|
472
473
|
]; // exclude ropsten
|
|
473
474
|
const calls = [];
|
|
474
475
|
for (const network of networks) {
|