@paraswap/dex-lib 2.33.1 → 2.33.3

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/src/dex/index.ts CHANGED
@@ -51,6 +51,7 @@ import { SpiritSwapV2 } from './solidly/forks-override/spiritSwapV2';
51
51
  import { Synthetix } from './synthetix/synthetix';
52
52
  import { Cone } from './solidly/forks-override/cone';
53
53
  import { SoliSnek } from './solidly/forks-override/solisnek';
54
+ import { Equalizer } from './solidly/forks-override/equalizer';
54
55
  import { BalancerV1 } from './balancer-v1/balancer-v1';
55
56
  import { balancerV1Merge } from './balancer-v1/optimizer';
56
57
  import { CurveV1 } from './curve-v1/curve-v1';
@@ -72,6 +73,7 @@ import { SpiritSwapV3 } from './quickswap/spiritswap-v3';
72
73
  import { TraderJoeV21 } from './trader-joe-v2.1';
73
74
  import { PancakeswapV3 } from './pancakeswap-v3/pancakeswap-v3';
74
75
  import { Algebra } from './algebra/algebra';
76
+ import { NomiswapV2 } from './uniswap-v2/nomiswap-v2';
75
77
 
76
78
  const LegacyDexes = [
77
79
  CurveV2,
@@ -133,6 +135,7 @@ const Dexes = [
133
135
  VelodromeV2,
134
136
  Cone,
135
137
  SoliSnek,
138
+ Equalizer,
136
139
  Synthetix,
137
140
  CurveV1Factory,
138
141
  SwaapV1,
@@ -141,6 +144,7 @@ const Dexes = [
141
144
  MaverickV1,
142
145
  Camelot,
143
146
  SwaapV2,
147
+ NomiswapV2,
144
148
  ];
145
149
 
146
150
  export type LegacyDexConstructor = new (dexHelper: IDexHelper) => IDexTxBuilder<
@@ -148,6 +148,16 @@ export const SolidlyConfig: DexConfigMap<DexParams> = {
148
148
  feeCode: 0,
149
149
  },
150
150
  },
151
+ Equalizer: {
152
+ [Network.FANTOM]: {
153
+ factoryAddress: '0xc6366EFD0AF1d09171fe0EBF32c7943BB310832a',
154
+ router: '0x93d2611EB8b85bE4FDEa9D94Ce9913D90072eC0f',
155
+ initCode:
156
+ '0x02ada2a0163cd4f7e0f0c9805f5230716a95b174140e4c84c14883de216cc6a3',
157
+ feeCode: 0,
158
+ poolGasCost: 180 * 1000,
159
+ },
160
+ },
151
161
  };
152
162
 
153
163
  export const Adapters: Record<number, AdapterMappings> = {
@@ -155,7 +165,7 @@ export const Adapters: Record<number, AdapterMappings> = {
155
165
  [SwapSide.SELL]: [{ name: 'PolygonAdapter02', index: 3 }], // dystopia
156
166
  },
157
167
  [Network.FANTOM]: {
158
- [SwapSide.SELL]: [{ name: 'FantomAdapter01', index: 10 }], // solidly + spiritSwapV2
168
+ [SwapSide.SELL]: [{ name: 'FantomAdapter01', index: 10 }], // solidly + spiritSwapV2 + Equalizer
159
169
  },
160
170
  [Network.OPTIMISM]: {
161
171
  [SwapSide.SELL]: [{ name: 'OptimismAdapter01', index: 8 }], // velodrome
@@ -0,0 +1,58 @@
1
+ import { Solidly } from '../solidly';
2
+ import { SolidlyPair } from '../types';
3
+ import { Network } from '../../../constants';
4
+ import { IDexHelper } from '../../../dex-helper';
5
+ import { Interface } from '@ethersproject/abi';
6
+ import { getDexKeysWithNetwork } from '../../../utils';
7
+ import { SolidlyConfig } from '../config';
8
+ import _ from 'lodash';
9
+
10
+ const EqualizerFactoryABI = [
11
+ {
12
+ inputs: [{ internalType: 'address', name: '_pair', type: 'address' }],
13
+ name: 'getRealFee',
14
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
15
+ stateMutability: 'view',
16
+ type: 'function',
17
+ },
18
+ ];
19
+
20
+ const equalizerFactoryIface = new Interface(EqualizerFactoryABI);
21
+
22
+ export class Equalizer extends Solidly {
23
+ public static dexKeysWithNetwork: { key: string; networks: Network[] }[] =
24
+ getDexKeysWithNetwork(_.pick(SolidlyConfig, ['Equalizer']));
25
+
26
+ constructor(
27
+ protected network: Network,
28
+ dexKey: string,
29
+ protected dexHelper: IDexHelper,
30
+ ) {
31
+ super(
32
+ network,
33
+ dexKey,
34
+ dexHelper,
35
+ true, // dynamic fees
36
+ );
37
+ }
38
+
39
+ protected getFeesMultiCallData(pair: SolidlyPair) {
40
+ const callEntry = {
41
+ target: this.factoryAddress,
42
+ callData: equalizerFactoryIface.encodeFunctionData('getRealFee', [
43
+ pair.exchange,
44
+ ]),
45
+ };
46
+ const callDecoder = (values: any[]) =>
47
+ parseInt(
48
+ equalizerFactoryIface
49
+ .decodeFunctionResult('getRealFee', values)[0]
50
+ .toString(),
51
+ );
52
+
53
+ return {
54
+ callEntry,
55
+ callDecoder,
56
+ };
57
+ }
58
+ }
@@ -2,7 +2,11 @@ import dotenv from 'dotenv';
2
2
  dotenv.config();
3
3
 
4
4
  import { testE2E } from '../../../tests/utils-e2e';
5
- import { Tokens, Holders, NativeTokenSymbols } from '../../../tests/constants-e2e';
5
+ import {
6
+ Tokens,
7
+ Holders,
8
+ NativeTokenSymbols,
9
+ } from '../../../tests/constants-e2e';
6
10
  import { Network, ContractMethod, SwapSide } from '../../constants';
7
11
  import { StaticJsonRpcProvider } from '@ethersproject/providers';
8
12
  import { generateConfig } from '../../config';
@@ -389,6 +393,28 @@ describe('Solidly E2E', () => {
389
393
  });
390
394
  });
391
395
  });
396
+
397
+ describe('Equalizer', () => {
398
+ const dexKey = 'Equalizer';
399
+ const network = Network.FANTOM;
400
+
401
+ const tokenASymbol: string = 'FUSDT';
402
+ const tokenBSymbol: string = 'USDC';
403
+
404
+ const tokenAAmount: string = '111110';
405
+ const tokenBAmount: string = '100000';
406
+ const nativeTokenAmount = '11000000000000000';
407
+
408
+ testForNetwork(
409
+ network,
410
+ dexKey,
411
+ tokenASymbol,
412
+ tokenBSymbol,
413
+ tokenAAmount,
414
+ tokenBAmount,
415
+ nativeTokenAmount,
416
+ );
417
+ });
392
418
  });
393
419
 
394
420
  describe('Mainnet', () => {
@@ -1378,5 +1404,4 @@ describe('Solidly E2E', () => {
1378
1404
  );
1379
1405
  });
1380
1406
  });
1381
-
1382
1407
  });
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  import dotenv from 'dotenv';
2
3
  dotenv.config();
3
4
 
@@ -15,6 +16,7 @@ import { Chronos } from './forks-override/chronos';
15
16
  import { Ramses } from './forks-override/ramses';
16
17
  import * as util from 'util';
17
18
  import { VelodromeV2 } from './forks-override/velodromeV2';
19
+ import { Equalizer } from './forks-override/equalizer';
18
20
 
19
21
  const amounts18 = [0n, BI_POWS[18], 2000000000000000000n];
20
22
  const amounts6 = [0n, BI_POWS[6], 2000000n];
@@ -46,7 +48,7 @@ function decodeReaderResult(
46
48
  const constructCheckOnChainPricing =
47
49
  (dexHelper: DummyDexHelper) =>
48
50
  async (
49
- soldily: Solidly,
51
+ solidly: Solidly,
50
52
  funcName: string,
51
53
  blockNumber: number,
52
54
  prices: bigint[],
@@ -88,7 +90,7 @@ describe('Solidly integration tests', () => {
88
90
 
89
91
  describe('Solidly', function () {
90
92
  const dexKey = 'Solidly';
91
- const soldily = new Solidly(network, dexKey, dexHelper);
93
+ const solidly = new Solidly(network, dexKey, dexHelper);
92
94
 
93
95
  describe('UniswapV2 like pool', function () {
94
96
  const TokenASymbol = 'WFTM';
@@ -100,7 +102,7 @@ describe('Solidly integration tests', () => {
100
102
 
101
103
  it('getPoolIdentifiers and getPricesVolume', async function () {
102
104
  const blocknumber = await dexHelper.web3Provider.eth.getBlockNumber();
103
- const pools = await soldily.getPoolIdentifiers(
105
+ const pools = await solidly.getPoolIdentifiers(
104
106
  tokenA,
105
107
  tokenB,
106
108
  SwapSide.SELL,
@@ -113,7 +115,7 @@ describe('Solidly integration tests', () => {
113
115
 
114
116
  expect(pools.length).toBeGreaterThan(0);
115
117
 
116
- const poolPrices = await soldily.getPricesVolume(
118
+ const poolPrices = await solidly.getPricesVolume(
117
119
  tokenA,
118
120
  tokenB,
119
121
  amounts,
@@ -131,13 +133,13 @@ describe('Solidly integration tests', () => {
131
133
 
132
134
  // Check if onchain pricing equals to calculated ones
133
135
 
134
- for (const i in poolPrices || []) {
136
+ for (const poolPrice of poolPrices || []) {
135
137
  await checkOnChainPricing(
136
- soldily,
138
+ solidly,
137
139
  'getAmountOut',
138
140
  blocknumber,
139
- poolPrices![i].prices,
140
- poolPrices![i].poolAddresses![0],
141
+ poolPrice.prices,
142
+ poolPrice.poolAddresses![0],
141
143
  tokenA.address,
142
144
  amounts,
143
145
  );
@@ -145,7 +147,7 @@ describe('Solidly integration tests', () => {
145
147
  });
146
148
 
147
149
  it('getTopPoolsForToken', async function () {
148
- const poolLiquidity = await soldily.getTopPoolsForToken(
150
+ const poolLiquidity = await solidly.getTopPoolsForToken(
149
151
  tokenA.address,
150
152
  10,
151
153
  );
@@ -165,7 +167,7 @@ describe('Solidly integration tests', () => {
165
167
 
166
168
  it('getPoolIdentifiers and getPricesVolume', async function () {
167
169
  const blocknumber = await dexHelper.web3Provider.eth.getBlockNumber();
168
- const pools = await soldily.getPoolIdentifiers(
170
+ const pools = await solidly.getPoolIdentifiers(
169
171
  tokenA,
170
172
  tokenB,
171
173
  SwapSide.SELL,
@@ -178,7 +180,7 @@ describe('Solidly integration tests', () => {
178
180
 
179
181
  expect(pools.length).toBeGreaterThan(0);
180
182
 
181
- const poolPrices = await soldily.getPricesVolume(
183
+ const poolPrices = await solidly.getPricesVolume(
182
184
  tokenA,
183
185
  tokenB,
184
186
  amounts,
@@ -195,13 +197,13 @@ describe('Solidly integration tests', () => {
195
197
  checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
196
198
 
197
199
  // Check if onchain pricing equals to calculated ones
198
- for (const i in poolPrices || []) {
200
+ for (const poolPrice of poolPrices || []) {
199
201
  await checkOnChainPricing(
200
- soldily,
202
+ solidly,
201
203
  'getAmountOut',
202
204
  blocknumber,
203
- poolPrices![i].prices,
204
- poolPrices![i].poolAddresses![0],
205
+ poolPrice.prices,
206
+ poolPrice.poolAddresses![0],
205
207
  tokenA.address,
206
208
  amounts,
207
209
  );
@@ -209,7 +211,7 @@ describe('Solidly integration tests', () => {
209
211
  });
210
212
 
211
213
  it('getTopPoolsForToken', async function () {
212
- const poolLiquidity = await soldily.getTopPoolsForToken(
214
+ const poolLiquidity = await solidly.getTopPoolsForToken(
213
215
  tokenA.address,
214
216
  10,
215
217
  );
@@ -265,13 +267,13 @@ describe('Solidly integration tests', () => {
265
267
 
266
268
  // Check if onchain pricing equals to calculated ones
267
269
 
268
- for (const i in poolPrices || []) {
270
+ for (const poolPrice of poolPrices || []) {
269
271
  await checkOnChainPricing(
270
272
  spiritSwapV2,
271
273
  'getAmountOut',
272
274
  blocknumber,
273
- poolPrices![i].prices,
274
- poolPrices![i].poolAddresses![0],
275
+ poolPrice.prices,
276
+ poolPrice.poolAddresses![0],
275
277
  tokenA.address,
276
278
  amounts,
277
279
  );
@@ -329,13 +331,13 @@ describe('Solidly integration tests', () => {
329
331
  checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
330
332
 
331
333
  // Check if onchain pricing equals to calculated ones
332
- for (const i in poolPrices || []) {
334
+ for (const poolPrice of poolPrices || []) {
333
335
  await checkOnChainPricing(
334
336
  spiritSwapV2,
335
337
  'getAmountOut',
336
338
  blocknumber,
337
- poolPrices![i].prices,
338
- poolPrices![i].poolAddresses![0],
339
+ poolPrice.prices,
340
+ poolPrice.poolAddresses![0],
339
341
  tokenA.address,
340
342
  amounts,
341
343
  );
@@ -353,6 +355,176 @@ describe('Solidly integration tests', () => {
353
355
  });
354
356
  });
355
357
  });
358
+
359
+ describe('Equalizer', () => {
360
+ const dexKey = 'Equalizer';
361
+ const equalizer = new Equalizer(network, dexKey, dexHelper);
362
+
363
+ describe('UniswapV2 like pool', function () {
364
+ const TokenASymbol = 'WFTM';
365
+ const tokenA = Tokens[network][TokenASymbol];
366
+ const TokenBSymbol = 'FUSDT';
367
+ const tokenB = Tokens[network][TokenBSymbol];
368
+
369
+ const amounts = amounts18;
370
+
371
+ it('getPoolIdentifiers and getPricesVolume', async function () {
372
+ const blocknumber = await dexHelper.web3Provider.eth.getBlockNumber();
373
+ const pools = await equalizer.getPoolIdentifiers(
374
+ tokenA,
375
+ tokenB,
376
+ SwapSide.SELL,
377
+ blocknumber,
378
+ );
379
+ console.log(
380
+ `${TokenASymbol} <> ${TokenBSymbol} Pool Identifiers: `,
381
+ pools,
382
+ );
383
+
384
+ expect(pools.length).toBeGreaterThan(0);
385
+
386
+ const poolPrices = await equalizer.getPricesVolume(
387
+ tokenA,
388
+ tokenB,
389
+ amounts,
390
+ SwapSide.SELL,
391
+ blocknumber,
392
+ pools,
393
+ );
394
+ console.log(
395
+ `${TokenASymbol} <> ${TokenBSymbol} Pool Prices: `,
396
+ poolPrices,
397
+ );
398
+
399
+ expect(poolPrices).not.toBeNull();
400
+ checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
401
+
402
+ // Check if onchain pricing equals to calculated ones
403
+
404
+ for (const poolPrice of poolPrices || []) {
405
+ await checkOnChainPricing(
406
+ equalizer,
407
+ 'getAmountOut',
408
+ blocknumber,
409
+ poolPrice.prices,
410
+ poolPrice.poolAddresses![0],
411
+ tokenA.address,
412
+ amounts,
413
+ );
414
+ }
415
+ });
416
+ });
417
+
418
+ describe('Curve like stable pool', function () {
419
+ const TokenASymbol = 'FUSDT';
420
+ const tokenA = Tokens[network][TokenASymbol];
421
+ const TokenBSymbol = 'USDC';
422
+ const tokenB = Tokens[network][TokenBSymbol];
423
+
424
+ const amounts = amounts6; // amounts6;
425
+
426
+ it('getPoolIdentifiers and getPricesVolume', async function () {
427
+ const blocknumber = await dexHelper.web3Provider.eth.getBlockNumber();
428
+ const pools = await equalizer.getPoolIdentifiers(
429
+ tokenA,
430
+ tokenB,
431
+ SwapSide.SELL,
432
+ blocknumber,
433
+ );
434
+ console.log(
435
+ `${TokenASymbol} <> ${TokenBSymbol} Pool Identifiers: `,
436
+ pools,
437
+ );
438
+
439
+ expect(pools.length).toBeGreaterThan(0);
440
+
441
+ const poolPrices = await equalizer.getPricesVolume(
442
+ tokenA,
443
+ tokenB,
444
+ amounts,
445
+ SwapSide.SELL,
446
+ blocknumber,
447
+ pools,
448
+ );
449
+ console.log(
450
+ `${TokenASymbol} <> ${TokenBSymbol} Pool Prices: `,
451
+ poolPrices,
452
+ );
453
+
454
+ expect(poolPrices).not.toBeNull();
455
+ checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
456
+
457
+ // Check if onchain pricing equals to calculated ones
458
+ for (const poolPrice of poolPrices || []) {
459
+ await checkOnChainPricing(
460
+ equalizer,
461
+ 'getAmountOut',
462
+ blocknumber,
463
+ poolPrice.prices,
464
+ poolPrice.poolAddresses![0],
465
+ tokenA.address,
466
+ amounts,
467
+ );
468
+ }
469
+ });
470
+ });
471
+
472
+ describe('FTM -> EQUAL', () => {
473
+ const TokenASymbol = 'WFTM';
474
+ const tokenA = Tokens[network][TokenASymbol];
475
+ const TokenBSymbol = 'EQUAL';
476
+ const tokenB = Tokens[network][TokenBSymbol];
477
+
478
+ const amounts = [0n, 10000000n];
479
+
480
+ console.log('AMOUNTS: ', amounts);
481
+ it('getPoolIdentifiers and getPricesVolume', async function () {
482
+ // const blocknumber = await dexHelper.web3Provider.eth.getBlockNumber();
483
+ const blocknumber = 67666611;
484
+ const pools = await equalizer.getPoolIdentifiers(
485
+ tokenA,
486
+ tokenB,
487
+ SwapSide.SELL,
488
+ blocknumber,
489
+ );
490
+ console.log(
491
+ `${TokenASymbol} <> ${TokenBSymbol} Pool Identifiers: `,
492
+ pools,
493
+ );
494
+
495
+ expect(pools.length).toBeGreaterThan(0);
496
+
497
+ const poolPrices = await equalizer.getPricesVolume(
498
+ tokenA,
499
+ tokenB,
500
+ amounts,
501
+ SwapSide.SELL,
502
+ blocknumber,
503
+ pools,
504
+ );
505
+ console.log(
506
+ `${TokenASymbol} <> ${TokenBSymbol} Pool Prices: `,
507
+ poolPrices,
508
+ );
509
+
510
+ expect(poolPrices).not.toBeNull();
511
+ checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
512
+
513
+ // Check if onchain pricing equals to calculated ones
514
+ for (const poolPrice of poolPrices || []) {
515
+ await checkOnChainPricing(
516
+ equalizer,
517
+ 'getAmountOut',
518
+ blocknumber,
519
+ poolPrice.prices,
520
+ poolPrice.poolAddresses![0],
521
+ tokenA.address,
522
+ amounts,
523
+ );
524
+ }
525
+ });
526
+ });
527
+ });
356
528
  });
357
529
 
358
530
  describe('Polygon', () => {
@@ -405,13 +577,13 @@ describe('Solidly integration tests', () => {
405
577
 
406
578
  // Check if onchain pricing equals to calculated ones
407
579
 
408
- for (const i in poolPrices || []) {
580
+ for (const poolPrice of poolPrices || []) {
409
581
  await checkOnChainPricing(
410
582
  dystopia,
411
583
  'getAmountOut',
412
584
  blocknumber,
413
- poolPrices![i].prices,
414
- poolPrices![i].poolAddresses![0],
585
+ poolPrice.prices,
586
+ poolPrice.poolAddresses![0],
415
587
  tokenA.address,
416
588
  amounts,
417
589
  );
@@ -469,13 +641,13 @@ describe('Solidly integration tests', () => {
469
641
  checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
470
642
 
471
643
  // Check if onchain pricing equals to calculated ones
472
- for (const i in poolPrices || []) {
644
+ for (const poolPrice of poolPrices || []) {
473
645
  await checkOnChainPricing(
474
646
  dystopia,
475
647
  'getAmountOut',
476
648
  blocknumber,
477
- poolPrices![i].prices,
478
- poolPrices![i].poolAddresses![0],
649
+ poolPrice.prices,
650
+ poolPrice.poolAddresses![0],
479
651
  tokenA.address,
480
652
  amounts,
481
653
  );
@@ -545,13 +717,13 @@ describe('Solidly integration tests', () => {
545
717
 
546
718
  // Check if onchain pricing equals to calculated ones
547
719
 
548
- for (const i in poolPrices || []) {
720
+ for (const poolPrice of poolPrices || []) {
549
721
  await checkOnChainPricing(
550
722
  cone,
551
723
  'getAmountOut',
552
724
  blocknumber,
553
- poolPrices![i].prices,
554
- poolPrices![i].poolAddresses![0],
725
+ poolPrice.prices,
726
+ poolPrice.poolAddresses![0],
555
727
  tokenA.address,
556
728
  amounts,
557
729
  );
@@ -609,13 +781,13 @@ describe('Solidly integration tests', () => {
609
781
  checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
610
782
 
611
783
  // Check if onchain pricing equals to calculated ones
612
- for (const i in poolPrices || []) {
784
+ for (const poolPrice of poolPrices || []) {
613
785
  await checkOnChainPricing(
614
786
  cone,
615
787
  'getAmountOut',
616
788
  blocknumber,
617
- poolPrices![i].prices,
618
- poolPrices![i].poolAddresses![0],
789
+ poolPrice.prices,
790
+ poolPrice.poolAddresses![0],
619
791
  tokenA.address,
620
792
  amounts,
621
793
  );
@@ -685,13 +857,13 @@ describe('Solidly integration tests', () => {
685
857
 
686
858
  // Check if onchain pricing equals to calculated ones
687
859
 
688
- for (const i in poolPrices || []) {
860
+ for (const poolPrice of poolPrices || []) {
689
861
  await checkOnChainPricing(
690
862
  chronos,
691
863
  'getAmountOut',
692
864
  blocknumber,
693
- poolPrices![i].prices,
694
- poolPrices![i].poolAddresses![0],
865
+ poolPrice.prices,
866
+ poolPrice.poolAddresses![0],
695
867
  tokenA.address,
696
868
  amounts,
697
869
  );
@@ -749,13 +921,13 @@ describe('Solidly integration tests', () => {
749
921
  checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
750
922
 
751
923
  // Check if onchain pricing equals to calculated ones
752
- for (const i in poolPrices || []) {
924
+ for (const poolPrice of poolPrices || []) {
753
925
  await checkOnChainPricing(
754
926
  chronos,
755
927
  'getAmountOut',
756
928
  blocknumber,
757
- poolPrices![i].prices,
758
- poolPrices![i].poolAddresses![0],
929
+ poolPrice.prices,
930
+ poolPrice.poolAddresses![0],
759
931
  tokenA.address,
760
932
  amounts,
761
933
  );
@@ -821,13 +993,13 @@ describe('Solidly integration tests', () => {
821
993
 
822
994
  // Check if onchain pricing equals to calculated ones
823
995
 
824
- for (const i in poolPrices || []) {
996
+ for (const poolPrice of poolPrices || []) {
825
997
  await checkOnChainPricing(
826
998
  ramses,
827
999
  'getAmountOut',
828
1000
  blocknumber,
829
- poolPrices![i].prices,
830
- poolPrices![i].poolAddresses![0],
1001
+ poolPrice.prices,
1002
+ poolPrice.poolAddresses![0],
831
1003
  tokenA.address,
832
1004
  amounts,
833
1005
  );
@@ -885,13 +1057,13 @@ describe('Solidly integration tests', () => {
885
1057
  checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
886
1058
 
887
1059
  // Check if onchain pricing equals to calculated ones
888
- for (const i in poolPrices || []) {
1060
+ for (const poolPrice of poolPrices || []) {
889
1061
  await checkOnChainPricing(
890
1062
  ramses,
891
1063
  'getAmountOut',
892
1064
  blocknumber,
893
- poolPrices![i].prices,
894
- poolPrices![i].poolAddresses![0],
1065
+ poolPrice.prices,
1066
+ poolPrice.poolAddresses![0],
895
1067
  tokenA.address,
896
1068
  amounts,
897
1069
  );
@@ -961,13 +1133,13 @@ describe('Solidly integration tests', () => {
961
1133
 
962
1134
  // Check if onchain pricing equals to calculated ones
963
1135
 
964
- for (const i in poolPrices || []) {
1136
+ for (const poolPrice of poolPrices || []) {
965
1137
  await checkOnChainPricing(
966
1138
  velodromeV2,
967
1139
  'getAmountOut',
968
1140
  blocknumber,
969
- poolPrices![i].prices,
970
- poolPrices![i].poolAddresses![0],
1141
+ poolPrice.prices,
1142
+ poolPrice.poolAddresses![0],
971
1143
  tokenA.address,
972
1144
  amounts,
973
1145
  );
@@ -1015,13 +1187,13 @@ describe('Solidly integration tests', () => {
1015
1187
  checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
1016
1188
 
1017
1189
  // Check if onchain pricing equals to calculated ones
1018
- for (const i in poolPrices || []) {
1190
+ for (const poolPrice of poolPrices || []) {
1019
1191
  await checkOnChainPricing(
1020
1192
  velodromeV2,
1021
1193
  'getAmountOut',
1022
1194
  blocknumber,
1023
- poolPrices![i].prices,
1024
- poolPrices![i].poolAddresses![0],
1195
+ poolPrice.prices,
1196
+ poolPrice.poolAddresses![0],
1025
1197
  tokenA.address,
1026
1198
  amounts,
1027
1199
  );
@@ -74,6 +74,7 @@ export class Solidly extends UniswapV2 {
74
74
  'SoliSnek',
75
75
  'Chronos',
76
76
  'Ramses',
77
+ 'Equalizer',
77
78
  ]),
78
79
  );
79
80