@curvefi/api 2.54.9 → 2.55.0

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.
@@ -15,6 +15,7 @@ export var ALIASES_ETHEREUM = lowerCaseValues({
15
15
  "crvusd_factory": '0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d',
16
16
  "eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
17
17
  "crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
18
+ "twocrypto_factory": '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F',
18
19
  "tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
19
20
  "stable_ng_factory": '0x6A8cbed756804B16E05E741eDaBd5cB544AE21bf',
20
21
  "factory_admin": "",
@@ -37,6 +38,7 @@ export var ALIASES_POLYGON = lowerCaseValues({
37
38
  "crvusd_factory": '0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d',
38
39
  "eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
39
40
  "crypto_factory": "0xE5De15A9C9bBedb4F5EC13B131E61245f2983A69",
41
+ "twocrypto_factory": '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F',
40
42
  "tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
41
43
  "stable_ng_factory": '0x1764ee18e8B3ccA4787249Ceb249356192594585',
42
44
  "factory_admin": "",
@@ -56,6 +58,7 @@ export var ALIASES_FANTOM = lowerCaseValues({
56
58
  "crvusd_factory": '0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d',
57
59
  "eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
58
60
  "crypto_factory": "0xE5De15A9C9bBedb4F5EC13B131E61245f2983A69",
61
+ "twocrypto_factory": '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F',
59
62
  "tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
60
63
  "stable_ng_factory": '0xe61Fb97Ef6eBFBa12B36Ffd7be785c1F5A2DE66b',
61
64
  "factory_admin": "",
@@ -75,6 +78,7 @@ export var ALIASES_AVALANCHE = lowerCaseValues({
75
78
  "crvusd_factory": '0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d',
76
79
  "eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
77
80
  "crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
81
+ "twocrypto_factory": '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F',
78
82
  "tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
79
83
  "stable_ng_factory": '0x1764ee18e8B3ccA4787249Ceb249356192594585',
80
84
  "factory_admin": "",
@@ -94,6 +98,7 @@ export var ALIASES_ARBITRUM = lowerCaseValues({
94
98
  "crvusd_factory": '0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d',
95
99
  "eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
96
100
  "crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
101
+ "twocrypto_factory": '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F',
97
102
  "tricrypto_factory": '0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8',
98
103
  "stable_ng_factory": '0x9AF14D26075f142eb3F292D5065EB3faa646167b',
99
104
  "factory_admin": "",
@@ -113,10 +118,11 @@ export var ALIASES_OPTIMISM = lowerCaseValues({
113
118
  "crvusd_factory": '0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d',
114
119
  "eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
115
120
  "crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
121
+ "twocrypto_factory": '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F',
116
122
  "tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
117
123
  "stable_ng_factory": '0x5eeE3091f747E60a045a2E715a4c71e600e31F6E',
118
124
  "factory_admin": "",
119
- "gas_oracle": '0xc0d3C0d3C0d3c0D3C0D3C0d3C0d3C0D3C0D3000f', // <-- NEW
125
+ "gas_oracle": '0xc0d3C0d3C0d3c0D3C0D3C0d3C0d3C0D3C0D3000f',
120
126
  });
121
127
  export var ALIASES_XDAI = lowerCaseValues({
122
128
  "crv": "0x712b3d230f3c1c19db860d80619288b1f0bdd0bd",
@@ -133,6 +139,7 @@ export var ALIASES_XDAI = lowerCaseValues({
133
139
  "crvusd_factory": '0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d',
134
140
  "eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
135
141
  "crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
142
+ "twocrypto_factory": '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F',
136
143
  "tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
137
144
  "stable_ng_factory": '0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8',
138
145
  "factory_admin": "",
@@ -152,6 +159,7 @@ export var ALIASES_MOONBEAM = lowerCaseValues({
152
159
  "crvusd_factory": '0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d',
153
160
  "eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
154
161
  "crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
162
+ "twocrypto_factory": '0x0000000000000000000000000000000000000000',
155
163
  "tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
156
164
  "stable_ng_factory": '0x0000000000000000000000000000000000000000',
157
165
  "factory_admin": "",
@@ -171,6 +179,7 @@ export var ALIASES_AURORA = lowerCaseValues({
171
179
  "crvusd_factory": '0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d',
172
180
  "eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
173
181
  "crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
182
+ "twocrypto_factory": '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F',
174
183
  "tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
175
184
  "stable_ng_factory": '0x5eeE3091f747E60a045a2E715a4c71e600e31F6E',
176
185
  "factory_admin": "",
@@ -190,6 +199,7 @@ export var ALIASES_KAVA = lowerCaseValues({
190
199
  "crvusd_factory": '0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d',
191
200
  "eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
192
201
  "crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
202
+ "twocrypto_factory": '0xd3B17f862956464ae4403cCF829CE69199856e1e',
193
203
  "tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
194
204
  "stable_ng_factory": '0x1764ee18e8B3ccA4787249Ceb249356192594585',
195
205
  "factory_admin": "",
@@ -209,6 +219,7 @@ export var ALIASES_CELO = lowerCaseValues({
209
219
  "crvusd_factory": '0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d',
210
220
  "eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
211
221
  "crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
222
+ "twocrypto_factory": '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F',
212
223
  "tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
213
224
  "stable_ng_factory": '0x1764ee18e8B3ccA4787249Ceb249356192594585',
214
225
  "factory_admin": "",
@@ -228,6 +239,7 @@ export var ALIASES_ZKSYNC = lowerCaseValues({
228
239
  "crvusd_factory": '0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d',
229
240
  "eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
230
241
  "crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
242
+ "twocrypto_factory": '0x0000000000000000000000000000000000000000',
231
243
  "tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
232
244
  "stable_ng_factory": '0x0000000000000000000000000000000000000000',
233
245
  "factory_admin": "0x0000000000000000000000000000000000000000",
@@ -247,10 +259,11 @@ export var ALIASES_BASE = lowerCaseValues({
247
259
  "crvusd_factory": '0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d',
248
260
  "eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
249
261
  "crypto_factory": '0x5EF72230578b3e399E6C6F4F6360edF95e83BBfd',
262
+ "twocrypto_factory": '0xc9Fe0C63Af9A39402e8a5514f9c43Af0322b665F',
250
263
  "tricrypto_factory": '0xA5961898870943c68037F6848d2D866Ed2016bcB',
251
264
  "factory_admin": "0x0000000000000000000000000000000000000000",
252
265
  "stable_ng_factory": '0xd2002373543Ce3527023C75e7518C274A51ce712',
253
- "gas_oracle": '0xc0d3C0d3C0d3c0D3C0D3C0d3C0d3C0D3C0D3000f', // <-- NEW
266
+ "gas_oracle": '0xc0d3C0d3C0d3c0D3C0D3C0d3C0d3C0D3C0D3000f',
254
267
  });
255
268
  export var ALIASES_BSC = lowerCaseValues({
256
269
  "crv": "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415",
@@ -267,10 +280,31 @@ export var ALIASES_BSC = lowerCaseValues({
267
280
  "crvusd_factory": '0x0000000000000000000000000000000000000000',
268
281
  "eywa_factory": '0x0000000000000000000000000000000000000000',
269
282
  "crypto_factory": '0xBd5fBd2FA58cB15228a9Abdac9ec994f79E3483C',
283
+ "twocrypto_factory": '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F',
270
284
  "tricrypto_factory": '0xc55837710bc500F1E3c7bb9dd1d51F7c5647E657',
271
285
  "stable_ng_factory": '0xd7E72f3615aa65b92A4DBdC211E296a35512988B',
272
286
  "factory_admin": '0x0000000000000000000000000000000000000000',
273
287
  });
288
+ export var ALIASES_FRAXTAL = lowerCaseValues({
289
+ "crv": "0x0000000000000000000000000000000000000000",
290
+ "gauge_factory": "0x0000000000000000000000000000000000000000",
291
+ "voting_escrow": "0x0000000000000000000000000000000000000000",
292
+ "fee_distributor": "0x0000000000000000000000000000000000000000",
293
+ "gauge_controller": "0x0000000000000000000000000000000000000000",
294
+ "address_provider": "0x0000000000000000000000000000000000000000",
295
+ "router": "0x0000000000000000000000000000000000000000",
296
+ "deposit_and_stake": "0x0000000000000000000000000000000000000000",
297
+ "stable_calc": "0x0000000000000000000000000000000000000000",
298
+ "crypto_calc": '0x0000000000000000000000000000000000000000',
299
+ "factory": '0x0000000000000000000000000000000000000000',
300
+ "crvusd_factory": '0x0000000000000000000000000000000000000000',
301
+ "eywa_factory": '0x0000000000000000000000000000000000000000',
302
+ "crypto_factory": '0x0000000000000000000000000000000000000000',
303
+ "twocrypto_factory": '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F',
304
+ "tricrypto_factory": '0x0000000000000000000000000000000000000000',
305
+ "stable_ng_factory": '0x0000000000000000000000000000000000000000',
306
+ "factory_admin": '0x0000000000000000000000000000000000000000',
307
+ });
274
308
  var registry_exchange_deprecated = {
275
309
  '1': '0x99a58482bd75cbab83b27ec03ca68ff489b5788f',
276
310
  '10': '0x22d710931f01c1681ca1570ff016ed42eb7b7c2a',
package/lib/curve.d.ts CHANGED
@@ -51,6 +51,7 @@ declare class Curve implements ICurve {
51
51
  CRVUSD_FACTORY_POOLS_DATA: IDict<IPoolData>;
52
52
  EYWA_FACTORY_POOLS_DATA: IDict<IPoolData>;
53
53
  CRYPTO_FACTORY_POOLS_DATA: IDict<IPoolData>;
54
+ TWOCRYPTO_FACTORY_POOLS_DATA: IDict<IPoolData>;
54
55
  TRICRYPTO_FACTORY_POOLS_DATA: IDict<IPoolData>;
55
56
  STABLE_NG_FACTORY_POOLS_DATA: IDict<IPoolData>;
56
57
  LLAMMAS_DATA: IDict<IPoolData>;
@@ -83,21 +84,25 @@ declare class Curve implements ICurve {
83
84
  fetchCrvusdFactoryPools: (useApi?: boolean) => Promise<void>;
84
85
  fetchEywaFactoryPools: (useApi?: boolean) => Promise<void>;
85
86
  fetchCryptoFactoryPools: (useApi?: boolean) => Promise<void>;
87
+ fetchTworyptoFactoryPools: (useApi?: boolean) => Promise<void>;
86
88
  fetchTricryptoFactoryPools: (useApi?: boolean) => Promise<void>;
87
89
  fetchStableNgFactoryPools: (useApi?: boolean) => Promise<void>;
88
90
  fetchNewFactoryPools: () => Promise<string[]>;
89
91
  fetchNewStableNgFactoryPools: () => Promise<string[]>;
90
92
  fetchNewCryptoFactoryPools: () => Promise<string[]>;
93
+ fetchNewTwocryptoFactoryPools: () => Promise<string[]>;
91
94
  fetchNewTricryptoFactoryPools: () => Promise<string[]>;
92
95
  fetchRecentlyDeployedFactoryPool: (poolAddress: string) => Promise<string>;
93
96
  fetchRecentlyDeployedStableNgFactoryPool: (poolAddress: string) => Promise<string>;
94
97
  fetchRecentlyDeployedCryptoFactoryPool: (poolAddress: string) => Promise<string>;
98
+ fetchRecentlyDeployedTwocryptoFactoryPool: (poolAddress: string) => Promise<string>;
95
99
  fetchRecentlyDeployedTricryptoFactoryPool: (poolAddress: string) => Promise<string>;
96
100
  getMainPoolList: () => string[];
97
101
  getFactoryPoolList: () => string[];
98
102
  getCrvusdFactoryPoolList: () => string[];
99
103
  getEywaFactoryPoolList: () => string[];
100
104
  getCryptoFactoryPoolList: () => string[];
105
+ getTworyptoFactoryPoolList: () => string[];
101
106
  getTricryptoFactoryPoolList: () => string[];
102
107
  getStableNgFactoryPoolList: () => string[];
103
108
  getPoolList: () => string[];
package/lib/curve.js CHANGED
@@ -82,6 +82,7 @@ import factoryABI from './constants/abis/factory.json' assert { type: 'json' };
82
82
  import factoryEywaABI from './constants/abis/factory-eywa.json' assert { type: 'json' };
83
83
  import factoryAdminABI from './constants/abis/factory-admin.json' assert { type: 'json' };
84
84
  import cryptoFactoryABI from './constants/abis/factory-crypto.json' assert { type: 'json' };
85
+ import twocryptoFactoryABI from './constants/abis/factory-twocrypto-ng.json' assert { type: 'json' };
85
86
  import tricryptoFactoryABI from './constants/abis/factory-tricrypto.json' assert { type: 'json' };
86
87
  import stableNgFactoryABI from './constants/abis/factory-stable-ng.json' assert { type: 'json' };
87
88
  import gasOracleABI from './constants/abis/gas_oracle_optimism.json' assert { type: 'json' };
@@ -106,6 +107,7 @@ import { COINS_BSC, cTokensBsc, yTokensBsc, ycTokensBsc, aTokensBsc } from "./co
106
107
  import { lowerCasePoolDataAddresses, extractDecimals, extractGauges } from "./constants/utils.js";
107
108
  import { _getAllGauges, _getHiddenPools } from "./external-api.js";
108
109
  import { L2Networks } from "./constants/L2Networks.js";
110
+ import { getTwocryptoFactoryPoolData } from "./factory/factory-twocrypto";
109
111
  var _killGauges = function (poolsData) { return __awaiter(void 0, void 0, void 0, function () {
110
112
  var gaugeData, isKilled, gaugeStatuses, poolId;
111
113
  return __generator(this, function (_a) {
@@ -522,6 +524,48 @@ var Curve = /** @class */ (function () {
522
524
  });
523
525
  });
524
526
  };
527
+ this.fetchTworyptoFactoryPools = function (useApi) {
528
+ if (useApi === void 0) { useApi = true; }
529
+ return __awaiter(_this, void 0, void 0, function () {
530
+ var _a, _b, _c, _d, _e, _f, _g;
531
+ return __generator(this, function (_h) {
532
+ switch (_h.label) {
533
+ case 0:
534
+ if ([324, 1284].includes(this.chainId))
535
+ return [2 /*return*/];
536
+ if (!useApi) return [3 /*break*/, 2];
537
+ _a = this.constants;
538
+ _b = lowerCasePoolDataAddresses;
539
+ return [4 /*yield*/, getFactoryPoolsDataFromApi.call(this, "factory-twocrypto")];
540
+ case 1:
541
+ _a.TWOCRYPTO_FACTORY_POOLS_DATA = _b.apply(void 0, [_h.sent()]);
542
+ return [3 /*break*/, 4];
543
+ case 2:
544
+ _c = this.constants;
545
+ _d = lowerCasePoolDataAddresses;
546
+ return [4 /*yield*/, getTwocryptoFactoryPoolData.call(this)];
547
+ case 3:
548
+ _c.TWOCRYPTO_FACTORY_POOLS_DATA = _d.apply(void 0, [_h.sent()]);
549
+ _h.label = 4;
550
+ case 4:
551
+ _e = this.constants;
552
+ return [4 /*yield*/, this._filterHiddenPools(this.constants.TWOCRYPTO_FACTORY_POOLS_DATA)];
553
+ case 5:
554
+ _e.TWOCRYPTO_FACTORY_POOLS_DATA = _h.sent();
555
+ this._updateDecimalsAndGauges(this.constants.TWOCRYPTO_FACTORY_POOLS_DATA);
556
+ return [4 /*yield*/, _killGauges(this.constants.TWOCRYPTO_FACTORY_POOLS_DATA)];
557
+ case 6:
558
+ _h.sent();
559
+ _f = this.constants.FACTORY_GAUGE_IMPLEMENTATIONS;
560
+ _g = "factory-twocrypto";
561
+ return [4 /*yield*/, this.contracts[this.constants.ALIASES.twocrypto_factory].contract.gauge_implementation(this.constantOptions)];
562
+ case 7:
563
+ _f[_g] = _h.sent();
564
+ return [2 /*return*/];
565
+ }
566
+ });
567
+ });
568
+ };
525
569
  this.fetchTricryptoFactoryPools = function (useApi) {
526
570
  if (useApi === void 0) { useApi = true; }
527
571
  return __awaiter(_this, void 0, void 0, function () {
@@ -667,6 +711,25 @@ var Curve = /** @class */ (function () {
667
711
  }
668
712
  });
669
713
  }); };
714
+ this.fetchNewTwocryptoFactoryPools = function () { return __awaiter(_this, void 0, void 0, function () {
715
+ var currentPoolIds, lastPoolIdx, poolData, _a;
716
+ return __generator(this, function (_b) {
717
+ switch (_b.label) {
718
+ case 0:
719
+ if ([324, 1284].includes(this.chainId))
720
+ return [2 /*return*/, []];
721
+ currentPoolIds = Object.keys(this.constants.TWOCRYPTO_FACTORY_POOLS_DATA);
722
+ lastPoolIdx = currentPoolIds.length === 0 ? -1 : Number(currentPoolIds[currentPoolIds.length - 1].split("-")[2]);
723
+ _a = lowerCasePoolDataAddresses;
724
+ return [4 /*yield*/, getTricryptoFactoryPoolData.call(this, lastPoolIdx + 1)];
725
+ case 1:
726
+ poolData = _a.apply(void 0, [_b.sent()]);
727
+ this.constants.TWOCRYPTO_FACTORY_POOLS_DATA = __assign(__assign({}, this.constants.TWOCRYPTO_FACTORY_POOLS_DATA), poolData);
728
+ this._updateDecimalsAndGauges(this.constants.TWOCRYPTO_FACTORY_POOLS_DATA);
729
+ return [2 /*return*/, Object.keys(poolData)];
730
+ }
731
+ });
732
+ }); };
670
733
  this.fetchNewTricryptoFactoryPools = function () { return __awaiter(_this, void 0, void 0, function () {
671
734
  var currentPoolIds, lastPoolIdx, poolData, _a;
672
735
  return __generator(this, function (_b) {
@@ -737,6 +800,23 @@ var Curve = /** @class */ (function () {
737
800
  }
738
801
  });
739
802
  }); };
803
+ this.fetchRecentlyDeployedTwocryptoFactoryPool = function (poolAddress) { return __awaiter(_this, void 0, void 0, function () {
804
+ var poolData, _a;
805
+ return __generator(this, function (_b) {
806
+ switch (_b.label) {
807
+ case 0:
808
+ if (![1, 56, 137, 250, 8453].includes(this.chainId))
809
+ return [2 /*return*/, ''];
810
+ _a = lowerCasePoolDataAddresses;
811
+ return [4 /*yield*/, getTwocryptoFactoryPoolData.call(this, 0, poolAddress)];
812
+ case 1:
813
+ poolData = _a.apply(void 0, [_b.sent()]);
814
+ this.constants.TWOCRYPTO_FACTORY_POOLS_DATA = __assign(__assign({}, this.constants.TWOCRYPTO_FACTORY_POOLS_DATA), poolData);
815
+ this._updateDecimalsAndGauges(this.constants.TWOCRYPTO_FACTORY_POOLS_DATA);
816
+ return [2 /*return*/, Object.keys(poolData)[0]]; // id
817
+ }
818
+ });
819
+ }); };
740
820
  this.fetchRecentlyDeployedTricryptoFactoryPool = function (poolAddress) { return __awaiter(_this, void 0, void 0, function () {
741
821
  var poolData, _a;
742
822
  return __generator(this, function (_b) {
@@ -759,12 +839,13 @@ var Curve = /** @class */ (function () {
759
839
  this.getCrvusdFactoryPoolList = function () { return Object.keys(_this.constants.CRVUSD_FACTORY_POOLS_DATA); };
760
840
  this.getEywaFactoryPoolList = function () { return Object.keys(_this.constants.EYWA_FACTORY_POOLS_DATA); };
761
841
  this.getCryptoFactoryPoolList = function () { return Object.keys(_this.constants.CRYPTO_FACTORY_POOLS_DATA); };
842
+ this.getTworyptoFactoryPoolList = function () { return Object.keys(_this.constants.TWOCRYPTO_FACTORY_POOLS_DATA); };
762
843
  this.getTricryptoFactoryPoolList = function () { return Object.keys(_this.constants.TRICRYPTO_FACTORY_POOLS_DATA); };
763
844
  this.getStableNgFactoryPoolList = function () { return Object.keys(_this.constants.STABLE_NG_FACTORY_POOLS_DATA); };
764
845
  this.getPoolList = function () {
765
846
  return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], _this.getMainPoolList(), true), _this.getFactoryPoolList(), true), _this.getCrvusdFactoryPoolList(), true), _this.getEywaFactoryPoolList(), true), _this.getCryptoFactoryPoolList(), true), _this.getTricryptoFactoryPoolList(), true), _this.getStableNgFactoryPoolList(), true);
766
847
  };
767
- this.getPoolsData = function () { return (__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, _this.constants.POOLS_DATA), _this.constants.FACTORY_POOLS_DATA), _this.constants.CRVUSD_FACTORY_POOLS_DATA), _this.constants.EYWA_FACTORY_POOLS_DATA), _this.constants.CRYPTO_FACTORY_POOLS_DATA), _this.constants.TRICRYPTO_FACTORY_POOLS_DATA), _this.constants.STABLE_NG_FACTORY_POOLS_DATA), _this.constants.LLAMMAS_DATA)); };
848
+ this.getPoolsData = function () { return (__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, _this.constants.POOLS_DATA), _this.constants.FACTORY_POOLS_DATA), _this.constants.CRVUSD_FACTORY_POOLS_DATA), _this.constants.EYWA_FACTORY_POOLS_DATA), _this.constants.CRYPTO_FACTORY_POOLS_DATA), _this.constants.TWOCRYPTO_FACTORY_POOLS_DATA), _this.constants.TRICRYPTO_FACTORY_POOLS_DATA), _this.constants.STABLE_NG_FACTORY_POOLS_DATA), _this.constants.LLAMMAS_DATA)); };
768
849
  this.getGaugeImplementation = function (factoryType) { return _this.constants.FACTORY_GAUGE_IMPLEMENTATIONS[factoryType] || _this.constants.ZERO_ADDRESS; };
769
850
  // @ts-ignore
770
851
  this.provider = null;
@@ -787,6 +868,7 @@ var Curve = /** @class */ (function () {
787
868
  CRVUSD_FACTORY_POOLS_DATA: {},
788
869
  EYWA_FACTORY_POOLS_DATA: {},
789
870
  CRYPTO_FACTORY_POOLS_DATA: {},
871
+ TWOCRYPTO_FACTORY_POOLS_DATA: {},
790
872
  TRICRYPTO_FACTORY_POOLS_DATA: {},
791
873
  STABLE_NG_FACTORY_POOLS_DATA: {},
792
874
  LLAMMAS_DATA: {},
@@ -827,6 +909,7 @@ var Curve = /** @class */ (function () {
827
909
  CRVUSD_FACTORY_POOLS_DATA: {},
828
910
  EYWA_FACTORY_POOLS_DATA: {},
829
911
  CRYPTO_FACTORY_POOLS_DATA: {},
912
+ TWOCRYPTO_FACTORY_POOLS_DATA: {},
830
913
  TRICRYPTO_FACTORY_POOLS_DATA: {},
831
914
  STABLE_NG_FACTORY_POOLS_DATA: {},
832
915
  LLAMMAS_DATA: {},
@@ -1023,6 +1106,7 @@ var Curve = /** @class */ (function () {
1023
1106
  this.setContract(this.constants.ALIASES.crvusd_factory, factoryABI);
1024
1107
  this.setContract(this.constants.ALIASES.eywa_factory, factoryEywaABI);
1025
1108
  this.setContract(this.constants.ALIASES.crypto_factory, cryptoFactoryABI);
1109
+ this.setContract(this.constants.ALIASES.twocrypto_factory, twocryptoFactoryABI);
1026
1110
  this.setContract(this.constants.ALIASES.tricrypto_factory, tricryptoFactoryABI);
1027
1111
  this.setContract(this.constants.ALIASES.stable_ng_factory, stableNgFactoryABI);
1028
1112
  this.setContract(this.constants.ALIASES.anycall, anycallABI);
@@ -72,6 +72,7 @@ export var _getAllPoolsFromApi = function (network) { return __awaiter(void 0, v
72
72
  _getPoolsFromApi(network, "factory-crvusd"),
73
73
  _getPoolsFromApi(network, "factory-eywa"),
74
74
  _getPoolsFromApi(network, "factory-crypto"),
75
+ _getPoolsFromApi(network, "factory-twocrypto"),
75
76
  _getPoolsFromApi(network, "factory-tricrypto"),
76
77
  _getPoolsFromApi(network, "factory-stable-ng"),
77
78
  ])];
@@ -15,6 +15,9 @@ export declare const getDeployedStableMetaPoolAddress: (tx: ethers.ContractTrans
15
15
  export declare const deployCryptoPoolEstimateGas: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, outFee: number | string, allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, maHalfTime: number, initialPrice: number | string) => Promise<number>;
16
16
  export declare const deployCryptoPool: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, outFee: number | string, allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, maHalfTime: number, initialPrice: number | string) => Promise<ethers.ContractTransactionResponse>;
17
17
  export declare const getDeployedCryptoPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
18
+ export declare const deployTwocryptoPoolEstimateGas: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, outFee: number | string, allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, maHalfTime: number, initialPrice: number | string) => Promise<number>;
19
+ export declare const deployTwocryptoPool: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, outFee: number | string, allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, maHalfTime: number, initialPrice: number | string) => Promise<ethers.ContractTransactionResponse>;
20
+ export declare const getDeployedTwocryptoPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
18
21
  export declare const deployTricryptoPoolEstimateGas: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, outFee: number | string, allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, emaTime: number, initialPrices: (number | string)[]) => Promise<number>;
19
22
  export declare const deployTricryptoPool: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, outFee: number | string, allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, emaTime: number, initialPrices: (number | string)[]) => Promise<ethers.ContractTransactionResponse>;
20
23
  export declare const getDeployedTricryptoPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
@@ -568,6 +568,124 @@ export var getDeployedCryptoPoolAddress = function (tx) { return __awaiter(void
568
568
  }
569
569
  });
570
570
  }); };
571
+ // ------- TWOCRYPTO POOLS -------
572
+ var _deployTwocryptoPool = function (name, symbol, coins, A, gamma, midFee, // %
573
+ outFee, // %
574
+ allowedExtraProfit, feeGamma, adjustmentStep, maHalfTime, // Seconds
575
+ initialPrice, estimateGas) { return __awaiter(void 0, void 0, void 0, function () {
576
+ var _A, _gamma, _midFee, _outFee, _allowedExtraProfit, _feeGamma, _adjustmentStep, _maHalfTime, _initialPrice, contract, gas, gasLimit;
577
+ return __generator(this, function (_a) {
578
+ switch (_a.label) {
579
+ case 0:
580
+ if (name.length > 32)
581
+ throw Error("Max name length = 32");
582
+ if (symbol.length > 10)
583
+ throw Error("Max symbol length = 10");
584
+ if (coins.length !== 2)
585
+ throw Error("Invalid number of coins. Must be 2");
586
+ if (coins[0] === coins[1])
587
+ throw Error("Coins must be different");
588
+ if (BN(A).lt(4000))
589
+ throw Error("A must be >= 4000. Passed A = ".concat(A));
590
+ if (BN(A).gt(4 * (Math.pow(10, 9))))
591
+ throw Error("A must be <= 4 * 10 ** 9. Passed A = ".concat(A));
592
+ if (BN(gamma).lt(1e-8))
593
+ throw Error("gamma must be >= 1e-8. Passed gamma = ".concat(gamma));
594
+ if (BN(gamma).gt(0.02))
595
+ throw Error("gamma must be <= 0.02. Passed gamma = ".concat(gamma));
596
+ if (BN(midFee).lt(0.005))
597
+ throw Error("midFee must be >= 0.005. Passed midFee = ".concat(midFee));
598
+ if (BN(midFee).gt(100))
599
+ throw Error("midFee must be <= 100. Passed midFee = ".concat(midFee));
600
+ if (BN(outFee).lt(BN(midFee)))
601
+ throw Error("outFee must be >= midFee. Passed outFee = ".concat(outFee, " < midFee = ").concat(midFee));
602
+ if (BN(outFee).gt(100))
603
+ throw Error("outFee must be <= 100. Passed outFee = ".concat(outFee));
604
+ if (BN(allowedExtraProfit).lt(0))
605
+ throw Error("allowedExtraProfit must be >= 0. Passed allowedExtraProfit = ".concat(allowedExtraProfit));
606
+ if (BN(allowedExtraProfit).gt(0.01))
607
+ throw Error("allowedExtraProfit must be <= 0.01. Passed allowedExtraProfit = ".concat(allowedExtraProfit));
608
+ if (BN(feeGamma).lt(0))
609
+ throw Error("feeGamma must be >= 0. Passed feeGamma = ".concat(feeGamma));
610
+ if (BN(feeGamma).gt(1))
611
+ throw Error("feeGamma must be <= 1. Passed feeGamma = ".concat(feeGamma));
612
+ if (BN(adjustmentStep).lt(0))
613
+ throw Error("adjustmentStep must be >= 0. Passed adjustmentStep=".concat(adjustmentStep));
614
+ if (BN(adjustmentStep).gt(1))
615
+ throw Error("adjustmentStep must be <= 1. Passed adjustmentStep=".concat(adjustmentStep));
616
+ if (BN(maHalfTime).lt(0))
617
+ throw Error("maHalfTime must be >= 0. Passed maHalfTime=".concat(maHalfTime));
618
+ if (BN(maHalfTime).gt(604800))
619
+ throw Error("maHalfTime must be <= 604800. Passed maHalfTime=".concat(maHalfTime));
620
+ if (BN(initialPrice).lt(1e-12))
621
+ throw Error("initialPrice must be >= 1e-12. Passed initialPrice=".concat(initialPrice));
622
+ if (BN(initialPrice).gt(1e12))
623
+ throw Error("initialPrice must be <= 1e12. Passed initialPrice=".concat(initialPrice));
624
+ _A = parseUnits(A, 0);
625
+ _gamma = parseUnits(gamma);
626
+ _midFee = parseUnits(midFee, 8);
627
+ _outFee = parseUnits(outFee, 8);
628
+ _allowedExtraProfit = parseUnits(allowedExtraProfit);
629
+ _feeGamma = parseUnits(feeGamma);
630
+ _adjustmentStep = parseUnits(adjustmentStep);
631
+ _maHalfTime = parseUnits(maHalfTime, 0);
632
+ _initialPrice = parseUnits(initialPrice);
633
+ contract = curve.contracts[curve.constants.ALIASES.twocrypto_factory].contract;
634
+ return [4 /*yield*/, contract.deploy_pool.estimateGas(name, symbol, coins, 0, _A, _gamma, _midFee, _outFee, _feeGamma, _allowedExtraProfit, _adjustmentStep, _maHalfTime, _initialPrice, curve.constantOptions)];
635
+ case 1:
636
+ gas = _a.sent();
637
+ if (estimateGas)
638
+ return [2 /*return*/, smartNumber(gas)];
639
+ gasLimit = mulBy1_3(DIGas(gas));
640
+ return [4 /*yield*/, curve.updateFeeData()];
641
+ case 2:
642
+ _a.sent();
643
+ return [4 /*yield*/, contract.deploy_pool(name, symbol, coins, 0, _A, _gamma, _midFee, _outFee, _feeGamma, _allowedExtraProfit, _adjustmentStep, _maHalfTime, _initialPrice, __assign(__assign({}, curve.options), { gasLimit: gasLimit }))];
644
+ case 3: return [2 /*return*/, _a.sent()];
645
+ }
646
+ });
647
+ }); };
648
+ export var deployTwocryptoPoolEstimateGas = function (name, symbol, coins, A, gamma, midFee, // %
649
+ outFee, // %
650
+ allowedExtraProfit, feeGamma, adjustmentStep, maHalfTime, // Seconds
651
+ initialPrice) { return __awaiter(void 0, void 0, void 0, function () {
652
+ return __generator(this, function (_a) {
653
+ switch (_a.label) {
654
+ case 0: return [4 /*yield*/, _deployTwocryptoPool(name, symbol, coins, A, gamma, midFee, outFee, allowedExtraProfit, feeGamma, adjustmentStep, maHalfTime, initialPrice, true)];
655
+ case 1: return [2 /*return*/, _a.sent()];
656
+ }
657
+ });
658
+ }); };
659
+ export var deployTwocryptoPool = function (name, symbol, coins, A, gamma, midFee, // %
660
+ outFee, // %
661
+ allowedExtraProfit, feeGamma, adjustmentStep, maHalfTime, // Seconds
662
+ initialPrice) { return __awaiter(void 0, void 0, void 0, function () {
663
+ return __generator(this, function (_a) {
664
+ switch (_a.label) {
665
+ case 0: return [4 /*yield*/, _deployTwocryptoPool(name, symbol, coins, A, gamma, midFee, outFee, allowedExtraProfit, feeGamma, adjustmentStep, maHalfTime, initialPrice, false)];
666
+ case 1: return [2 /*return*/, _a.sent()];
667
+ }
668
+ });
669
+ }); };
670
+ export var getDeployedTwocryptoPoolAddress = function (tx) { return __awaiter(void 0, void 0, void 0, function () {
671
+ var txInfo, i;
672
+ return __generator(this, function (_a) {
673
+ switch (_a.label) {
674
+ case 0: return [4 /*yield*/, tx.wait()];
675
+ case 1:
676
+ txInfo = _a.sent();
677
+ if (!txInfo)
678
+ throw Error("Can't get tx info");
679
+ for (i = txInfo.logs.length - 1; i > -1; i--) {
680
+ if ("args" in txInfo.logs[i]) {
681
+ // @ts-ignore
682
+ return [2 /*return*/, txInfo.logs[i].args[0]];
683
+ }
684
+ }
685
+ throw Error("Can't get deployed tricrypto pool address");
686
+ }
687
+ });
688
+ }); };
571
689
  // ------- TRICRYPTO POOLS -------
572
690
  var _deployTricryptoPool = function (name, symbol, coins, A, gamma, midFee, // %
573
691
  outFee, // %
@@ -140,7 +140,7 @@ export function getFactoryPoolsDataFromApi(factoryType) {
140
140
  switch (_b.label) {
141
141
  case 0:
142
142
  network = this.constants.NETWORK_NAME;
143
- isCrypto = factoryType === "factory-crypto" || factoryType === "factory-tricrypto";
143
+ isCrypto = factoryType === "factory-crypto" || factoryType === "factory-twocrypto" || factoryType === "factory-tricrypto";
144
144
  _a = lowerCasePoolDataAddresses;
145
145
  return [4 /*yield*/, _getPoolsFromApi(network, factoryType)];
146
146
  case 1:
@@ -0,0 +1,2 @@
1
+ import { IDict, IPoolData, ICurve } from "../interfaces";
2
+ export declare function getTwocryptoFactoryPoolData(this: ICurve, fromIdx?: number, swapAddress?: string): Promise<IDict<IPoolData>>;