@paraswap/dex-lib 2.16.3-merge-rfq.1 → 2.16.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.
Files changed (65) hide show
  1. package/build/abi/DirectSwap.json +970 -0
  2. package/build/config.js +2 -2
  3. package/build/dex/aave-v3/tokens/arbitrum.json +20 -20
  4. package/build/dex/aave-v3/tokens/avalanche.json +44 -20
  5. package/build/dex/aave-v3/tokens/fantom.json +30 -30
  6. package/build/dex/aave-v3/tokens/optimism.json +18 -18
  7. package/build/dex/aave-v3/tokens/polygon.json +60 -42
  8. package/build/dex/generic-rfq/generic-rfq.js +1 -3
  9. package/build/dex/generic-rfq/generic-rfq.js.map +1 -1
  10. package/build/dex/index.js +2 -0
  11. package/build/dex/index.js.map +1 -1
  12. package/build/dex/maverick-v1/config.js +1 -1
  13. package/build/dex/maverick-v1/config.js.map +1 -1
  14. package/build/dex/paraswap-limit-orders/paraswap-limit-orders.js +1 -5
  15. package/build/dex/paraswap-limit-orders/paraswap-limit-orders.js.map +1 -1
  16. package/build/dex/paraswap-limit-orders/types.d.ts +0 -1
  17. package/build/dex/quickswap/config.js +8 -0
  18. package/build/dex/quickswap/config.js.map +1 -1
  19. package/build/dex/quickswap/spiritswap-v3.d.ts +6 -0
  20. package/build/dex/quickswap/spiritswap-v3.js +19 -0
  21. package/build/dex/quickswap/spiritswap-v3.js.map +1 -0
  22. package/build/dex/{test-aave-v3 → test-dex}/config.d.ts +1 -1
  23. package/build/dex/{test-aave-v3 → test-dex}/config.js +3 -3
  24. package/build/dex/test-dex/config.js.map +1 -0
  25. package/build/dex/{test-aave-v3/test-aave-v3-pool.d.ts → test-dex/test-dex-pool.d.ts} +3 -3
  26. package/build/dex/{test-aave-v3/test-aave-v3-pool.js → test-dex/test-dex-pool.js} +7 -7
  27. package/build/dex/test-dex/test-dex-pool.js.map +1 -0
  28. package/build/dex/{test-aave-v3/test-aave-v3.d.ts → test-dex/test-dex.d.ts} +8 -8
  29. package/build/dex/{test-aave-v3/test-aave-v3.js → test-dex/test-dex.js} +7 -7
  30. package/build/dex/test-dex/test-dex.js.map +1 -0
  31. package/build/dex/{test-aave-v3 → test-dex}/types.d.ts +1 -1
  32. package/build/dex/{test-aave-v3 → test-dex}/types.js.map +1 -1
  33. package/build/dex/uniswap-v3/config.js +4 -0
  34. package/build/dex/uniswap-v3/config.js.map +1 -1
  35. package/build/dex/woo-fi-v2/woo-fi-math.d.ts +16 -0
  36. package/build/dex/woo-fi-v2/woo-fi-math.js +137 -0
  37. package/build/dex/woo-fi-v2/woo-fi-math.js.map +1 -0
  38. package/package.json +1 -1
  39. package/src/config.ts +2 -2
  40. package/src/dex/generic-rfq/generic-rfq.ts +1 -3
  41. package/src/dex/index.ts +2 -0
  42. package/src/dex/maverick-v1/config.ts +1 -1
  43. package/src/dex/paraswap-limit-orders/paraswap-limit-orders.ts +1 -5
  44. package/src/dex/paraswap-limit-orders/types.ts +0 -1
  45. package/src/dex/quickswap/config.ts +9 -0
  46. package/src/dex/quickswap/quickswap-e2e.test.ts +94 -0
  47. package/src/dex/quickswap/spiritswap-v3.ts +19 -0
  48. package/src/dex/uniswap-v3/config.ts +4 -0
  49. package/tests/constants-e2e.ts +2 -2
  50. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  51. package/.idea/misc.xml +0 -6
  52. package/.idea/modules.xml +0 -8
  53. package/.idea/vcs.xml +0 -6
  54. package/.vscode/launch.json +0 -21
  55. package/build/abi/AugustusRFQRouter.abi.json +0 -1248
  56. package/build/dex/aave-v3/tokens/mainnet.json +0 -44
  57. package/build/dex/balancer-v2/VirtualBoostedPool.d.ts +0 -79
  58. package/build/dex/balancer-v2/VirtualBoostedPool.js +0 -382
  59. package/build/dex/balancer-v2/VirtualBoostedPool.js.map +0 -1
  60. package/build/dex/test-aave-v3/config.js.map +0 -1
  61. package/build/dex/test-aave-v3/test-aave-v3-pool.js.map +0 -1
  62. package/build/dex/test-aave-v3/test-aave-v3.js.map +0 -1
  63. package/compare-quotes.ts +0 -12
  64. package/fetch-rfq-quotes.ts +0 -146
  65. /package/build/dex/{test-aave-v3 → test-dex}/types.js +0 -0
@@ -354,4 +354,98 @@ describe('QuickSwap', () => {
354
354
  });
355
355
  });
356
356
  });
357
+
358
+ describe('Fantom', () => {
359
+ const network = Network.FANTOM;
360
+ const tokens = Tokens[network];
361
+ const holders = Holders[network];
362
+ const provider = new StaticJsonRpcProvider(
363
+ generateConfig(network).privateHttpProvider,
364
+ network,
365
+ );
366
+ describe('SpiritSwapV3', () => {
367
+ const dexKey = 'SpiritSwapV3';
368
+
369
+ const sideToContractMethods = new Map([
370
+ [
371
+ SwapSide.SELL,
372
+ [
373
+ ContractMethod.simpleSwap,
374
+ ContractMethod.multiSwap,
375
+ ContractMethod.megaSwap,
376
+ ],
377
+ ],
378
+ [SwapSide.BUY, [ContractMethod.simpleBuy, ContractMethod.buy]],
379
+ ]);
380
+
381
+ const pairs: { name: string; sellAmount: string; buyAmount: string }[][] =
382
+ [
383
+ [
384
+ {
385
+ name: 'USDC',
386
+ sellAmount: '100',
387
+ buyAmount: '10000000000000000',
388
+ },
389
+ {
390
+ name: 'WFTM',
391
+ sellAmount: '10000000000000000',
392
+ buyAmount: '100',
393
+ },
394
+ ],
395
+ [
396
+ {
397
+ name: 'FTM',
398
+ sellAmount: '1000000000000000',
399
+ buyAmount: '100',
400
+ },
401
+ {
402
+ name: 'USDC',
403
+ sellAmount: '100',
404
+ buyAmount: '10000000000000000',
405
+ },
406
+ ],
407
+ ];
408
+
409
+ sideToContractMethods.forEach((contractMethods, side) =>
410
+ describe(`${side}`, () => {
411
+ contractMethods.forEach((contractMethod: ContractMethod) => {
412
+ pairs.forEach(pair => {
413
+ describe(`${contractMethod}`, () => {
414
+ it(`${pair[0].name} -> ${pair[1].name}`, async () => {
415
+ await testE2E(
416
+ tokens[pair[0].name],
417
+ tokens[pair[1].name],
418
+ holders[pair[0].name],
419
+ side === SwapSide.SELL
420
+ ? pair[0].sellAmount
421
+ : pair[0].buyAmount,
422
+ side,
423
+ dexKey,
424
+ contractMethod,
425
+ network,
426
+ provider,
427
+ );
428
+ });
429
+ it(`${pair[1].name} -> ${pair[0].name}`, async () => {
430
+ await testE2E(
431
+ tokens[pair[1].name],
432
+ tokens[pair[0].name],
433
+ holders[pair[1].name],
434
+ side === SwapSide.SELL
435
+ ? pair[1].sellAmount
436
+ : pair[1].buyAmount,
437
+ side,
438
+ dexKey,
439
+ contractMethod,
440
+ network,
441
+ provider,
442
+ );
443
+ });
444
+ });
445
+ });
446
+ });
447
+ }),
448
+ );
449
+ });
450
+ });
357
451
  });
@@ -0,0 +1,19 @@
1
+ import { IDexHelper } from '../../dex-helper';
2
+ import _ from 'lodash';
3
+ import { QuickSwapConfig } from './config';
4
+ import { QuickSwapV3 } from './quickswap-v3';
5
+
6
+ const config = _.pick(QuickSwapConfig, ['SpiritSwapV3']).SpiritSwapV3;
7
+
8
+ export class SpiritSwapV3 extends QuickSwapV3 {
9
+ static dexKeys = ['spiritswapv3'];
10
+
11
+ // public static dexKeysWithNetwork
12
+ constructor(dexHelper: IDexHelper) {
13
+ super(
14
+ dexHelper,
15
+ 'spiritswapv3',
16
+ config[dexHelper.config.data.network].router,
17
+ );
18
+ }
19
+ }
@@ -141,4 +141,8 @@ export const Adapters: Record<number, AdapterMappings> = {
141
141
  [SwapSide.SELL]: [{ name: 'OptimismAdapter01', index: 3 }],
142
142
  [SwapSide.BUY]: [{ name: 'OptimismBuyAdapter', index: 2 }],
143
143
  },
144
+ [Network.FANTOM]: {
145
+ [SwapSide.SELL]: [{ name: 'FantomAdapter01', index: 11 }],
146
+ [SwapSide.BUY]: [{ name: 'FantomBuyAdapter', index: 3 }],
147
+ },
144
148
  };
@@ -904,7 +904,7 @@ export const Holders: {
904
904
  [Network.FANTOM]: {
905
905
  DAI: '0x370f4b2dcf75c94d8d4450b493661a9c6170d0b5',
906
906
  FTM: '0x431e81E5dfB5A24541b5Ff8762bDEF3f32F96354',
907
- WFTM: '0x431e81E5dfB5A24541b5Ff8762bDEF3f32F96354',
907
+ WFTM: '0x3e923747ca2675e096d812c3b24846ac39aed645',
908
908
  USDC: '0xe48793b1533b351ae184e1c3119d0955dde7b330',
909
909
  FUSDT: '0x9ade1c17d25246c405604344f89E8F23F8c1c632',
910
910
  POPS: '0x4b78b52e7de4d8b7d367297cb8a87c1875a9d591',
@@ -913,7 +913,7 @@ export const Holders: {
913
913
  MIM: '0xbcab7d083cf6a01e0dda9ed7f8a02b47d125e682',
914
914
  FRAX: '0x4423ac71f53ca92e2f2be5917a9c2468e7412f4a',
915
915
  nETH: '0x16b658270ac50c0063940ed287c401b3df7ccf70',
916
- WETH: '0x4ad64fd7ca6d6150614179b9bce4094bc18f29cb',
916
+ WETH: '0x7b7b957c284c2c227c980d6e2f804311947b84d0',
917
917
  SPIRIT: '0x0d0707963952f2fba59dd06f2b425ace40b492fe',
918
918
  wBOMB: '0x28aa4f9ffe21365473b64c161b566c3cdead0108',
919
919
  TOR: '0x70de4b5ed310fd93da3c0bae824fb99cb4d44dd8',
@@ -1,5 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <state>
3
- <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
4
- </state>
5
- </component>
package/.idea/misc.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager">
4
- <output url="file://$PROJECT_DIR$/out" />
5
- </component>
6
- </project>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/paraswap-dex-lib.iml" filepath="$PROJECT_DIR$/paraswap-dex-lib.iml" />
6
- </modules>
7
- </component>
8
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>
@@ -1,21 +0,0 @@
1
- {
2
- // Use IntelliSense to learn about possible attributes.
3
- // Hover to view descriptions of existing attributes.
4
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
- "version": "0.2.0",
6
- "configurations": [
7
- {
8
- "type": "node",
9
- "request": "launch",
10
- "name": "Launch Program",
11
- "skipFiles": [
12
- "<node_internals>/**"
13
- ],
14
- "program": "${workspaceFolder}/build/index.js",
15
- "preLaunchTask": "tsc: build - tsconfig.json",
16
- "outFiles": [
17
- "${workspaceFolder}/build/**/*.js"
18
- ]
19
- }
20
- ]
21
- }