@paraswap/dex-lib 3.4.2-balancer-v2-single-swap.0 → 3.4.2

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.
Files changed (110) hide show
  1. package/README.md +377 -377
  2. package/build/config.js +9 -5
  3. package/build/config.js.map +1 -1
  4. package/build/dex/algebra/algebra.js +25 -25
  5. package/build/dex/balancer-v1/balancer-v1.js +34 -34
  6. package/build/dex/balancer-v2/balancer-v2.d.ts +1 -1
  7. package/build/dex/balancer-v2/balancer-v2.js +65 -78
  8. package/build/dex/balancer-v2/balancer-v2.js.map +1 -1
  9. package/build/dex/camelot/camelot.js +27 -27
  10. package/build/dex/kyberdmm/kyberdmm.js +27 -27
  11. package/build/dex/pancakeswap-v3/pancakeswap-v3.js +25 -25
  12. package/build/dex/solidly/solidly.js +27 -27
  13. package/build/dex/solidly-v3/solidly-v3.js +25 -25
  14. package/build/dex/swaap-v2/config.js +15 -0
  15. package/build/dex/swaap-v2/config.js.map +1 -1
  16. package/build/dex/uniswap-v2/uniswap-v2.js +26 -26
  17. package/build/dex/uniswap-v3/uniswap-v3.js +25 -25
  18. package/funding.json +5 -5
  19. package/package.json +1 -1
  20. package/src/config.ts +500 -496
  21. package/src/constants.ts +67 -67
  22. package/src/dex/aave-v2/aave-v2.ts +409 -409
  23. package/src/dex/aave-v3/aave-v3.ts +320 -320
  24. package/src/dex/algebra/algebra.ts +1180 -1180
  25. package/src/dex/angle-staked-stable/angle-staked-stable.ts +347 -347
  26. package/src/dex/augustus-rfq.ts +180 -180
  27. package/src/dex/bProtocol/bProtocol.ts +108 -108
  28. package/src/dex/balancer-v1/balancer-v1.ts +572 -572
  29. package/src/dex/balancer-v2/balancer-v2-e2e.test.ts +1699 -1699
  30. package/src/dex/balancer-v2/balancer-v2.ts +1669 -1701
  31. package/src/dex/bancor/bancor.ts +128 -128
  32. package/src/dex/camelot/camelot.ts +873 -873
  33. package/src/dex/compound/compound.ts +107 -107
  34. package/src/dex/curve-v1/config.ts +1179 -1179
  35. package/src/dex/curve-v1/curve-v1-e2e.test.ts +507 -507
  36. package/src/dex/curve-v1/curve-v1.ts +1315 -1315
  37. package/src/dex/curve-v1-factory/config.ts +1018 -1018
  38. package/src/dex/curve-v1-factory/curve-v1-factory.ts +1288 -1288
  39. package/src/dex/curve-v2/curve-v2.ts +440 -440
  40. package/src/dex/dexalot/dexalot.ts +1100 -1100
  41. package/src/dex/dodo-v1/dodo-v1.ts +132 -132
  42. package/src/dex/dodo-v2.ts +266 -266
  43. package/src/dex/etherfi.ts +239 -239
  44. package/src/dex/generic-rfq/generic-rfq.ts +431 -431
  45. package/src/dex/gmx/gmx.ts +321 -321
  46. package/src/dex/hashflow/hashflow.ts +1135 -1135
  47. package/src/dex/idex.ts +254 -254
  48. package/src/dex/index.ts +357 -357
  49. package/src/dex/jarvis-v6/jarvis-v6.ts +509 -509
  50. package/src/dex/jarvis.ts +262 -262
  51. package/src/dex/kyberdmm/kyberdmm.ts +649 -649
  52. package/src/dex/lido/lido.ts +110 -110
  53. package/src/dex/maker-psm/maker-psm.ts +592 -592
  54. package/src/dex/maverick-v1/maverick-v1.ts +537 -537
  55. package/src/dex/nerve/config.ts +635 -635
  56. package/src/dex/nerve/nerve-e2e.test.ts +731 -731
  57. package/src/dex/nerve/nerve-events.test.ts +911 -911
  58. package/src/dex/nerve/nerve.ts +467 -467
  59. package/src/dex/onebit/onebit.ts +113 -113
  60. package/src/dex/pancakeswap-v3/pancakeswap-v3.ts +1150 -1150
  61. package/src/dex/paraswap-limit-orders/config.ts +60 -60
  62. package/src/dex/paraswap-limit-orders/paraswap-limit-orders-e2e.test.ts +137 -137
  63. package/src/dex/paraswap-limit-orders/paraswap-limit-orders-integration.test.ts +328 -328
  64. package/src/dex/paraswap-limit-orders/paraswap-limit-orders.ts +631 -631
  65. package/src/dex/polygon-migrator/polygon-migrator.ts +194 -194
  66. package/src/dex/quick-perps/quick-perps.ts +337 -337
  67. package/src/dex/quickswap/config.ts +16 -16
  68. package/src/dex/quickswap/quickswap-e2e.test.ts +384 -384
  69. package/src/dex/smoothy/smoothy.ts +110 -110
  70. package/src/dex/solidly/config.ts +225 -225
  71. package/src/dex/solidly/solidly-e2e.test.ts +1421 -1421
  72. package/src/dex/solidly/solidly-integration.test.ts +1753 -1753
  73. package/src/dex/solidly/solidly.ts +687 -687
  74. package/src/dex/solidly-v3/solidly-v3.ts +968 -968
  75. package/src/dex/spark/spark.ts +284 -284
  76. package/src/dex/stable-pool/stable-pool.ts +129 -129
  77. package/src/dex/swaap-v2/config.ts +15 -0
  78. package/src/dex/swaap-v2/swaap-v2-e2e.test.ts +233 -17
  79. package/src/dex/swaap-v2/swaap-v2-integration.test.ts +1 -1
  80. package/src/dex/swaap-v2/swaap-v2.ts +1056 -1056
  81. package/src/dex/swell/swell.ts +312 -312
  82. package/src/dex/synthetix/synthetix.ts +420 -420
  83. package/src/dex/trader-joe-v2.1/trader-joe-v2.1.ts +180 -180
  84. package/src/dex/uniswap-v2/config.ts +637 -637
  85. package/src/dex/uniswap-v2/constants.ts +58 -58
  86. package/src/dex/uniswap-v2/uniswap-v2-e2e-avalanche.test.ts +1257 -1257
  87. package/src/dex/uniswap-v2/uniswap-v2-e2e-base.test.ts +42 -42
  88. package/src/dex/uniswap-v2/uniswap-v2-e2e-bsc.test.ts +1295 -1295
  89. package/src/dex/uniswap-v2/uniswap-v2-e2e-mainnet.test.ts +1834 -1834
  90. package/src/dex/uniswap-v2/uniswap-v2-e2e-polygon.test.ts +871 -871
  91. package/src/dex/uniswap-v2/uniswap-v2.ts +1117 -1117
  92. package/src/dex/uniswap-v3/uniswap-v3.ts +1501 -1501
  93. package/src/dex/uniswap-v3.ts +242 -242
  94. package/src/dex/weth/config.ts +73 -73
  95. package/src/dex/weth/weth.ts +230 -230
  96. package/src/dex/wombat/wombat.ts +467 -467
  97. package/src/dex/woo-fi-v2/woo-fi-v2.ts +529 -529
  98. package/src/dex/wsteth/wsteth.ts +304 -304
  99. package/src/dex/zerox/index.ts +328 -328
  100. package/src/executor/Executor01BytecodeBuilder.ts +474 -474
  101. package/src/executor/Executor02BytecodeBuilder.ts +1392 -1392
  102. package/src/executor/ExecutorBytecodeBuilder.ts +390 -390
  103. package/src/executor/ExecutorDetector.ts +131 -131
  104. package/src/executor/constants.ts +66 -66
  105. package/src/executor/executor01-bytecode-builder-e2e.test.ts +1478 -1478
  106. package/src/executor/utils.ts +62 -62
  107. package/src/router/simpleswap.ts +366 -366
  108. package/src/types.ts +342 -342
  109. package/tests/constants-e2e.ts +1632 -1622
  110. package/tests/generate-new-limit-order.ts +107 -107
@@ -1,1257 +1,1257 @@
1
- import dotenv from 'dotenv';
2
- dotenv.config();
3
-
4
- import { testE2E } from '../../../tests/utils-e2e';
5
- import { Tokens, Holders } from '../../../tests/constants-e2e';
6
- import { Network, ContractMethod, SwapSide } from '../../constants';
7
- import { StaticJsonRpcProvider } from '@ethersproject/providers';
8
- import { generateConfig } from '../../config';
9
-
10
- describe('UniswapV2 E2E Avalanche', () => {
11
- const network = Network.AVALANCHE;
12
- const tokens = Tokens[network];
13
- const holders = Holders[network];
14
- const provider = new StaticJsonRpcProvider(
15
- generateConfig(network).privateHttpProvider,
16
- network,
17
- );
18
-
19
- describe('PangolinSwap', () => {
20
- const dexKey = 'PangolinSwap';
21
-
22
- describe('simpleSwap', () => {
23
- it('AVAX -> USDT.e', async () => {
24
- await testE2E(
25
- tokens.AVAX,
26
- tokens.USDTe,
27
- holders.AVAX,
28
- '7000000000000000000',
29
- SwapSide.SELL,
30
- dexKey,
31
- ContractMethod.simpleSwap,
32
- network,
33
- provider,
34
- );
35
- });
36
-
37
- it('USDT.e -> AVAX', async () => {
38
- await testE2E(
39
- tokens.USDTe,
40
- tokens.AVAX,
41
- holders.USDTe,
42
- '10000000',
43
- SwapSide.SELL,
44
- dexKey,
45
- ContractMethod.simpleSwap,
46
- network,
47
- provider,
48
- );
49
- });
50
-
51
- it('WAVAX -> USDTe', async () => {
52
- await testE2E(
53
- tokens.WAVAX,
54
- tokens.USDTe,
55
- holders.WAVAX,
56
- '7000000000000000000',
57
- SwapSide.SELL,
58
- dexKey,
59
- ContractMethod.simpleSwap,
60
- network,
61
- provider,
62
- );
63
- });
64
- });
65
-
66
- describe('multiSwap', () => {
67
- it('AVAX -> USDTe', async () => {
68
- await testE2E(
69
- tokens.AVAX,
70
- tokens.USDTe,
71
- holders.AVAX,
72
- '1000000000000000000',
73
- SwapSide.SELL,
74
- dexKey,
75
- ContractMethod.multiSwap,
76
- network,
77
- provider,
78
- );
79
- });
80
-
81
- it('USDTe -> AVAX', async () => {
82
- await testE2E(
83
- tokens.USDTe,
84
- tokens.AVAX,
85
- holders.USDTe,
86
- '100000000',
87
- SwapSide.SELL,
88
- dexKey,
89
- ContractMethod.multiSwap,
90
- network,
91
- provider,
92
- );
93
- });
94
-
95
- it('WAVAX -> USDTe', async () => {
96
- await testE2E(
97
- tokens.WAVAX,
98
- tokens.USDTe,
99
- holders.WAVAX,
100
- '7000000000000000000',
101
- SwapSide.SELL,
102
- dexKey,
103
- ContractMethod.multiSwap,
104
- network,
105
- provider,
106
- );
107
- });
108
- });
109
-
110
- describe('megaSwap', () => {
111
- it('AVAX -> USDTe', async () => {
112
- await testE2E(
113
- tokens.AVAX,
114
- tokens.USDTe,
115
- holders.AVAX,
116
- '1000000000000000000',
117
- SwapSide.SELL,
118
- dexKey,
119
- ContractMethod.megaSwap,
120
- network,
121
- provider,
122
- );
123
- });
124
-
125
- it('USDTe -> AVAX', async () => {
126
- await testE2E(
127
- tokens.USDTe,
128
- tokens.AVAX,
129
- holders.USDTe,
130
- '100000000',
131
- SwapSide.SELL,
132
- dexKey,
133
- ContractMethod.megaSwap,
134
- network,
135
- provider,
136
- );
137
- });
138
-
139
- it('WAVAX -> USDTe', async () => {
140
- await testE2E(
141
- tokens.WAVAX,
142
- tokens.USDTe,
143
- holders.WAVAX,
144
- '7000000000000000000',
145
- SwapSide.SELL,
146
- dexKey,
147
- ContractMethod.megaSwap,
148
- network,
149
- provider,
150
- );
151
- });
152
- });
153
-
154
- describe('BuyMethod', () => {
155
- it('AVAX -> USDT.e', async () => {
156
- await testE2E(
157
- tokens.AVAX,
158
- tokens.USDTe,
159
- holders.AVAX,
160
- '100000000',
161
- SwapSide.BUY,
162
- dexKey,
163
- ContractMethod.buy,
164
- network,
165
- provider,
166
- );
167
- });
168
-
169
- it('USDT.e -> AVAX', async () => {
170
- await testE2E(
171
- tokens.USDTe,
172
- tokens.AVAX,
173
- holders.USDTe,
174
- '7000000000000000000',
175
- SwapSide.BUY,
176
- dexKey,
177
- ContractMethod.buy,
178
- network,
179
- provider,
180
- );
181
- });
182
-
183
- it('WAVAX -> USDTe', async () => {
184
- await testE2E(
185
- tokens.WAVAX,
186
- tokens.USDTe,
187
- holders.WAVAX,
188
- '100000000',
189
- SwapSide.BUY,
190
- dexKey,
191
- ContractMethod.buy,
192
- network,
193
- provider,
194
- );
195
- });
196
- });
197
- });
198
-
199
- describe('TraderJoe', () => {
200
- const dexKey = 'TraderJoe';
201
- describe('TraderJoe: Fail: (Joe: K)', () => {
202
- // To run might need to hardcode the price route in e2e utils
203
- it('AVAX -> LINK.e', async () => {
204
- const dexKeys = ['LydiaFinance', 'PangolinSwap', 'TraderJoe'];
205
- await testE2E(
206
- tokens.WAVAX,
207
- tokens.LINKe,
208
- holders.WAVAX,
209
- '37000000000000000000',
210
- SwapSide.SELL,
211
- dexKeys,
212
- ContractMethod.swapExactAmountIn,
213
- network,
214
- provider,
215
- );
216
- });
217
- });
218
-
219
- describe('simpleSwap', () => {
220
- it('AMPL -> MIM', async () => {
221
- await testE2E(
222
- tokens.AMPL,
223
- tokens.MIM,
224
- holders.AMPL,
225
- '1000000000',
226
- SwapSide.SELL,
227
- dexKey,
228
- ContractMethod.simpleSwap,
229
- network,
230
- provider,
231
- );
232
- });
233
-
234
- it('WAVAX -> USDTe', async () => {
235
- await testE2E(
236
- tokens.WAVAX,
237
- tokens.USDTe,
238
- holders.WAVAX,
239
- '7000000000000000000',
240
- SwapSide.SELL,
241
- dexKey,
242
- ContractMethod.simpleSwap,
243
- network,
244
- provider,
245
- );
246
- });
247
-
248
- it('AMPL -> MIM', async () => {
249
- await testE2E(
250
- tokens.AMPL,
251
- tokens.MIM,
252
- holders.AMPL,
253
- '1000000000',
254
- SwapSide.SELL,
255
- dexKey,
256
- ContractMethod.simpleSwap,
257
- network,
258
- provider,
259
- );
260
- });
261
-
262
- it('MIM -> AMPL', async () => {
263
- await testE2E(
264
- tokens.MIM,
265
- tokens.AMPL,
266
- holders.MIM,
267
- '1000000000000000000',
268
- SwapSide.SELL,
269
- dexKey,
270
- ContractMethod.simpleSwap,
271
- network,
272
- provider,
273
- );
274
- });
275
- });
276
-
277
- describe('multiSwap', () => {
278
- it('AVAX -> USDTe', async () => {
279
- await testE2E(
280
- tokens.AVAX,
281
- tokens.USDTe,
282
- holders.AVAX,
283
- '1000000000000000000',
284
- SwapSide.SELL,
285
- dexKey,
286
- ContractMethod.multiSwap,
287
- network,
288
- provider,
289
- );
290
- });
291
-
292
- it('USDTe -> AVAX', async () => {
293
- await testE2E(
294
- tokens.USDTe,
295
- tokens.AVAX,
296
- holders.USDTe,
297
- '100000000',
298
- SwapSide.SELL,
299
- dexKey,
300
- ContractMethod.multiSwap,
301
- network,
302
- provider,
303
- );
304
- });
305
-
306
- it('WAVAX -> USDTe', async () => {
307
- await testE2E(
308
- tokens.WAVAX,
309
- tokens.USDTe,
310
- holders.WAVAX,
311
- '7000000000000000000',
312
- SwapSide.SELL,
313
- dexKey,
314
- ContractMethod.multiSwap,
315
- network,
316
- provider,
317
- );
318
- });
319
- });
320
-
321
- describe('megaSwap', () => {
322
- it('AVAX -> USDTe', async () => {
323
- await testE2E(
324
- tokens.AVAX,
325
- tokens.USDTe,
326
- holders.AVAX,
327
- '1000000000000000000',
328
- SwapSide.SELL,
329
- dexKey,
330
- ContractMethod.megaSwap,
331
- network,
332
- provider,
333
- );
334
- });
335
-
336
- it('USDTe -> AVAX', async () => {
337
- await testE2E(
338
- tokens.USDTe,
339
- tokens.AVAX,
340
- holders.USDTe,
341
- '100000000',
342
- SwapSide.SELL,
343
- dexKey,
344
- ContractMethod.megaSwap,
345
- network,
346
- provider,
347
- );
348
- });
349
-
350
- it('WAVAX -> USDTe', async () => {
351
- await testE2E(
352
- tokens.WAVAX,
353
- tokens.USDTe,
354
- holders.WAVAX,
355
- '7000000000000000000',
356
- SwapSide.SELL,
357
- dexKey,
358
- ContractMethod.megaSwap,
359
- network,
360
- provider,
361
- );
362
- });
363
- });
364
- });
365
-
366
- describe('SushiSwap', () => {
367
- const dexKey = 'SushiSwap';
368
-
369
- describe('simpleSwap', () => {
370
- it('AVAX -> ETH', async () => {
371
- await testE2E(
372
- tokens.AVAX,
373
- tokens.ETH,
374
- holders.AVAX,
375
- '3000000000000000000',
376
- SwapSide.SELL,
377
- dexKey,
378
- ContractMethod.simpleSwap,
379
- network,
380
- provider,
381
- );
382
- });
383
-
384
- it('ETH -> AVAX', async () => {
385
- await testE2E(
386
- tokens.ETH,
387
- tokens.AVAX,
388
- holders.ETH,
389
- '30000000000000000',
390
- SwapSide.SELL,
391
- dexKey,
392
- ContractMethod.simpleSwap,
393
- network,
394
- provider,
395
- );
396
- });
397
-
398
- it('WAVAX -> USDT', async () => {
399
- await testE2E(
400
- tokens.WAVAX,
401
- tokens.USDT,
402
- holders.WAVAX,
403
- '7000000000000000000',
404
- SwapSide.SELL,
405
- dexKey,
406
- ContractMethod.simpleSwap,
407
- network,
408
- provider,
409
- );
410
- });
411
- });
412
-
413
- describe('multiSwap', () => {
414
- it('AVAX -> ETH', async () => {
415
- await testE2E(
416
- tokens.AVAX,
417
- tokens.ETH,
418
- holders.AVAX,
419
- '3000000000000000000',
420
- SwapSide.SELL,
421
- dexKey,
422
- ContractMethod.multiSwap,
423
- network,
424
- provider,
425
- );
426
- });
427
-
428
- it('ETH -> AVAX', async () => {
429
- await testE2E(
430
- tokens.ETH,
431
- tokens.AVAX,
432
- holders.ETH,
433
- '30000000000000000',
434
- SwapSide.SELL,
435
- dexKey,
436
- ContractMethod.multiSwap,
437
- network,
438
- provider,
439
- );
440
- });
441
-
442
- it('WAVAX -> USDT', async () => {
443
- await testE2E(
444
- tokens.WAVAX,
445
- tokens.USDT,
446
- holders.WAVAX,
447
- '7000000000000000000',
448
- SwapSide.SELL,
449
- dexKey,
450
- ContractMethod.multiSwap,
451
- network,
452
- provider,
453
- );
454
- });
455
- });
456
-
457
- describe('megaSwap', () => {
458
- it('AVAX -> ETH', async () => {
459
- await testE2E(
460
- tokens.AVAX,
461
- tokens.ETH,
462
- holders.AVAX,
463
- '3000000000000000000',
464
- SwapSide.SELL,
465
- dexKey,
466
- ContractMethod.megaSwap,
467
- network,
468
- provider,
469
- );
470
- });
471
-
472
- it('ETH -> AVAX', async () => {
473
- await testE2E(
474
- tokens.ETH,
475
- tokens.AVAX,
476
- holders.ETH,
477
- '30000000000000000',
478
- SwapSide.SELL,
479
- dexKey,
480
- ContractMethod.megaSwap,
481
- network,
482
- provider,
483
- );
484
- });
485
-
486
- it('WAVAX -> USDT', async () => {
487
- await testE2E(
488
- tokens.WAVAX,
489
- tokens.USDT,
490
- holders.WAVAX,
491
- '7000000000000000000',
492
- SwapSide.SELL,
493
- dexKey,
494
- ContractMethod.megaSwap,
495
- network,
496
- provider,
497
- );
498
- });
499
- });
500
- });
501
-
502
- describe(`Swapsicle`, () => {
503
- const dexKey = 'Swapsicle';
504
-
505
- const sideToContractMethods = new Map([
506
- [
507
- SwapSide.SELL,
508
- [
509
- ContractMethod.simpleSwap,
510
- ContractMethod.multiSwap,
511
- ContractMethod.megaSwap,
512
- ],
513
- ],
514
- [SwapSide.BUY, [ContractMethod.simpleBuy, ContractMethod.buy]],
515
- ]);
516
-
517
- const pairs: { name: string; sellAmount: string; buyAmount: string }[][] = [
518
- [
519
- { name: 'WAVAX', sellAmount: '7000000000000000000', buyAmount: '1000' },
520
- { name: 'USDC', sellAmount: '5000', buyAmount: '10000000' },
521
- ],
522
- [
523
- { name: 'USDCe', sellAmount: '3000000000', buyAmount: '1000' },
524
- { name: 'MIM', sellAmount: '300000000000000000', buyAmount: '300000' },
525
- ],
526
- [
527
- { name: 'WAVAX', sellAmount: '7000000000000000000', buyAmount: '1000' },
528
- { name: 'USDCe', sellAmount: '1000', buyAmount: '1000' },
529
- ],
530
- [
531
- { name: 'POPS', sellAmount: '7000000000000000000', buyAmount: '1000' },
532
- { name: 'WAVAX', sellAmount: '7000000000000000000', buyAmount: '1000' },
533
- ],
534
- ];
535
-
536
- sideToContractMethods.forEach((contractMethods, side) =>
537
- describe(`${side}`, () => {
538
- contractMethods.forEach((contractMethod: ContractMethod) => {
539
- pairs.forEach(pair => {
540
- describe(`${contractMethod}`, () => {
541
- it(`${pair[0].name} -> ${pair[1].name}`, async () => {
542
- await testE2E(
543
- tokens[pair[0].name],
544
- tokens[pair[1].name],
545
- holders[pair[0].name],
546
- side === SwapSide.SELL
547
- ? pair[0].sellAmount
548
- : pair[0].buyAmount,
549
- side,
550
- dexKey,
551
- contractMethod,
552
- network,
553
- provider,
554
- );
555
- });
556
- it(`${pair[1].name} -> ${pair[0].name}`, async () => {
557
- await testE2E(
558
- tokens[pair[1].name],
559
- tokens[pair[0].name],
560
- holders[pair[1].name],
561
- side === SwapSide.SELL
562
- ? pair[1].sellAmount
563
- : pair[1].buyAmount,
564
- side,
565
- dexKey,
566
- contractMethod,
567
- network,
568
- provider,
569
- );
570
- });
571
- });
572
- });
573
- });
574
- }),
575
- );
576
- });
577
-
578
- describe('CanarySwap', () => {
579
- const dexKey = 'CanarySwap';
580
-
581
- describe('simpleSwap', () => {
582
- it('AVAX -> PNG', async () => {
583
- await testE2E(
584
- tokens.AVAX,
585
- tokens.PNG,
586
- holders.AVAX,
587
- '300000000000000000',
588
- SwapSide.SELL,
589
- dexKey,
590
- ContractMethod.simpleSwap,
591
- network,
592
- provider,
593
- );
594
- });
595
-
596
- it('PNG -> AVAX', async () => {
597
- await testE2E(
598
- tokens.PNG,
599
- tokens.AVAX,
600
- holders.PNG,
601
- '3000000000000000000',
602
- SwapSide.SELL,
603
- dexKey,
604
- ContractMethod.simpleSwap,
605
- network,
606
- provider,
607
- );
608
- });
609
-
610
- it('WAVAX -> PNG', async () => {
611
- await testE2E(
612
- tokens.WAVAX,
613
- tokens.PNG,
614
- holders.WAVAX,
615
- '100000000000000000',
616
- SwapSide.SELL,
617
- dexKey,
618
- ContractMethod.simpleSwap,
619
- network,
620
- provider,
621
- );
622
- });
623
- });
624
-
625
- describe('multiSwap', () => {
626
- it('AVAX -> PNG', async () => {
627
- await testE2E(
628
- tokens.AVAX,
629
- tokens.PNG,
630
- holders.AVAX,
631
- '30000000000000000',
632
- SwapSide.SELL,
633
- dexKey,
634
- ContractMethod.multiSwap,
635
- network,
636
- provider,
637
- );
638
- });
639
-
640
- it('PNG -> AVAX', async () => {
641
- await testE2E(
642
- tokens.PNG,
643
- tokens.AVAX,
644
- holders.PNG,
645
- '3000000000000000000',
646
- SwapSide.SELL,
647
- dexKey,
648
- ContractMethod.multiSwap,
649
- network,
650
- provider,
651
- );
652
- });
653
-
654
- it('WAVAX -> PNG', async () => {
655
- await testE2E(
656
- tokens.WAVAX,
657
- tokens.PNG,
658
- holders.WAVAX,
659
- '700000000000000000',
660
- SwapSide.SELL,
661
- dexKey,
662
- ContractMethod.multiSwap,
663
- network,
664
- provider,
665
- );
666
- });
667
- });
668
-
669
- describe('megaSwap', () => {
670
- it('AVAX -> PNG', async () => {
671
- await testE2E(
672
- tokens.AVAX,
673
- tokens.PNG,
674
- holders.AVAX,
675
- '300000000000000000',
676
- SwapSide.SELL,
677
- dexKey,
678
- ContractMethod.megaSwap,
679
- network,
680
- provider,
681
- );
682
- });
683
-
684
- it('PNG -> AVAX', async () => {
685
- await testE2E(
686
- tokens.PNG,
687
- tokens.AVAX,
688
- holders.PNG,
689
- '3000000000000000000',
690
- SwapSide.SELL,
691
- dexKey,
692
- ContractMethod.megaSwap,
693
- network,
694
- provider,
695
- );
696
- });
697
-
698
- it('WAVAX -> PNG', async () => {
699
- await testE2E(
700
- tokens.WAVAX,
701
- tokens.PNG,
702
- holders.WAVAX,
703
- '700000000000000000',
704
- SwapSide.SELL,
705
- dexKey,
706
- ContractMethod.megaSwap,
707
- network,
708
- provider,
709
- );
710
- });
711
- });
712
- });
713
-
714
- describe('Baguette', () => {
715
- const dexKey = 'Baguette';
716
-
717
- describe('simpleSwap', () => {
718
- it('AVAX -> USDTe', async () => {
719
- await testE2E(
720
- tokens.AVAX,
721
- tokens.USDTe,
722
- holders.AVAX,
723
- '100000000000000000',
724
- SwapSide.SELL,
725
- dexKey,
726
- ContractMethod.simpleSwap,
727
- network,
728
- provider,
729
- );
730
- });
731
-
732
- it('USDTe -> AVAX', async () => {
733
- await testE2E(
734
- tokens.USDTe,
735
- tokens.AVAX,
736
- holders.USDTe,
737
- '100000000',
738
- SwapSide.SELL,
739
- dexKey,
740
- ContractMethod.simpleSwap,
741
- network,
742
- provider,
743
- );
744
- });
745
-
746
- it('WAVAX -> USDTe', async () => {
747
- await testE2E(
748
- tokens.WAVAX,
749
- tokens.USDTe,
750
- holders.WAVAX,
751
- '7000000000000000000',
752
- SwapSide.SELL,
753
- dexKey,
754
- ContractMethod.simpleSwap,
755
- network,
756
- provider,
757
- );
758
- });
759
- });
760
-
761
- describe('multiSwap', () => {
762
- it('AVAX -> USDTe', async () => {
763
- await testE2E(
764
- tokens.AVAX,
765
- tokens.USDTe,
766
- holders.AVAX,
767
- '7000000000000000000',
768
- SwapSide.SELL,
769
- dexKey,
770
- ContractMethod.multiSwap,
771
- network,
772
- provider,
773
- );
774
- });
775
-
776
- it('USDTe -> AVAX', async () => {
777
- await testE2E(
778
- tokens.USDTe,
779
- tokens.AVAX,
780
- holders.USDTe,
781
- '10000000',
782
- SwapSide.SELL,
783
- dexKey,
784
- ContractMethod.multiSwap,
785
- network,
786
- provider,
787
- );
788
- });
789
-
790
- it('WAVAX -> USDTe', async () => {
791
- await testE2E(
792
- tokens.WAVAX,
793
- tokens.USDTe,
794
- holders.WAVAX,
795
- '7000000000000000000',
796
- SwapSide.SELL,
797
- dexKey,
798
- ContractMethod.multiSwap,
799
- network,
800
- provider,
801
- );
802
- });
803
- });
804
-
805
- describe('megaSwap', () => {
806
- it('AVAX -> USDTe', async () => {
807
- await testE2E(
808
- tokens.AVAX,
809
- tokens.USDTe,
810
- holders.AVAX,
811
- '7000000000000000000',
812
- SwapSide.SELL,
813
- dexKey,
814
- ContractMethod.megaSwap,
815
- network,
816
- provider,
817
- );
818
- });
819
-
820
- it('USDTe -> AVAX', async () => {
821
- await testE2E(
822
- tokens.USDTe,
823
- tokens.AVAX,
824
- holders.USDTe,
825
- '10000000',
826
- SwapSide.SELL,
827
- dexKey,
828
- ContractMethod.megaSwap,
829
- network,
830
- provider,
831
- );
832
- });
833
-
834
- it('WAVAX -> USDTe', async () => {
835
- await testE2E(
836
- tokens.WAVAX,
837
- tokens.USDTe,
838
- holders.WAVAX,
839
- '7000000000000000000',
840
- SwapSide.SELL,
841
- dexKey,
842
- ContractMethod.megaSwap,
843
- network,
844
- provider,
845
- );
846
- });
847
- });
848
- });
849
-
850
- describe('ComplusSwap', () => {
851
- const dexKey = 'ComplusSwap';
852
-
853
- describe('simpleSwap', () => {
854
- it('AVAX -> USDT', async () => {
855
- await testE2E(
856
- tokens.AVAX,
857
- tokens.USDT,
858
- holders.AVAX,
859
- '7000000000000000000',
860
- SwapSide.SELL,
861
- dexKey,
862
- ContractMethod.simpleSwap,
863
- network,
864
- provider,
865
- );
866
- });
867
-
868
- it('ETH -> AVAX', async () => {
869
- await testE2E(
870
- tokens.ETH,
871
- tokens.AVAX,
872
- holders.ETH,
873
- '1000000000000000',
874
- SwapSide.SELL,
875
- dexKey,
876
- ContractMethod.simpleSwap,
877
- network,
878
- provider,
879
- );
880
- });
881
-
882
- it('WAVAX -> USDT', async () => {
883
- await testE2E(
884
- tokens.WAVAX,
885
- tokens.USDT,
886
- holders.WAVAX,
887
- '7000000000000000000',
888
- SwapSide.SELL,
889
- dexKey,
890
- ContractMethod.simpleSwap,
891
- network,
892
- provider,
893
- );
894
- });
895
- });
896
-
897
- describe('multiSwap', () => {
898
- it('AVAX -> USDT', async () => {
899
- await testE2E(
900
- tokens.AVAX,
901
- tokens.USDT,
902
- holders.AVAX,
903
- '7000000000000000000',
904
- SwapSide.SELL,
905
- dexKey,
906
- ContractMethod.multiSwap,
907
- network,
908
- provider,
909
- );
910
- });
911
-
912
- it('ETH -> AVAX', async () => {
913
- await testE2E(
914
- tokens.ETH,
915
- tokens.AVAX,
916
- holders.ETH,
917
- '10000000000000',
918
- SwapSide.SELL,
919
- dexKey,
920
- ContractMethod.multiSwap,
921
- network,
922
- provider,
923
- );
924
- });
925
-
926
- it('WAVAX -> USDT', async () => {
927
- await testE2E(
928
- tokens.WAVAX,
929
- tokens.USDT,
930
- holders.WAVAX,
931
- '7000000000000000000',
932
- SwapSide.SELL,
933
- dexKey,
934
- ContractMethod.multiSwap,
935
- network,
936
- provider,
937
- );
938
- });
939
- });
940
-
941
- describe('megaSwap', () => {
942
- it('AVAX -> USDT', async () => {
943
- await testE2E(
944
- tokens.AVAX,
945
- tokens.USDT,
946
- holders.AVAX,
947
- '7000000000000000000',
948
- SwapSide.SELL,
949
- dexKey,
950
- ContractMethod.megaSwap,
951
- network,
952
- provider,
953
- );
954
- });
955
-
956
- it('ETH -> AVAX', async () => {
957
- await testE2E(
958
- tokens.ETH,
959
- tokens.AVAX,
960
- holders.ETH,
961
- '100000000000000',
962
- SwapSide.SELL,
963
- dexKey,
964
- ContractMethod.megaSwap,
965
- network,
966
- provider,
967
- );
968
- });
969
-
970
- it('WAVAX -> USDT', async () => {
971
- await testE2E(
972
- tokens.WAVAX,
973
- tokens.USDT,
974
- holders.WAVAX,
975
- '7000000000000000000',
976
- SwapSide.SELL,
977
- dexKey,
978
- ContractMethod.megaSwap,
979
- network,
980
- provider,
981
- );
982
- });
983
- });
984
- });
985
-
986
- describe('ElkFinance', () => {
987
- const dexKey = 'ElkFinance';
988
-
989
- describe('simpleSwap', () => {
990
- it('AVAX -> ETH', async () => {
991
- await testE2E(
992
- tokens.AVAX,
993
- tokens.ETH,
994
- holders.AVAX,
995
- '3000000000000000000',
996
- SwapSide.SELL,
997
- dexKey,
998
- ContractMethod.simpleSwap,
999
- network,
1000
- provider,
1001
- );
1002
- });
1003
-
1004
- it('ETH -> AVAX', async () => {
1005
- await testE2E(
1006
- tokens.ETH,
1007
- tokens.AVAX,
1008
- holders.ETH,
1009
- '30000000000000000',
1010
- SwapSide.SELL,
1011
- dexKey,
1012
- ContractMethod.simpleSwap,
1013
- network,
1014
- provider,
1015
- );
1016
- });
1017
-
1018
- it('WAVAX -> USDT', async () => {
1019
- await testE2E(
1020
- tokens.WAVAX,
1021
- tokens.USDT,
1022
- holders.WAVAX,
1023
- '300000000000000000',
1024
- SwapSide.SELL,
1025
- dexKey,
1026
- ContractMethod.simpleSwap,
1027
- network,
1028
- provider,
1029
- );
1030
- });
1031
- });
1032
-
1033
- describe('multiSwap', () => {
1034
- it('AVAX -> ETH', async () => {
1035
- await testE2E(
1036
- tokens.AVAX,
1037
- tokens.ETH,
1038
- holders.AVAX,
1039
- '3000000000000000000',
1040
- SwapSide.SELL,
1041
- dexKey,
1042
- ContractMethod.multiSwap,
1043
- network,
1044
- provider,
1045
- );
1046
- });
1047
-
1048
- it('ETH -> AVAX', async () => {
1049
- await testE2E(
1050
- tokens.ETH,
1051
- tokens.AVAX,
1052
- holders.ETH,
1053
- '30000000000000000',
1054
- SwapSide.SELL,
1055
- dexKey,
1056
- ContractMethod.multiSwap,
1057
- network,
1058
- provider,
1059
- );
1060
- });
1061
-
1062
- it('WAVAX -> USDT', async () => {
1063
- await testE2E(
1064
- tokens.WAVAX,
1065
- tokens.USDT,
1066
- holders.WAVAX,
1067
- '300000000000000000',
1068
- SwapSide.SELL,
1069
- dexKey,
1070
- ContractMethod.multiSwap,
1071
- network,
1072
- provider,
1073
- );
1074
- });
1075
- });
1076
-
1077
- describe('megaSwap', () => {
1078
- it('AVAX -> ETH', async () => {
1079
- await testE2E(
1080
- tokens.AVAX,
1081
- tokens.ETH,
1082
- holders.AVAX,
1083
- '3000000000000000000',
1084
- SwapSide.SELL,
1085
- dexKey,
1086
- ContractMethod.megaSwap,
1087
- network,
1088
- provider,
1089
- );
1090
- });
1091
-
1092
- it('ETH -> AVAX', async () => {
1093
- await testE2E(
1094
- tokens.ETH,
1095
- tokens.AVAX,
1096
- holders.ETH,
1097
- '30000000000000000',
1098
- SwapSide.SELL,
1099
- dexKey,
1100
- ContractMethod.megaSwap,
1101
- network,
1102
- provider,
1103
- );
1104
- });
1105
-
1106
- it('WAVAX -> USDT', async () => {
1107
- await testE2E(
1108
- tokens.WAVAX,
1109
- tokens.USDT,
1110
- holders.WAVAX,
1111
- '300000000000000000',
1112
- SwapSide.SELL,
1113
- dexKey,
1114
- ContractMethod.megaSwap,
1115
- network,
1116
- provider,
1117
- );
1118
- });
1119
- });
1120
- });
1121
-
1122
- describe('YetiSwap', () => {
1123
- const dexKey = 'YetiSwap';
1124
-
1125
- describe('simpleSwap', () => {
1126
- it('AVAX -> ETH', async () => {
1127
- await testE2E(
1128
- tokens.AVAX,
1129
- tokens.ETH,
1130
- holders.AVAX,
1131
- '3000000000000000000',
1132
- SwapSide.SELL,
1133
- dexKey,
1134
- ContractMethod.simpleSwap,
1135
- network,
1136
- provider,
1137
- );
1138
- });
1139
-
1140
- it('ETH -> AVAX', async () => {
1141
- await testE2E(
1142
- tokens.ETH,
1143
- tokens.AVAX,
1144
- holders.ETH,
1145
- '30000000000000000',
1146
- SwapSide.SELL,
1147
- dexKey,
1148
- ContractMethod.simpleSwap,
1149
- network,
1150
- provider,
1151
- );
1152
- });
1153
-
1154
- it('WAVAX -> USDTe', async () => {
1155
- await testE2E(
1156
- tokens.WAVAX,
1157
- tokens.USDTe,
1158
- holders.WAVAX,
1159
- '3000000000000000000',
1160
- SwapSide.SELL,
1161
- dexKey,
1162
- ContractMethod.simpleSwap,
1163
- network,
1164
- provider,
1165
- );
1166
- });
1167
- });
1168
-
1169
- describe('multiSwap', () => {
1170
- it('AVAX -> ETH', async () => {
1171
- await testE2E(
1172
- tokens.AVAX,
1173
- tokens.ETH,
1174
- holders.AVAX,
1175
- '3000000000000000000',
1176
- SwapSide.SELL,
1177
- dexKey,
1178
- ContractMethod.multiSwap,
1179
- network,
1180
- provider,
1181
- );
1182
- });
1183
-
1184
- it('ETH -> AVAX', async () => {
1185
- await testE2E(
1186
- tokens.ETH,
1187
- tokens.AVAX,
1188
- holders.ETH,
1189
- '30000000000000000',
1190
- SwapSide.SELL,
1191
- dexKey,
1192
- ContractMethod.multiSwap,
1193
- network,
1194
- provider,
1195
- );
1196
- });
1197
-
1198
- it('WAVAX -> USDTe', async () => {
1199
- await testE2E(
1200
- tokens.WAVAX,
1201
- tokens.USDTe,
1202
- holders.WAVAX,
1203
- '3000000000000000000',
1204
- SwapSide.SELL,
1205
- dexKey,
1206
- ContractMethod.multiSwap,
1207
- network,
1208
- provider,
1209
- );
1210
- });
1211
- });
1212
-
1213
- describe('megaSwap', () => {
1214
- it('AVAX -> ETH', async () => {
1215
- await testE2E(
1216
- tokens.AVAX,
1217
- tokens.ETH,
1218
- holders.AVAX,
1219
- '3000000000000000000',
1220
- SwapSide.SELL,
1221
- dexKey,
1222
- ContractMethod.megaSwap,
1223
- network,
1224
- provider,
1225
- );
1226
- });
1227
-
1228
- it('ETH -> AVAX', async () => {
1229
- await testE2E(
1230
- tokens.ETH,
1231
- tokens.AVAX,
1232
- holders.ETH,
1233
- '30000000000000000',
1234
- SwapSide.SELL,
1235
- dexKey,
1236
- ContractMethod.megaSwap,
1237
- network,
1238
- provider,
1239
- );
1240
- });
1241
-
1242
- it('WAVAX -> USDTe', async () => {
1243
- await testE2E(
1244
- tokens.WAVAX,
1245
- tokens.USDTe,
1246
- holders.WAVAX,
1247
- '3000000000000000000',
1248
- SwapSide.SELL,
1249
- dexKey,
1250
- ContractMethod.megaSwap,
1251
- network,
1252
- provider,
1253
- );
1254
- });
1255
- });
1256
- });
1257
- });
1
+ import dotenv from 'dotenv';
2
+ dotenv.config();
3
+
4
+ import { testE2E } from '../../../tests/utils-e2e';
5
+ import { Tokens, Holders } from '../../../tests/constants-e2e';
6
+ import { Network, ContractMethod, SwapSide } from '../../constants';
7
+ import { StaticJsonRpcProvider } from '@ethersproject/providers';
8
+ import { generateConfig } from '../../config';
9
+
10
+ describe('UniswapV2 E2E Avalanche', () => {
11
+ const network = Network.AVALANCHE;
12
+ const tokens = Tokens[network];
13
+ const holders = Holders[network];
14
+ const provider = new StaticJsonRpcProvider(
15
+ generateConfig(network).privateHttpProvider,
16
+ network,
17
+ );
18
+
19
+ describe('PangolinSwap', () => {
20
+ const dexKey = 'PangolinSwap';
21
+
22
+ describe('simpleSwap', () => {
23
+ it('AVAX -> USDT.e', async () => {
24
+ await testE2E(
25
+ tokens.AVAX,
26
+ tokens.USDTe,
27
+ holders.AVAX,
28
+ '7000000000000000000',
29
+ SwapSide.SELL,
30
+ dexKey,
31
+ ContractMethod.simpleSwap,
32
+ network,
33
+ provider,
34
+ );
35
+ });
36
+
37
+ it('USDT.e -> AVAX', async () => {
38
+ await testE2E(
39
+ tokens.USDTe,
40
+ tokens.AVAX,
41
+ holders.USDTe,
42
+ '10000000',
43
+ SwapSide.SELL,
44
+ dexKey,
45
+ ContractMethod.simpleSwap,
46
+ network,
47
+ provider,
48
+ );
49
+ });
50
+
51
+ it('WAVAX -> USDTe', async () => {
52
+ await testE2E(
53
+ tokens.WAVAX,
54
+ tokens.USDTe,
55
+ holders.WAVAX,
56
+ '7000000000000000000',
57
+ SwapSide.SELL,
58
+ dexKey,
59
+ ContractMethod.simpleSwap,
60
+ network,
61
+ provider,
62
+ );
63
+ });
64
+ });
65
+
66
+ describe('multiSwap', () => {
67
+ it('AVAX -> USDTe', async () => {
68
+ await testE2E(
69
+ tokens.AVAX,
70
+ tokens.USDTe,
71
+ holders.AVAX,
72
+ '1000000000000000000',
73
+ SwapSide.SELL,
74
+ dexKey,
75
+ ContractMethod.multiSwap,
76
+ network,
77
+ provider,
78
+ );
79
+ });
80
+
81
+ it('USDTe -> AVAX', async () => {
82
+ await testE2E(
83
+ tokens.USDTe,
84
+ tokens.AVAX,
85
+ holders.USDTe,
86
+ '100000000',
87
+ SwapSide.SELL,
88
+ dexKey,
89
+ ContractMethod.multiSwap,
90
+ network,
91
+ provider,
92
+ );
93
+ });
94
+
95
+ it('WAVAX -> USDTe', async () => {
96
+ await testE2E(
97
+ tokens.WAVAX,
98
+ tokens.USDTe,
99
+ holders.WAVAX,
100
+ '7000000000000000000',
101
+ SwapSide.SELL,
102
+ dexKey,
103
+ ContractMethod.multiSwap,
104
+ network,
105
+ provider,
106
+ );
107
+ });
108
+ });
109
+
110
+ describe('megaSwap', () => {
111
+ it('AVAX -> USDTe', async () => {
112
+ await testE2E(
113
+ tokens.AVAX,
114
+ tokens.USDTe,
115
+ holders.AVAX,
116
+ '1000000000000000000',
117
+ SwapSide.SELL,
118
+ dexKey,
119
+ ContractMethod.megaSwap,
120
+ network,
121
+ provider,
122
+ );
123
+ });
124
+
125
+ it('USDTe -> AVAX', async () => {
126
+ await testE2E(
127
+ tokens.USDTe,
128
+ tokens.AVAX,
129
+ holders.USDTe,
130
+ '100000000',
131
+ SwapSide.SELL,
132
+ dexKey,
133
+ ContractMethod.megaSwap,
134
+ network,
135
+ provider,
136
+ );
137
+ });
138
+
139
+ it('WAVAX -> USDTe', async () => {
140
+ await testE2E(
141
+ tokens.WAVAX,
142
+ tokens.USDTe,
143
+ holders.WAVAX,
144
+ '7000000000000000000',
145
+ SwapSide.SELL,
146
+ dexKey,
147
+ ContractMethod.megaSwap,
148
+ network,
149
+ provider,
150
+ );
151
+ });
152
+ });
153
+
154
+ describe('BuyMethod', () => {
155
+ it('AVAX -> USDT.e', async () => {
156
+ await testE2E(
157
+ tokens.AVAX,
158
+ tokens.USDTe,
159
+ holders.AVAX,
160
+ '100000000',
161
+ SwapSide.BUY,
162
+ dexKey,
163
+ ContractMethod.buy,
164
+ network,
165
+ provider,
166
+ );
167
+ });
168
+
169
+ it('USDT.e -> AVAX', async () => {
170
+ await testE2E(
171
+ tokens.USDTe,
172
+ tokens.AVAX,
173
+ holders.USDTe,
174
+ '7000000000000000000',
175
+ SwapSide.BUY,
176
+ dexKey,
177
+ ContractMethod.buy,
178
+ network,
179
+ provider,
180
+ );
181
+ });
182
+
183
+ it('WAVAX -> USDTe', async () => {
184
+ await testE2E(
185
+ tokens.WAVAX,
186
+ tokens.USDTe,
187
+ holders.WAVAX,
188
+ '100000000',
189
+ SwapSide.BUY,
190
+ dexKey,
191
+ ContractMethod.buy,
192
+ network,
193
+ provider,
194
+ );
195
+ });
196
+ });
197
+ });
198
+
199
+ describe('TraderJoe', () => {
200
+ const dexKey = 'TraderJoe';
201
+ describe('TraderJoe: Fail: (Joe: K)', () => {
202
+ // To run might need to hardcode the price route in e2e utils
203
+ it('AVAX -> LINK.e', async () => {
204
+ const dexKeys = ['LydiaFinance', 'PangolinSwap', 'TraderJoe'];
205
+ await testE2E(
206
+ tokens.WAVAX,
207
+ tokens.LINKe,
208
+ holders.WAVAX,
209
+ '37000000000000000000',
210
+ SwapSide.SELL,
211
+ dexKeys,
212
+ ContractMethod.swapExactAmountIn,
213
+ network,
214
+ provider,
215
+ );
216
+ });
217
+ });
218
+
219
+ describe('simpleSwap', () => {
220
+ it('AMPL -> MIM', async () => {
221
+ await testE2E(
222
+ tokens.AMPL,
223
+ tokens.MIM,
224
+ holders.AMPL,
225
+ '1000000000',
226
+ SwapSide.SELL,
227
+ dexKey,
228
+ ContractMethod.simpleSwap,
229
+ network,
230
+ provider,
231
+ );
232
+ });
233
+
234
+ it('WAVAX -> USDTe', async () => {
235
+ await testE2E(
236
+ tokens.WAVAX,
237
+ tokens.USDTe,
238
+ holders.WAVAX,
239
+ '7000000000000000000',
240
+ SwapSide.SELL,
241
+ dexKey,
242
+ ContractMethod.simpleSwap,
243
+ network,
244
+ provider,
245
+ );
246
+ });
247
+
248
+ it('AMPL -> MIM', async () => {
249
+ await testE2E(
250
+ tokens.AMPL,
251
+ tokens.MIM,
252
+ holders.AMPL,
253
+ '1000000000',
254
+ SwapSide.SELL,
255
+ dexKey,
256
+ ContractMethod.simpleSwap,
257
+ network,
258
+ provider,
259
+ );
260
+ });
261
+
262
+ it('MIM -> AMPL', async () => {
263
+ await testE2E(
264
+ tokens.MIM,
265
+ tokens.AMPL,
266
+ holders.MIM,
267
+ '1000000000000000000',
268
+ SwapSide.SELL,
269
+ dexKey,
270
+ ContractMethod.simpleSwap,
271
+ network,
272
+ provider,
273
+ );
274
+ });
275
+ });
276
+
277
+ describe('multiSwap', () => {
278
+ it('AVAX -> USDTe', async () => {
279
+ await testE2E(
280
+ tokens.AVAX,
281
+ tokens.USDTe,
282
+ holders.AVAX,
283
+ '1000000000000000000',
284
+ SwapSide.SELL,
285
+ dexKey,
286
+ ContractMethod.multiSwap,
287
+ network,
288
+ provider,
289
+ );
290
+ });
291
+
292
+ it('USDTe -> AVAX', async () => {
293
+ await testE2E(
294
+ tokens.USDTe,
295
+ tokens.AVAX,
296
+ holders.USDTe,
297
+ '100000000',
298
+ SwapSide.SELL,
299
+ dexKey,
300
+ ContractMethod.multiSwap,
301
+ network,
302
+ provider,
303
+ );
304
+ });
305
+
306
+ it('WAVAX -> USDTe', async () => {
307
+ await testE2E(
308
+ tokens.WAVAX,
309
+ tokens.USDTe,
310
+ holders.WAVAX,
311
+ '7000000000000000000',
312
+ SwapSide.SELL,
313
+ dexKey,
314
+ ContractMethod.multiSwap,
315
+ network,
316
+ provider,
317
+ );
318
+ });
319
+ });
320
+
321
+ describe('megaSwap', () => {
322
+ it('AVAX -> USDTe', async () => {
323
+ await testE2E(
324
+ tokens.AVAX,
325
+ tokens.USDTe,
326
+ holders.AVAX,
327
+ '1000000000000000000',
328
+ SwapSide.SELL,
329
+ dexKey,
330
+ ContractMethod.megaSwap,
331
+ network,
332
+ provider,
333
+ );
334
+ });
335
+
336
+ it('USDTe -> AVAX', async () => {
337
+ await testE2E(
338
+ tokens.USDTe,
339
+ tokens.AVAX,
340
+ holders.USDTe,
341
+ '100000000',
342
+ SwapSide.SELL,
343
+ dexKey,
344
+ ContractMethod.megaSwap,
345
+ network,
346
+ provider,
347
+ );
348
+ });
349
+
350
+ it('WAVAX -> USDTe', async () => {
351
+ await testE2E(
352
+ tokens.WAVAX,
353
+ tokens.USDTe,
354
+ holders.WAVAX,
355
+ '7000000000000000000',
356
+ SwapSide.SELL,
357
+ dexKey,
358
+ ContractMethod.megaSwap,
359
+ network,
360
+ provider,
361
+ );
362
+ });
363
+ });
364
+ });
365
+
366
+ describe('SushiSwap', () => {
367
+ const dexKey = 'SushiSwap';
368
+
369
+ describe('simpleSwap', () => {
370
+ it('AVAX -> ETH', async () => {
371
+ await testE2E(
372
+ tokens.AVAX,
373
+ tokens.ETH,
374
+ holders.AVAX,
375
+ '3000000000000000000',
376
+ SwapSide.SELL,
377
+ dexKey,
378
+ ContractMethod.simpleSwap,
379
+ network,
380
+ provider,
381
+ );
382
+ });
383
+
384
+ it('ETH -> AVAX', async () => {
385
+ await testE2E(
386
+ tokens.ETH,
387
+ tokens.AVAX,
388
+ holders.ETH,
389
+ '30000000000000000',
390
+ SwapSide.SELL,
391
+ dexKey,
392
+ ContractMethod.simpleSwap,
393
+ network,
394
+ provider,
395
+ );
396
+ });
397
+
398
+ it('WAVAX -> USDT', async () => {
399
+ await testE2E(
400
+ tokens.WAVAX,
401
+ tokens.USDT,
402
+ holders.WAVAX,
403
+ '7000000000000000000',
404
+ SwapSide.SELL,
405
+ dexKey,
406
+ ContractMethod.simpleSwap,
407
+ network,
408
+ provider,
409
+ );
410
+ });
411
+ });
412
+
413
+ describe('multiSwap', () => {
414
+ it('AVAX -> ETH', async () => {
415
+ await testE2E(
416
+ tokens.AVAX,
417
+ tokens.ETH,
418
+ holders.AVAX,
419
+ '3000000000000000000',
420
+ SwapSide.SELL,
421
+ dexKey,
422
+ ContractMethod.multiSwap,
423
+ network,
424
+ provider,
425
+ );
426
+ });
427
+
428
+ it('ETH -> AVAX', async () => {
429
+ await testE2E(
430
+ tokens.ETH,
431
+ tokens.AVAX,
432
+ holders.ETH,
433
+ '30000000000000000',
434
+ SwapSide.SELL,
435
+ dexKey,
436
+ ContractMethod.multiSwap,
437
+ network,
438
+ provider,
439
+ );
440
+ });
441
+
442
+ it('WAVAX -> USDT', async () => {
443
+ await testE2E(
444
+ tokens.WAVAX,
445
+ tokens.USDT,
446
+ holders.WAVAX,
447
+ '7000000000000000000',
448
+ SwapSide.SELL,
449
+ dexKey,
450
+ ContractMethod.multiSwap,
451
+ network,
452
+ provider,
453
+ );
454
+ });
455
+ });
456
+
457
+ describe('megaSwap', () => {
458
+ it('AVAX -> ETH', async () => {
459
+ await testE2E(
460
+ tokens.AVAX,
461
+ tokens.ETH,
462
+ holders.AVAX,
463
+ '3000000000000000000',
464
+ SwapSide.SELL,
465
+ dexKey,
466
+ ContractMethod.megaSwap,
467
+ network,
468
+ provider,
469
+ );
470
+ });
471
+
472
+ it('ETH -> AVAX', async () => {
473
+ await testE2E(
474
+ tokens.ETH,
475
+ tokens.AVAX,
476
+ holders.ETH,
477
+ '30000000000000000',
478
+ SwapSide.SELL,
479
+ dexKey,
480
+ ContractMethod.megaSwap,
481
+ network,
482
+ provider,
483
+ );
484
+ });
485
+
486
+ it('WAVAX -> USDT', async () => {
487
+ await testE2E(
488
+ tokens.WAVAX,
489
+ tokens.USDT,
490
+ holders.WAVAX,
491
+ '7000000000000000000',
492
+ SwapSide.SELL,
493
+ dexKey,
494
+ ContractMethod.megaSwap,
495
+ network,
496
+ provider,
497
+ );
498
+ });
499
+ });
500
+ });
501
+
502
+ describe(`Swapsicle`, () => {
503
+ const dexKey = 'Swapsicle';
504
+
505
+ const sideToContractMethods = new Map([
506
+ [
507
+ SwapSide.SELL,
508
+ [
509
+ ContractMethod.simpleSwap,
510
+ ContractMethod.multiSwap,
511
+ ContractMethod.megaSwap,
512
+ ],
513
+ ],
514
+ [SwapSide.BUY, [ContractMethod.simpleBuy, ContractMethod.buy]],
515
+ ]);
516
+
517
+ const pairs: { name: string; sellAmount: string; buyAmount: string }[][] = [
518
+ [
519
+ { name: 'WAVAX', sellAmount: '7000000000000000000', buyAmount: '1000' },
520
+ { name: 'USDC', sellAmount: '5000', buyAmount: '10000000' },
521
+ ],
522
+ [
523
+ { name: 'USDCe', sellAmount: '3000000000', buyAmount: '1000' },
524
+ { name: 'MIM', sellAmount: '300000000000000000', buyAmount: '300000' },
525
+ ],
526
+ [
527
+ { name: 'WAVAX', sellAmount: '7000000000000000000', buyAmount: '1000' },
528
+ { name: 'USDCe', sellAmount: '1000', buyAmount: '1000' },
529
+ ],
530
+ [
531
+ { name: 'POPS', sellAmount: '7000000000000000000', buyAmount: '1000' },
532
+ { name: 'WAVAX', sellAmount: '7000000000000000000', buyAmount: '1000' },
533
+ ],
534
+ ];
535
+
536
+ sideToContractMethods.forEach((contractMethods, side) =>
537
+ describe(`${side}`, () => {
538
+ contractMethods.forEach((contractMethod: ContractMethod) => {
539
+ pairs.forEach(pair => {
540
+ describe(`${contractMethod}`, () => {
541
+ it(`${pair[0].name} -> ${pair[1].name}`, async () => {
542
+ await testE2E(
543
+ tokens[pair[0].name],
544
+ tokens[pair[1].name],
545
+ holders[pair[0].name],
546
+ side === SwapSide.SELL
547
+ ? pair[0].sellAmount
548
+ : pair[0].buyAmount,
549
+ side,
550
+ dexKey,
551
+ contractMethod,
552
+ network,
553
+ provider,
554
+ );
555
+ });
556
+ it(`${pair[1].name} -> ${pair[0].name}`, async () => {
557
+ await testE2E(
558
+ tokens[pair[1].name],
559
+ tokens[pair[0].name],
560
+ holders[pair[1].name],
561
+ side === SwapSide.SELL
562
+ ? pair[1].sellAmount
563
+ : pair[1].buyAmount,
564
+ side,
565
+ dexKey,
566
+ contractMethod,
567
+ network,
568
+ provider,
569
+ );
570
+ });
571
+ });
572
+ });
573
+ });
574
+ }),
575
+ );
576
+ });
577
+
578
+ describe('CanarySwap', () => {
579
+ const dexKey = 'CanarySwap';
580
+
581
+ describe('simpleSwap', () => {
582
+ it('AVAX -> PNG', async () => {
583
+ await testE2E(
584
+ tokens.AVAX,
585
+ tokens.PNG,
586
+ holders.AVAX,
587
+ '300000000000000000',
588
+ SwapSide.SELL,
589
+ dexKey,
590
+ ContractMethod.simpleSwap,
591
+ network,
592
+ provider,
593
+ );
594
+ });
595
+
596
+ it('PNG -> AVAX', async () => {
597
+ await testE2E(
598
+ tokens.PNG,
599
+ tokens.AVAX,
600
+ holders.PNG,
601
+ '3000000000000000000',
602
+ SwapSide.SELL,
603
+ dexKey,
604
+ ContractMethod.simpleSwap,
605
+ network,
606
+ provider,
607
+ );
608
+ });
609
+
610
+ it('WAVAX -> PNG', async () => {
611
+ await testE2E(
612
+ tokens.WAVAX,
613
+ tokens.PNG,
614
+ holders.WAVAX,
615
+ '100000000000000000',
616
+ SwapSide.SELL,
617
+ dexKey,
618
+ ContractMethod.simpleSwap,
619
+ network,
620
+ provider,
621
+ );
622
+ });
623
+ });
624
+
625
+ describe('multiSwap', () => {
626
+ it('AVAX -> PNG', async () => {
627
+ await testE2E(
628
+ tokens.AVAX,
629
+ tokens.PNG,
630
+ holders.AVAX,
631
+ '30000000000000000',
632
+ SwapSide.SELL,
633
+ dexKey,
634
+ ContractMethod.multiSwap,
635
+ network,
636
+ provider,
637
+ );
638
+ });
639
+
640
+ it('PNG -> AVAX', async () => {
641
+ await testE2E(
642
+ tokens.PNG,
643
+ tokens.AVAX,
644
+ holders.PNG,
645
+ '3000000000000000000',
646
+ SwapSide.SELL,
647
+ dexKey,
648
+ ContractMethod.multiSwap,
649
+ network,
650
+ provider,
651
+ );
652
+ });
653
+
654
+ it('WAVAX -> PNG', async () => {
655
+ await testE2E(
656
+ tokens.WAVAX,
657
+ tokens.PNG,
658
+ holders.WAVAX,
659
+ '700000000000000000',
660
+ SwapSide.SELL,
661
+ dexKey,
662
+ ContractMethod.multiSwap,
663
+ network,
664
+ provider,
665
+ );
666
+ });
667
+ });
668
+
669
+ describe('megaSwap', () => {
670
+ it('AVAX -> PNG', async () => {
671
+ await testE2E(
672
+ tokens.AVAX,
673
+ tokens.PNG,
674
+ holders.AVAX,
675
+ '300000000000000000',
676
+ SwapSide.SELL,
677
+ dexKey,
678
+ ContractMethod.megaSwap,
679
+ network,
680
+ provider,
681
+ );
682
+ });
683
+
684
+ it('PNG -> AVAX', async () => {
685
+ await testE2E(
686
+ tokens.PNG,
687
+ tokens.AVAX,
688
+ holders.PNG,
689
+ '3000000000000000000',
690
+ SwapSide.SELL,
691
+ dexKey,
692
+ ContractMethod.megaSwap,
693
+ network,
694
+ provider,
695
+ );
696
+ });
697
+
698
+ it('WAVAX -> PNG', async () => {
699
+ await testE2E(
700
+ tokens.WAVAX,
701
+ tokens.PNG,
702
+ holders.WAVAX,
703
+ '700000000000000000',
704
+ SwapSide.SELL,
705
+ dexKey,
706
+ ContractMethod.megaSwap,
707
+ network,
708
+ provider,
709
+ );
710
+ });
711
+ });
712
+ });
713
+
714
+ describe('Baguette', () => {
715
+ const dexKey = 'Baguette';
716
+
717
+ describe('simpleSwap', () => {
718
+ it('AVAX -> USDTe', async () => {
719
+ await testE2E(
720
+ tokens.AVAX,
721
+ tokens.USDTe,
722
+ holders.AVAX,
723
+ '100000000000000000',
724
+ SwapSide.SELL,
725
+ dexKey,
726
+ ContractMethod.simpleSwap,
727
+ network,
728
+ provider,
729
+ );
730
+ });
731
+
732
+ it('USDTe -> AVAX', async () => {
733
+ await testE2E(
734
+ tokens.USDTe,
735
+ tokens.AVAX,
736
+ holders.USDTe,
737
+ '100000000',
738
+ SwapSide.SELL,
739
+ dexKey,
740
+ ContractMethod.simpleSwap,
741
+ network,
742
+ provider,
743
+ );
744
+ });
745
+
746
+ it('WAVAX -> USDTe', async () => {
747
+ await testE2E(
748
+ tokens.WAVAX,
749
+ tokens.USDTe,
750
+ holders.WAVAX,
751
+ '7000000000000000000',
752
+ SwapSide.SELL,
753
+ dexKey,
754
+ ContractMethod.simpleSwap,
755
+ network,
756
+ provider,
757
+ );
758
+ });
759
+ });
760
+
761
+ describe('multiSwap', () => {
762
+ it('AVAX -> USDTe', async () => {
763
+ await testE2E(
764
+ tokens.AVAX,
765
+ tokens.USDTe,
766
+ holders.AVAX,
767
+ '7000000000000000000',
768
+ SwapSide.SELL,
769
+ dexKey,
770
+ ContractMethod.multiSwap,
771
+ network,
772
+ provider,
773
+ );
774
+ });
775
+
776
+ it('USDTe -> AVAX', async () => {
777
+ await testE2E(
778
+ tokens.USDTe,
779
+ tokens.AVAX,
780
+ holders.USDTe,
781
+ '10000000',
782
+ SwapSide.SELL,
783
+ dexKey,
784
+ ContractMethod.multiSwap,
785
+ network,
786
+ provider,
787
+ );
788
+ });
789
+
790
+ it('WAVAX -> USDTe', async () => {
791
+ await testE2E(
792
+ tokens.WAVAX,
793
+ tokens.USDTe,
794
+ holders.WAVAX,
795
+ '7000000000000000000',
796
+ SwapSide.SELL,
797
+ dexKey,
798
+ ContractMethod.multiSwap,
799
+ network,
800
+ provider,
801
+ );
802
+ });
803
+ });
804
+
805
+ describe('megaSwap', () => {
806
+ it('AVAX -> USDTe', async () => {
807
+ await testE2E(
808
+ tokens.AVAX,
809
+ tokens.USDTe,
810
+ holders.AVAX,
811
+ '7000000000000000000',
812
+ SwapSide.SELL,
813
+ dexKey,
814
+ ContractMethod.megaSwap,
815
+ network,
816
+ provider,
817
+ );
818
+ });
819
+
820
+ it('USDTe -> AVAX', async () => {
821
+ await testE2E(
822
+ tokens.USDTe,
823
+ tokens.AVAX,
824
+ holders.USDTe,
825
+ '10000000',
826
+ SwapSide.SELL,
827
+ dexKey,
828
+ ContractMethod.megaSwap,
829
+ network,
830
+ provider,
831
+ );
832
+ });
833
+
834
+ it('WAVAX -> USDTe', async () => {
835
+ await testE2E(
836
+ tokens.WAVAX,
837
+ tokens.USDTe,
838
+ holders.WAVAX,
839
+ '7000000000000000000',
840
+ SwapSide.SELL,
841
+ dexKey,
842
+ ContractMethod.megaSwap,
843
+ network,
844
+ provider,
845
+ );
846
+ });
847
+ });
848
+ });
849
+
850
+ describe('ComplusSwap', () => {
851
+ const dexKey = 'ComplusSwap';
852
+
853
+ describe('simpleSwap', () => {
854
+ it('AVAX -> USDT', async () => {
855
+ await testE2E(
856
+ tokens.AVAX,
857
+ tokens.USDT,
858
+ holders.AVAX,
859
+ '7000000000000000000',
860
+ SwapSide.SELL,
861
+ dexKey,
862
+ ContractMethod.simpleSwap,
863
+ network,
864
+ provider,
865
+ );
866
+ });
867
+
868
+ it('ETH -> AVAX', async () => {
869
+ await testE2E(
870
+ tokens.ETH,
871
+ tokens.AVAX,
872
+ holders.ETH,
873
+ '1000000000000000',
874
+ SwapSide.SELL,
875
+ dexKey,
876
+ ContractMethod.simpleSwap,
877
+ network,
878
+ provider,
879
+ );
880
+ });
881
+
882
+ it('WAVAX -> USDT', async () => {
883
+ await testE2E(
884
+ tokens.WAVAX,
885
+ tokens.USDT,
886
+ holders.WAVAX,
887
+ '7000000000000000000',
888
+ SwapSide.SELL,
889
+ dexKey,
890
+ ContractMethod.simpleSwap,
891
+ network,
892
+ provider,
893
+ );
894
+ });
895
+ });
896
+
897
+ describe('multiSwap', () => {
898
+ it('AVAX -> USDT', async () => {
899
+ await testE2E(
900
+ tokens.AVAX,
901
+ tokens.USDT,
902
+ holders.AVAX,
903
+ '7000000000000000000',
904
+ SwapSide.SELL,
905
+ dexKey,
906
+ ContractMethod.multiSwap,
907
+ network,
908
+ provider,
909
+ );
910
+ });
911
+
912
+ it('ETH -> AVAX', async () => {
913
+ await testE2E(
914
+ tokens.ETH,
915
+ tokens.AVAX,
916
+ holders.ETH,
917
+ '10000000000000',
918
+ SwapSide.SELL,
919
+ dexKey,
920
+ ContractMethod.multiSwap,
921
+ network,
922
+ provider,
923
+ );
924
+ });
925
+
926
+ it('WAVAX -> USDT', async () => {
927
+ await testE2E(
928
+ tokens.WAVAX,
929
+ tokens.USDT,
930
+ holders.WAVAX,
931
+ '7000000000000000000',
932
+ SwapSide.SELL,
933
+ dexKey,
934
+ ContractMethod.multiSwap,
935
+ network,
936
+ provider,
937
+ );
938
+ });
939
+ });
940
+
941
+ describe('megaSwap', () => {
942
+ it('AVAX -> USDT', async () => {
943
+ await testE2E(
944
+ tokens.AVAX,
945
+ tokens.USDT,
946
+ holders.AVAX,
947
+ '7000000000000000000',
948
+ SwapSide.SELL,
949
+ dexKey,
950
+ ContractMethod.megaSwap,
951
+ network,
952
+ provider,
953
+ );
954
+ });
955
+
956
+ it('ETH -> AVAX', async () => {
957
+ await testE2E(
958
+ tokens.ETH,
959
+ tokens.AVAX,
960
+ holders.ETH,
961
+ '100000000000000',
962
+ SwapSide.SELL,
963
+ dexKey,
964
+ ContractMethod.megaSwap,
965
+ network,
966
+ provider,
967
+ );
968
+ });
969
+
970
+ it('WAVAX -> USDT', async () => {
971
+ await testE2E(
972
+ tokens.WAVAX,
973
+ tokens.USDT,
974
+ holders.WAVAX,
975
+ '7000000000000000000',
976
+ SwapSide.SELL,
977
+ dexKey,
978
+ ContractMethod.megaSwap,
979
+ network,
980
+ provider,
981
+ );
982
+ });
983
+ });
984
+ });
985
+
986
+ describe('ElkFinance', () => {
987
+ const dexKey = 'ElkFinance';
988
+
989
+ describe('simpleSwap', () => {
990
+ it('AVAX -> ETH', async () => {
991
+ await testE2E(
992
+ tokens.AVAX,
993
+ tokens.ETH,
994
+ holders.AVAX,
995
+ '3000000000000000000',
996
+ SwapSide.SELL,
997
+ dexKey,
998
+ ContractMethod.simpleSwap,
999
+ network,
1000
+ provider,
1001
+ );
1002
+ });
1003
+
1004
+ it('ETH -> AVAX', async () => {
1005
+ await testE2E(
1006
+ tokens.ETH,
1007
+ tokens.AVAX,
1008
+ holders.ETH,
1009
+ '30000000000000000',
1010
+ SwapSide.SELL,
1011
+ dexKey,
1012
+ ContractMethod.simpleSwap,
1013
+ network,
1014
+ provider,
1015
+ );
1016
+ });
1017
+
1018
+ it('WAVAX -> USDT', async () => {
1019
+ await testE2E(
1020
+ tokens.WAVAX,
1021
+ tokens.USDT,
1022
+ holders.WAVAX,
1023
+ '300000000000000000',
1024
+ SwapSide.SELL,
1025
+ dexKey,
1026
+ ContractMethod.simpleSwap,
1027
+ network,
1028
+ provider,
1029
+ );
1030
+ });
1031
+ });
1032
+
1033
+ describe('multiSwap', () => {
1034
+ it('AVAX -> ETH', async () => {
1035
+ await testE2E(
1036
+ tokens.AVAX,
1037
+ tokens.ETH,
1038
+ holders.AVAX,
1039
+ '3000000000000000000',
1040
+ SwapSide.SELL,
1041
+ dexKey,
1042
+ ContractMethod.multiSwap,
1043
+ network,
1044
+ provider,
1045
+ );
1046
+ });
1047
+
1048
+ it('ETH -> AVAX', async () => {
1049
+ await testE2E(
1050
+ tokens.ETH,
1051
+ tokens.AVAX,
1052
+ holders.ETH,
1053
+ '30000000000000000',
1054
+ SwapSide.SELL,
1055
+ dexKey,
1056
+ ContractMethod.multiSwap,
1057
+ network,
1058
+ provider,
1059
+ );
1060
+ });
1061
+
1062
+ it('WAVAX -> USDT', async () => {
1063
+ await testE2E(
1064
+ tokens.WAVAX,
1065
+ tokens.USDT,
1066
+ holders.WAVAX,
1067
+ '300000000000000000',
1068
+ SwapSide.SELL,
1069
+ dexKey,
1070
+ ContractMethod.multiSwap,
1071
+ network,
1072
+ provider,
1073
+ );
1074
+ });
1075
+ });
1076
+
1077
+ describe('megaSwap', () => {
1078
+ it('AVAX -> ETH', async () => {
1079
+ await testE2E(
1080
+ tokens.AVAX,
1081
+ tokens.ETH,
1082
+ holders.AVAX,
1083
+ '3000000000000000000',
1084
+ SwapSide.SELL,
1085
+ dexKey,
1086
+ ContractMethod.megaSwap,
1087
+ network,
1088
+ provider,
1089
+ );
1090
+ });
1091
+
1092
+ it('ETH -> AVAX', async () => {
1093
+ await testE2E(
1094
+ tokens.ETH,
1095
+ tokens.AVAX,
1096
+ holders.ETH,
1097
+ '30000000000000000',
1098
+ SwapSide.SELL,
1099
+ dexKey,
1100
+ ContractMethod.megaSwap,
1101
+ network,
1102
+ provider,
1103
+ );
1104
+ });
1105
+
1106
+ it('WAVAX -> USDT', async () => {
1107
+ await testE2E(
1108
+ tokens.WAVAX,
1109
+ tokens.USDT,
1110
+ holders.WAVAX,
1111
+ '300000000000000000',
1112
+ SwapSide.SELL,
1113
+ dexKey,
1114
+ ContractMethod.megaSwap,
1115
+ network,
1116
+ provider,
1117
+ );
1118
+ });
1119
+ });
1120
+ });
1121
+
1122
+ describe('YetiSwap', () => {
1123
+ const dexKey = 'YetiSwap';
1124
+
1125
+ describe('simpleSwap', () => {
1126
+ it('AVAX -> ETH', async () => {
1127
+ await testE2E(
1128
+ tokens.AVAX,
1129
+ tokens.ETH,
1130
+ holders.AVAX,
1131
+ '3000000000000000000',
1132
+ SwapSide.SELL,
1133
+ dexKey,
1134
+ ContractMethod.simpleSwap,
1135
+ network,
1136
+ provider,
1137
+ );
1138
+ });
1139
+
1140
+ it('ETH -> AVAX', async () => {
1141
+ await testE2E(
1142
+ tokens.ETH,
1143
+ tokens.AVAX,
1144
+ holders.ETH,
1145
+ '30000000000000000',
1146
+ SwapSide.SELL,
1147
+ dexKey,
1148
+ ContractMethod.simpleSwap,
1149
+ network,
1150
+ provider,
1151
+ );
1152
+ });
1153
+
1154
+ it('WAVAX -> USDTe', async () => {
1155
+ await testE2E(
1156
+ tokens.WAVAX,
1157
+ tokens.USDTe,
1158
+ holders.WAVAX,
1159
+ '3000000000000000000',
1160
+ SwapSide.SELL,
1161
+ dexKey,
1162
+ ContractMethod.simpleSwap,
1163
+ network,
1164
+ provider,
1165
+ );
1166
+ });
1167
+ });
1168
+
1169
+ describe('multiSwap', () => {
1170
+ it('AVAX -> ETH', async () => {
1171
+ await testE2E(
1172
+ tokens.AVAX,
1173
+ tokens.ETH,
1174
+ holders.AVAX,
1175
+ '3000000000000000000',
1176
+ SwapSide.SELL,
1177
+ dexKey,
1178
+ ContractMethod.multiSwap,
1179
+ network,
1180
+ provider,
1181
+ );
1182
+ });
1183
+
1184
+ it('ETH -> AVAX', async () => {
1185
+ await testE2E(
1186
+ tokens.ETH,
1187
+ tokens.AVAX,
1188
+ holders.ETH,
1189
+ '30000000000000000',
1190
+ SwapSide.SELL,
1191
+ dexKey,
1192
+ ContractMethod.multiSwap,
1193
+ network,
1194
+ provider,
1195
+ );
1196
+ });
1197
+
1198
+ it('WAVAX -> USDTe', async () => {
1199
+ await testE2E(
1200
+ tokens.WAVAX,
1201
+ tokens.USDTe,
1202
+ holders.WAVAX,
1203
+ '3000000000000000000',
1204
+ SwapSide.SELL,
1205
+ dexKey,
1206
+ ContractMethod.multiSwap,
1207
+ network,
1208
+ provider,
1209
+ );
1210
+ });
1211
+ });
1212
+
1213
+ describe('megaSwap', () => {
1214
+ it('AVAX -> ETH', async () => {
1215
+ await testE2E(
1216
+ tokens.AVAX,
1217
+ tokens.ETH,
1218
+ holders.AVAX,
1219
+ '3000000000000000000',
1220
+ SwapSide.SELL,
1221
+ dexKey,
1222
+ ContractMethod.megaSwap,
1223
+ network,
1224
+ provider,
1225
+ );
1226
+ });
1227
+
1228
+ it('ETH -> AVAX', async () => {
1229
+ await testE2E(
1230
+ tokens.ETH,
1231
+ tokens.AVAX,
1232
+ holders.ETH,
1233
+ '30000000000000000',
1234
+ SwapSide.SELL,
1235
+ dexKey,
1236
+ ContractMethod.megaSwap,
1237
+ network,
1238
+ provider,
1239
+ );
1240
+ });
1241
+
1242
+ it('WAVAX -> USDTe', async () => {
1243
+ await testE2E(
1244
+ tokens.WAVAX,
1245
+ tokens.USDTe,
1246
+ holders.WAVAX,
1247
+ '3000000000000000000',
1248
+ SwapSide.SELL,
1249
+ dexKey,
1250
+ ContractMethod.megaSwap,
1251
+ network,
1252
+ provider,
1253
+ );
1254
+ });
1255
+ });
1256
+ });
1257
+ });