impermax-sdk 1.2.23 → 1.2.25

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.
@@ -31,7 +31,8 @@ export declare enum Amms {
31
31
  vesync = "vesync",
32
32
  solunea = "solunea",
33
33
  pearl = "pearl",
34
- pearlStable = "pearlStable"
34
+ pearlStable = "pearlStable",
35
+ aerodrome = "aerodrome"
35
36
  }
36
37
  export declare const hrAmms: {
37
38
  uniswap: string;
@@ -66,6 +67,7 @@ export declare const hrAmms: {
66
67
  draculafi: string;
67
68
  vesync: string;
68
69
  solunea: string;
70
+ aerodrome: string;
69
71
  };
70
72
  export declare const AMM_FACTORY: AmmIndex;
71
73
  export declare function getAmmByFactory(network: Networks, address: Address): Amms | null;
@@ -36,6 +36,7 @@ var Amms;
36
36
  Amms["solunea"] = "solunea";
37
37
  Amms["pearl"] = "pearl";
38
38
  Amms["pearlStable"] = "pearlStable";
39
+ Amms["aerodrome"] = "aerodrome";
39
40
  })(Amms = exports.Amms || (exports.Amms = {}));
40
41
  exports.hrAmms = {
41
42
  [Amms.uniswap]: 'Uniswap',
@@ -70,6 +71,7 @@ exports.hrAmms = {
70
71
  [Amms.draculafi]: 'DraculaFi',
71
72
  [Amms.vesync]: 'VeSync',
72
73
  [Amms.solunea]: 'Solunea',
74
+ [Amms.aerodrome]: 'Aerodrome',
73
75
  };
74
76
  exports.AMM_FACTORY = {
75
77
  [types_1.Networks.Ropsten]: {
@@ -130,6 +132,9 @@ exports.AMM_FACTORY = {
130
132
  [types_1.Networks.Harmony]: {},
131
133
  [types_1.Networks.Moonbeam]: {},
132
134
  [types_1.Networks.Sxnetwork]: {},
135
+ [types_1.Networks.Base]: {
136
+ [Amms.aerodrome]: '0x2a32215Ba106039f5A96b6366338BDb9FB0b62E8', //NOTICE: this is actually the staked LP factory
137
+ }
133
138
  };
134
139
  function getAmmByFactory(network, address) {
135
140
  if (!address)
@@ -191,6 +196,9 @@ exports.AMM_SUBGRAPH_URLS = {
191
196
  [types_1.Networks.Harmony]: {},
192
197
  [types_1.Networks.Moonbeam]: {},
193
198
  [types_1.Networks.Sxnetwork]: {},
199
+ [types_1.Networks.Base]: {
200
+ [Amms.aerodrome]: 'https://api.thegraph.com/subgraphs/name/ethzoomer/aerodrome-trading-data', //could not find "official" subgraph
201
+ },
194
202
  };
195
203
  exports.ADD_LIQUIDITY_URLS = {
196
204
  [types_1.Networks.Ropsten]: {
@@ -251,6 +259,9 @@ exports.ADD_LIQUIDITY_URLS = {
251
259
  [types_1.Networks.Harmony]: {},
252
260
  [types_1.Networks.Moonbeam]: {},
253
261
  [types_1.Networks.Sxnetwork]: {},
262
+ [types_1.Networks.Base]: {
263
+ [Amms.aerodrome]: 'https://aerodrome.finance/deposit',
264
+ },
254
265
  };
255
266
  exports.AMM_LP_FEE = {
256
267
  [types_1.Networks.Ropsten]: {
@@ -311,4 +322,7 @@ exports.AMM_LP_FEE = {
311
322
  [types_1.Networks.Harmony]: {},
312
323
  [types_1.Networks.Moonbeam]: {},
313
324
  [types_1.Networks.Sxnetwork]: {},
325
+ [types_1.Networks.Base]: {
326
+ [Amms.aerodrome]: 0,
327
+ }
314
328
  };
@@ -17,4 +17,5 @@ exports.CLAIM_AGGREGATOR = {
17
17
  [types_1.Networks.Sxnetwork]: '',
18
18
  [types_1.Networks.Canto]: '',
19
19
  [types_1.Networks.ZksyncEra]: '',
20
+ [types_1.Networks.Base]: '',
20
21
  };
@@ -18,4 +18,5 @@ exports.IMPERMAX_CHEF = {
18
18
  [types_1.Networks.Sxnetwork]: '',
19
19
  [types_1.Networks.Canto]: '',
20
20
  [types_1.Networks.ZksyncEra]: '',
21
+ [types_1.Networks.Base]: '',
21
22
  };
@@ -17,4 +17,5 @@ exports.IMPERMAX_CONFIG_MANAGER = {
17
17
  [types_1.Networks.Sxnetwork]: '',
18
18
  [types_1.Networks.Canto]: '',
19
19
  [types_1.Networks.ZksyncEra]: '',
20
+ [types_1.Networks.Base]: '0x9acafcb281e94eaB771D0cf6508c92A4B75DCE7c'
20
21
  };
@@ -41,6 +41,9 @@ exports.IMPERMAX_FACTORY = {
41
41
  [types_1.Networks.Harmony]: {},
42
42
  [types_1.Networks.Moonbeam]: {},
43
43
  [types_1.Networks.Sxnetwork]: {},
44
+ [types_1.Networks.Base]: {
45
+ [types_1.Factory.SOLV2]: '0x66ca66E002a9CEE8dEfE25dB6f0c6225117C2d9f',
46
+ },
44
47
  };
45
48
  function getFactoryByAddress(network, address) {
46
49
  if (!address)
@@ -17,4 +17,5 @@ exports.IMX = {
17
17
  [types_1.Networks.Sxnetwork]: '',
18
18
  [types_1.Networks.Canto]: '',
19
19
  [types_1.Networks.ZksyncEra]: '',
20
+ [types_1.Networks.Base]: '',
20
21
  };
@@ -17,4 +17,5 @@ exports.LENDING_VAULT_WATCHER = {
17
17
  [types_1.Networks.Sxnetwork]: '',
18
18
  [types_1.Networks.Canto]: '',
19
19
  [types_1.Networks.ZksyncEra]: '',
20
+ [types_1.Networks.Base]: '',
20
21
  };
@@ -17,6 +17,7 @@ exports.MERKLE_DISTRIBUTOR_IBEX = {
17
17
  [types_1.Networks.Sxnetwork]: '',
18
18
  [types_1.Networks.Canto]: '',
19
19
  [types_1.Networks.ZksyncEra]: '',
20
+ [types_1.Networks.Base]: '',
20
21
  };
21
22
  exports.MERKLE_DISTRIBUTOR_IBEX_2 = {
22
23
  [types_1.Networks.Polygon]: '0x1c813cDd6dAecE2CB83C52F0798504e42816E9C5',
@@ -33,6 +34,7 @@ exports.MERKLE_DISTRIBUTOR_IBEX_2 = {
33
34
  [types_1.Networks.Sxnetwork]: '',
34
35
  [types_1.Networks.Canto]: '',
35
36
  [types_1.Networks.ZksyncEra]: '',
37
+ [types_1.Networks.Base]: '',
36
38
  };
37
39
  exports.MERKLE_DISTRIBUTOR_ETH = {
38
40
  [types_1.Networks.Polygon]: '0x7ce2f634f0698ecdca051ef1dc4be96ef3d05a62',
@@ -49,4 +51,5 @@ exports.MERKLE_DISTRIBUTOR_ETH = {
49
51
  [types_1.Networks.Sxnetwork]: '',
50
52
  [types_1.Networks.Canto]: '',
51
53
  [types_1.Networks.ZksyncEra]: '',
54
+ [types_1.Networks.Base]: '',
52
55
  };
@@ -45,6 +45,9 @@ exports.ROUTER = {
45
45
  [types_1.Networks.Harmony]: {},
46
46
  [types_1.Networks.Moonbeam]: {},
47
47
  [types_1.Networks.Sxnetwork]: {},
48
+ [types_1.Networks.Base]: {
49
+ [types_1.Factory.SOLV2]: '0x6271c6D2Cf5072D769A16eD99C8D5F3272d44E4F'
50
+ },
48
51
  };
49
52
  exports.DEFAULT_ROUTER = {
50
53
  [types_1.Networks.Ropsten]: '0xbFf4acF789297A8507Eb7493AE18EB2C3A3A9632',
@@ -61,4 +64,5 @@ exports.DEFAULT_ROUTER = {
61
64
  [types_1.Networks.Harmony]: '',
62
65
  [types_1.Networks.Moonbeam]: '',
63
66
  [types_1.Networks.Sxnetwork]: '',
67
+ [types_1.Networks.Base]: '0x6271c6D2Cf5072D769A16eD99C8D5F3272d44E4F',
64
68
  };
@@ -34,4 +34,5 @@ exports.SIMPLE_UNISWAP_ORACLE = {
34
34
  [types_1.Networks.Sxnetwork]: {},
35
35
  [types_1.Networks.Canto]: {},
36
36
  [types_1.Networks.ZksyncEra]: {},
37
+ [types_1.Networks.Base]: {},
37
38
  };
@@ -18,4 +18,5 @@ exports.WETH = {
18
18
  [types_1.Networks.Sxnetwork]: '0xacc15dc74880c9944775448304b263d191c6077f',
19
19
  [types_1.Networks.Canto]: '0x826551890Dc65655a0Aceca109aB11AbDbD7a07B',
20
20
  [types_1.Networks.ZksyncEra]: '0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91',
21
+ [types_1.Networks.Base]: '0x4200000000000000000000000000000000000006',
21
22
  };
@@ -17,4 +17,5 @@ exports.DEBANK_IDS = {
17
17
  [types_1.Networks.Moonbeam]: '',
18
18
  [types_1.Networks.Sxnetwork]: '',
19
19
  [types_1.Networks.ZksyncEra]: '',
20
+ [types_1.Networks.Base]: 'base',
20
21
  };
@@ -17,6 +17,7 @@ exports.MERKLE_URL_IBEX = {
17
17
  [types_1.Networks.Sxnetwork]: '',
18
18
  [types_1.Networks.Canto]: '',
19
19
  [types_1.Networks.ZksyncEra]: '',
20
+ [types_1.Networks.Base]: '',
20
21
  };
21
22
  exports.MERKLE_URL_IBEX_2 = {
22
23
  [types_1.Networks.Polygon]: 'https://misty-rice-9880.impermax.workers.dev',
@@ -33,6 +34,7 @@ exports.MERKLE_URL_IBEX_2 = {
33
34
  [types_1.Networks.Sxnetwork]: '',
34
35
  [types_1.Networks.Canto]: '',
35
36
  [types_1.Networks.ZksyncEra]: '',
37
+ [types_1.Networks.Base]: '',
36
38
  };
37
39
  exports.MERKLE_URL_ETH = {
38
40
  [types_1.Networks.Polygon]: 'https://damp-hill-13d0.impermax.workers.dev',
@@ -49,4 +51,5 @@ exports.MERKLE_URL_ETH = {
49
51
  [types_1.Networks.Sxnetwork]: '',
50
52
  [types_1.Networks.Canto]: '',
51
53
  [types_1.Networks.ZksyncEra]: '',
54
+ [types_1.Networks.Base]: '',
52
55
  };
package/lib/config/eth.js CHANGED
@@ -17,6 +17,7 @@ exports.ETH_NAME = {
17
17
  [types_1.Networks.Sxnetwork]: 'SX Network',
18
18
  [types_1.Networks.Canto]: 'CANTO',
19
19
  [types_1.Networks.ZksyncEra]: 'Ethereum',
20
+ [types_1.Networks.Base]: 'Base',
20
21
  };
21
22
  exports.ETH_SYMBOL = {
22
23
  [types_1.Networks.Ropsten]: 'ETH',
@@ -33,4 +34,5 @@ exports.ETH_SYMBOL = {
33
34
  [types_1.Networks.Sxnetwork]: 'SX',
34
35
  [types_1.Networks.Canto]: 'CANTO',
35
36
  [types_1.Networks.ZksyncEra]: 'ETH',
37
+ [types_1.Networks.Base]: 'ETH',
36
38
  };
@@ -38,7 +38,8 @@ export declare enum Farms {
38
38
  solidexB = "solidexB",
39
39
  solidexUSDC = "solidexUSDC",
40
40
  solidexUSDCB = "solidexUSDCB",
41
- oxdao = "oxdao"
41
+ oxdao = "oxdao",
42
+ aerodrome = "aerodrome"
42
43
  }
43
44
  export declare const hrFarms: {
44
45
  quickswapOld: string;
@@ -79,6 +80,7 @@ export declare const hrFarms: {
79
80
  solidexUSDC: string;
80
81
  solidexUSDCB: string;
81
82
  oxdao: string;
83
+ aerodrome: string;
82
84
  };
83
85
  export type FarmIndex = {
84
86
  [key in Networks]: {
@@ -43,6 +43,7 @@ var Farms;
43
43
  Farms["solidexUSDC"] = "solidexUSDC";
44
44
  Farms["solidexUSDCB"] = "solidexUSDCB";
45
45
  Farms["oxdao"] = "oxdao";
46
+ Farms["aerodrome"] = "aerodrome";
46
47
  })(Farms = exports.Farms || (exports.Farms = {}));
47
48
  exports.hrFarms = {
48
49
  [Farms.quickswapOld]: 'QuickSwap',
@@ -84,6 +85,7 @@ exports.hrFarms = {
84
85
  [Farms.solidexUSDC]: 'Solidex',
85
86
  [Farms.solidexUSDCB]: 'Solidex',
86
87
  [Farms.oxdao]: '0xDAO',
88
+ [Farms.aerodrome]: 'Aerodrome',
87
89
  };
88
90
  exports.STAKED_LP_FACTORY = {
89
91
  [types_1.Networks.Ropsten]: {},
@@ -149,6 +151,9 @@ exports.STAKED_LP_FACTORY = {
149
151
  [types_1.Networks.Harmony]: {},
150
152
  [types_1.Networks.Moonbeam]: {},
151
153
  [types_1.Networks.Sxnetwork]: {},
154
+ [types_1.Networks.Base]: {
155
+ [Farms.aerodrome]: '0x2a32215Ba106039f5A96b6366338BDb9FB0b62E8',
156
+ }
152
157
  };
153
158
  function getFarmByStakedLPFactory(network, address) {
154
159
  if (!address)
@@ -19,6 +19,7 @@ export declare const CONFIG_MANAGER_SUBGRAPH_URL: {
19
19
  harmony: string;
20
20
  moonbeam: string;
21
21
  sxnetwork: string;
22
+ base: string;
22
23
  };
23
24
  export declare const WHITELIST_SUBGRAPH_URL: {
24
25
  ropsten: string;
@@ -35,4 +36,5 @@ export declare const WHITELIST_SUBGRAPH_URL: {
35
36
  harmony: string;
36
37
  moonbeam: string;
37
38
  sxnetwork: string;
39
+ base: string;
38
40
  };
@@ -57,6 +57,9 @@ exports.IMPERMAX_SUBGRAPH_URL = {
57
57
  [types_1.Networks.Harmony]: {},
58
58
  [types_1.Networks.Moonbeam]: {},
59
59
  [types_1.Networks.Sxnetwork]: {},
60
+ [types_1.Networks.Base]: {
61
+ [types_1.Factory.SOLV2]: 'https://api.studio.thegraph.com/query/46041/impermax-base-solv2',
62
+ },
60
63
  };
61
64
  exports.IMPERMAX_CHEF_SUBGRAPH_URL = {
62
65
  [types_1.Networks.Ropsten]: '',
@@ -74,6 +77,7 @@ exports.IMPERMAX_CHEF_SUBGRAPH_URL = {
74
77
  [types_1.Networks.Sxnetwork]: '',
75
78
  [types_1.Networks.Canto]: '',
76
79
  [types_1.Networks.ZksyncEra]: '',
80
+ [types_1.Networks.Base]: '',
77
81
  };
78
82
  exports.LENDING_VAULT_SUBGRAPH_URL = {
79
83
  [types_1.Networks.Ropsten]: '',
@@ -90,6 +94,7 @@ exports.LENDING_VAULT_SUBGRAPH_URL = {
90
94
  [types_1.Networks.Sxnetwork]: '',
91
95
  [types_1.Networks.Canto]: '',
92
96
  [types_1.Networks.ZksyncEra]: '',
97
+ [types_1.Networks.Base]: '',
93
98
  };
94
99
  exports.BLOCKS_SUBGRAPH_URL = {
95
100
  [types_1.Networks.Ropsten]: '',
@@ -106,6 +111,7 @@ exports.BLOCKS_SUBGRAPH_URL = {
106
111
  [types_1.Networks.Harmony]: '',
107
112
  [types_1.Networks.Moonbeam]: '',
108
113
  [types_1.Networks.Sxnetwork]: '',
114
+ [types_1.Networks.Base]: 'https://api.thegraph.com/subgraphs/name/blocklytics/base-blocks',
109
115
  };
110
116
  exports.XIMX_SUBGRAPH_URL = "https://api.thegraph.com/subgraphs/name/impermax-finance/imx-staking";
111
117
  exports.CONFIG_MANAGER_SUBGRAPH_URL = {
@@ -123,6 +129,7 @@ exports.CONFIG_MANAGER_SUBGRAPH_URL = {
123
129
  [types_1.Networks.Harmony]: '',
124
130
  [types_1.Networks.Moonbeam]: '',
125
131
  [types_1.Networks.Sxnetwork]: '',
132
+ [types_1.Networks.Base]: 'https://api.studio.thegraph.com/query/46041/impermax-config-manager-base/v0.0.1',
126
133
  };
127
134
  exports.WHITELIST_SUBGRAPH_URL = {
128
135
  [types_1.Networks.Ropsten]: '',
@@ -139,4 +146,5 @@ exports.WHITELIST_SUBGRAPH_URL = {
139
146
  [types_1.Networks.Harmony]: '',
140
147
  [types_1.Networks.Moonbeam]: '',
141
148
  [types_1.Networks.Sxnetwork]: '',
149
+ [types_1.Networks.Base]: 'https://api.studio.thegraph.com/query/46041/impermax-whitelist-base/v0.0.1',
142
150
  };
@@ -13,7 +13,8 @@ export declare enum Networks {
13
13
  Moonbeam = "moonbeam",
14
14
  Sxnetwork = "sxnetwork",
15
15
  Canto = "canto",
16
- ZksyncEra = "zksync-era"
16
+ ZksyncEra = "zksync-era",
17
+ Base = "base"
17
18
  }
18
19
  export declare enum Factory {
19
20
  V2V1 = "1",
@@ -17,6 +17,7 @@ var Networks;
17
17
  Networks["Sxnetwork"] = "sxnetwork";
18
18
  Networks["Canto"] = "canto";
19
19
  Networks["ZksyncEra"] = "zksync-era";
20
+ Networks["Base"] = "base";
20
21
  })(Networks = exports.Networks || (exports.Networks = {}));
21
22
  // FACTORIES
22
23
  var Factory;
@@ -96,6 +96,8 @@ export default class Offchain {
96
96
  totalBorrowsUSD: number;
97
97
  }[]>;
98
98
  getCrossChainTVL(): Promise<number>;
99
+ getCrossChainTotalValueSupplied(): Promise<number>;
100
+ getCrossChainTotalValueBorrowed(): Promise<number>;
99
101
  getTotalValueLocked(): Promise<number>;
100
102
  getTotalValueSupplied(): Promise<number>;
101
103
  getTotalValueBorrowed(): Promise<number>;
@@ -162,13 +162,26 @@ class Offchain {
162
162
  return Promise.all(requests);
163
163
  });
164
164
  }
165
- // TVL Data
165
+ // Crosschain TVL Data
166
166
  getCrossChainTVL() {
167
167
  return __awaiter(this, void 0, void 0, function* () {
168
168
  const tvlData = yield this.getTvlData();
169
169
  return tvlData.crossChainTVLUSD;
170
170
  });
171
171
  }
172
+ getCrossChainTotalValueSupplied() {
173
+ return __awaiter(this, void 0, void 0, function* () {
174
+ const tvlData = yield this.getTvlData();
175
+ return tvlData.crossChainSupplyUSD;
176
+ });
177
+ }
178
+ getCrossChainTotalValueBorrowed() {
179
+ return __awaiter(this, void 0, void 0, function* () {
180
+ const tvlData = yield this.getTvlData();
181
+ return tvlData.crossChainBorrowUSD;
182
+ });
183
+ }
184
+ // This chain TVL Data
172
185
  getTotalValueLocked() {
173
186
  return __awaiter(this, void 0, void 0, function* () {
174
187
  const tvlData = yield this.getTvlData();
@@ -480,21 +480,26 @@ function initializeTvlData() {
480
480
  console.log("can't initialize TVL data");
481
481
  return {
482
482
  crossChainTVLUSD: 0,
483
+ crossChainSupplyUSD: 0,
484
+ crossChainBorrowUSD: 0,
483
485
  totalBalanceUSD: 0,
484
486
  totalSupplyUSD: 0,
485
487
  totalBorrowsUSD: 0,
486
488
  };
487
489
  }
488
490
  let crossChainTVLUSD = 0;
491
+ let crossChainSupplyUSD = 0;
492
+ let crossChainBorrowUSD = 0;
489
493
  let thisChainTVLUSD = 0;
490
494
  let thisChainSupplyUSD = 0;
491
495
  let thisChainBorrowUSD = 0;
492
496
  let i = 0;
493
497
  for (const network of networks) {
494
- let chainTvlUSD = 0;
495
498
  for (const factory in subgraphs_1.IMPERMAX_SUBGRAPH_URL[network]) {
496
499
  const data = results[i].data.impermaxFactories[0];
497
- chainTvlUSD += parseFloat(data.totalBalanceUSD);
500
+ crossChainTVLUSD += parseFloat(data.totalBalanceUSD);
501
+ crossChainSupplyUSD += parseFloat(data.totalSupplyUSD);
502
+ crossChainBorrowUSD += parseFloat(data.totalBorrowsUSD);
498
503
  if (network === this.network) {
499
504
  thisChainTVLUSD += parseFloat(data.totalBalanceUSD);
500
505
  thisChainSupplyUSD += parseFloat(data.totalSupplyUSD);
@@ -502,7 +507,6 @@ function initializeTvlData() {
502
507
  }
503
508
  i++;
504
509
  }
505
- crossChainTVLUSD += chainTvlUSD;
506
510
  }
507
511
  if (!networks.includes(this.network)) {
508
512
  const calls = [];
@@ -522,6 +526,8 @@ function initializeTvlData() {
522
526
  }
523
527
  return {
524
528
  crossChainTVLUSD,
529
+ crossChainSupplyUSD,
530
+ crossChainBorrowUSD,
525
531
  totalBalanceUSD: thisChainTVLUSD,
526
532
  totalSupplyUSD: thisChainSupplyUSD,
527
533
  totalBorrowsUSD: thisChainBorrowUSD,
@@ -144,6 +144,8 @@ export interface LendingPoolPosition {
144
144
  }
145
145
  export interface TvlData {
146
146
  crossChainTVLUSD: number;
147
+ crossChainSupplyUSD: number;
148
+ crossChainBorrowUSD: number;
147
149
  totalBalanceUSD: number;
148
150
  totalBorrowsUSD: number;
149
151
  totalSupplyUSD: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "1.2.23",
3
+ "version": "1.2.25",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",