@paraswap/dex-lib 2.13.1 → 2.14.1

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 (56) hide show
  1. package/build/dex/curve-v1/config.js +0 -2
  2. package/build/dex/curve-v1/config.js.map +1 -1
  3. package/build/dex/curve-v1/curve-v1.js +0 -2
  4. package/build/dex/curve-v1/curve-v1.js.map +1 -1
  5. package/build/dex/curve-v1/types.d.ts +0 -1
  6. package/build/dex/curve-v1/types.js.map +1 -1
  7. package/build/dex/generic-rfq/rate-fetcher.js +0 -2
  8. package/build/dex/generic-rfq/rate-fetcher.js.map +1 -1
  9. package/build/dex/generic-rfq/validators.d.ts +1 -1
  10. package/build/dex/generic-rfq/validators.js +26 -36
  11. package/build/dex/generic-rfq/validators.js.map +1 -1
  12. package/build/lib/fetcher/fetcher.js +0 -3
  13. package/build/lib/fetcher/fetcher.js.map +1 -1
  14. package/package.json +1 -1
  15. package/src/dex/curve-v1/config.ts +0 -2
  16. package/src/dex/curve-v1/curve-v1-e2e.test.ts +37 -18
  17. package/src/dex/curve-v1/curve-v1.ts +0 -2
  18. package/src/dex/curve-v1/types.ts +0 -1
  19. package/src/dex/generic-rfq/generic-rfq-e2e.test.ts +258 -63
  20. package/src/dex/generic-rfq/rate-fetcher.ts +0 -2
  21. package/src/dex/generic-rfq/validators.test.ts +32 -6
  22. package/src/dex/generic-rfq/validators.ts +32 -57
  23. package/src/lib/fetcher/fetcher.ts +0 -6
  24. package/tests/constants-e2e.ts +6 -3
  25. package/tests/utils-e2e.ts +48 -59
  26. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  27. package/.idea/misc.xml +0 -6
  28. package/.idea/modules.xml +0 -8
  29. package/.idea/vcs.xml +0 -6
  30. package/.vscode/launch.json +0 -21
  31. package/build/dex/aave-v3/tokens/arbitrum.json +0 -50
  32. package/build/dex/aave-v3/tokens/avalanche.json +0 -50
  33. package/build/dex/aave-v3/tokens/fantom.json +0 -62
  34. package/build/dex/aave-v3/tokens/mainnet.json +0 -44
  35. package/build/dex/aave-v3/tokens/optimism.json +0 -50
  36. package/build/dex/aave-v3/tokens/polygon.json +0 -98
  37. package/build/dex/balancer-v2/VirtualBoostedPool.d.ts +0 -79
  38. package/build/dex/balancer-v2/VirtualBoostedPool.js +0 -382
  39. package/build/dex/balancer-v2/VirtualBoostedPool.js.map +0 -1
  40. package/build/dex/generic-rfq/e2e-test-config.d.ts +0 -9
  41. package/build/dex/generic-rfq/e2e-test-config.js +0 -33
  42. package/build/dex/generic-rfq/e2e-test-config.js.map +0 -1
  43. package/build/dex/test-aave-v3/config.d.ts +0 -4
  44. package/build/dex/test-aave-v3/config.js +0 -15
  45. package/build/dex/test-aave-v3/config.js.map +0 -1
  46. package/build/dex/test-aave-v3/test-aave-v3-pool.d.ts +0 -39
  47. package/build/dex/test-aave-v3/test-aave-v3-pool.js +0 -63
  48. package/build/dex/test-aave-v3/test-aave-v3-pool.js.map +0 -1
  49. package/build/dex/test-aave-v3/test-aave-v3.d.ts +0 -37
  50. package/build/dex/test-aave-v3/test-aave-v3.js +0 -126
  51. package/build/dex/test-aave-v3/test-aave-v3.js.map +0 -1
  52. package/build/dex/test-aave-v3/types.d.ts +0 -6
  53. package/build/dex/test-aave-v3/types.js +0 -3
  54. package/build/dex/test-aave-v3/types.js.map +0 -1
  55. package/src/dex/generic-rfq/e2e-test-config.ts +0 -37
  56. package/src/dex/generic-rfq/generic-rfq-local-e2e.test.ts +0 -121
@@ -299,7 +299,6 @@ export type TestParamE2E = {
299
299
  destTokenBalanceOverrides?: Record<Address, string>;
300
300
  destTokenAllowanceOverrides?: Record<Address, string>;
301
301
  sleepMs?: number;
302
- skipTenderly?: boolean;
303
302
  };
304
303
 
305
304
  const makeFakeTransferToSenderAddress = (
@@ -333,19 +332,14 @@ export async function newTestE2E({
333
332
  limitOrderProvider,
334
333
  transferFees,
335
334
  sleepMs,
336
- skipTenderly,
337
335
  }: TestParamE2E) {
338
- const useTenderly = !skipTenderly;
339
336
  const amount = BigInt(_amount);
340
337
  const twiceAmount = BigInt(_amount) * 2n;
341
- let ts: TenderlySimulation | undefined = undefined;
342
- if (useTenderly) {
343
- ts = new TenderlySimulation(network);
344
- await ts.setup();
345
- }
338
+ const ts = new TenderlySimulation(network);
339
+ await ts.setup();
346
340
 
347
- if (useTenderly && adapterBytecode) {
348
- const deployTx = await (ts as TenderlySimulation).simulate(
341
+ if (adapterBytecode) {
342
+ const deployTx = await ts.simulate(
349
343
  deployAdapterParams(adapterBytecode, network),
350
344
  );
351
345
 
@@ -360,13 +354,13 @@ export async function newTestE2E({
360
354
  'gas',
361
355
  );
362
356
 
363
- const whitelistTx = await (ts as TenderlySimulation).simulate(
357
+ const whitelistTx = await ts.simulate(
364
358
  whiteListAdapterParams(adapterAddress, network),
365
359
  );
366
360
  expect(whitelistTx.success).toEqual(true);
367
361
  }
368
362
 
369
- if (useTenderly && thirdPartyAddress) {
363
+ if (thirdPartyAddress) {
370
364
  const stateOverrides: StateOverrides = {
371
365
  networkID: `${network}`,
372
366
  stateOverrides: {},
@@ -383,15 +377,43 @@ export async function newTestE2E({
383
377
  : (BigInt(MAX_UINT) / 4n).toString(),
384
378
  );
385
379
 
386
- await (ts as TenderlySimulation).simulate(giftTx, stateOverrides);
380
+ await ts.simulate(giftTx, stateOverrides);
387
381
  }
388
382
 
383
+ const stateOverrides: StateOverrides = {
384
+ networkID: `${network}`,
385
+ stateOverrides: {},
386
+ };
387
+ srcToken.applyOverrides(stateOverrides);
388
+ destToken.applyOverrides(stateOverrides);
389
+
390
+ if (swapSide === SwapSide.SELL) {
391
+ srcToken
392
+ .addBalance(senderAddress, twiceAmount.toString())
393
+ .addAllowance(
394
+ senderAddress,
395
+ config.tokenTransferProxyAddress,
396
+ amount.toString(),
397
+ );
398
+ } else {
399
+ srcToken
400
+ .addBalance(senderAddress, MAX_UINT)
401
+ .addAllowance(
402
+ senderAddress,
403
+ config.tokenTransferProxyAddress,
404
+ (BigInt(MAX_UINT) / 8n).toString(),
405
+ );
406
+ }
407
+
408
+ srcToken.applyOverrides(stateOverrides);
409
+ destToken.applyOverrides(stateOverrides);
410
+
389
411
  const useAPI = testingEndpoint && !poolIdentifiers;
390
412
  // The API currently doesn't allow for specifying poolIdentifiers
391
413
  const paraswap: IParaSwapSDK = new LocalParaswapSDK(
392
414
  network,
393
415
  dexKey,
394
- '',
416
+ `https://rpc.tenderly.co/fork/${ts.forkId}`,
395
417
  limitOrderProvider,
396
418
  );
397
419
 
@@ -427,52 +449,19 @@ export async function newTestE2E({
427
449
  senderAddress,
428
450
  );
429
451
 
430
- if (useTenderly) {
431
- const stateOverrides: StateOverrides = {
432
- networkID: `${network}`,
433
- stateOverrides: {},
434
- };
435
- srcToken.applyOverrides(stateOverrides);
436
- destToken.applyOverrides(stateOverrides);
437
-
438
- if (swapSide === SwapSide.SELL) {
439
- srcToken
440
- .addBalance(senderAddress, twiceAmount.toString())
441
- .addAllowance(
442
- senderAddress,
443
- config.tokenTransferProxyAddress,
444
- amount.toString(),
445
- );
446
- } else {
447
- srcToken
448
- .addBalance(senderAddress, MAX_UINT)
449
- .addAllowance(
450
- senderAddress,
451
- config.tokenTransferProxyAddress,
452
- (BigInt(MAX_UINT) / 8n).toString(),
453
- );
454
- }
455
-
456
- srcToken.applyOverrides(stateOverrides);
457
- destToken.applyOverrides(stateOverrides);
458
-
459
- const swapTx = await (ts as TenderlySimulation).simulate(
460
- swapParams,
461
- stateOverrides,
452
+ const swapTx = await ts.simulate(swapParams, stateOverrides);
453
+ console.log(`${srcToken.address}_${destToken.address}_${dexKey!}`);
454
+ // Only log gas estimate if testing against API
455
+ if (useAPI)
456
+ console.log(
457
+ `Gas Estimate API: ${priceRoute.gasCost}, Simulated: ${
458
+ swapTx!.gasUsed
459
+ }, Difference: ${
460
+ parseInt(priceRoute.gasCost) - parseInt(swapTx!.gasUsed)
461
+ }`,
462
462
  );
463
- console.log(`${srcToken.address}_${destToken.address}_${dexKey!}`);
464
- // Only log gas estimate if testing against API
465
- if (useAPI)
466
- console.log(
467
- `Gas Estimate API: ${priceRoute.gasCost}, Simulated: ${
468
- swapTx!.gasUsed
469
- }, Difference: ${
470
- parseInt(priceRoute.gasCost) - parseInt(swapTx!.gasUsed)
471
- }`,
472
- );
473
- console.log(`Tenderly URL: ${swapTx!.tenderlyUrl}`);
474
- expect(swapTx!.success).toEqual(true);
475
- }
463
+ console.log(`Tenderly URL: ${swapTx!.tenderlyUrl}`);
464
+ expect(swapTx!.success).toEqual(true);
476
465
  } finally {
477
466
  if (paraswap.releaseResources) {
478
467
  await paraswap.releaseResources();
@@ -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
- }
@@ -1,50 +0,0 @@
1
- [
2
- {
3
- "aSymbol": "aArbDAI",
4
- "aAddress": "0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE",
5
- "address": "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1",
6
- "decimals": 18
7
- },
8
- {
9
- "aSymbol": "aArbLINK",
10
- "aAddress": "0x191c10Aa4AF7C30e871E70C95dB0E4eb77237530",
11
- "address": "0xf97f4df75117a78c1a5a0dbb814af92458539fb4",
12
- "decimals": 18
13
- },
14
- {
15
- "aSymbol": "aArbUSDC",
16
- "aAddress": "0x625E7708f30cA75bfd92586e17077590C60eb4cD",
17
- "address": "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
18
- "decimals": 6
19
- },
20
- {
21
- "aSymbol": "aArbWBTC",
22
- "aAddress": "0x078f358208685046a11C85e8ad32895DED33A249",
23
- "address": "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f",
24
- "decimals": 8
25
- },
26
- {
27
- "aSymbol": "aArbWETH",
28
- "aAddress": "0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8",
29
- "address": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
30
- "decimals": 18
31
- },
32
- {
33
- "aSymbol": "aArbUSDT",
34
- "aAddress": "0x6ab707aca953edaefbc4fd23ba73294241490620",
35
- "address": "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
36
- "decimals": 6
37
- },
38
- {
39
- "aSymbol": "aArbAAVE",
40
- "aAddress": "0xf329e36C7bF6E5E86ce2150875a84Ce77f477375",
41
- "address": "0xba5ddd1f9d7f570dc94a51479a000e3bce967196",
42
- "decimals": 18
43
- },
44
- {
45
- "aSymbol": "aArbEURS",
46
- "aAddress": "0x6d80113e533a2C0fe82EaBD35f1875DcEA89Ea97",
47
- "address": "0xd22a58f79e9481d1a88e00c343885a588b34b68b",
48
- "decimals": 2
49
- }
50
- ]
@@ -1,50 +0,0 @@
1
- [
2
- {
3
- "aSymbol": "aWETH",
4
- "aAddress": "0xe50fa9b3c56ffb159cb0fca61f5c9d750e8128c8",
5
- "address": "0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab",
6
- "decimals": 18
7
- },
8
- {
9
- "aSymbol": "aDAI",
10
- "aAddress": "0x82e64f49ed5ec1bc6e43dad4fc8af9bb3a2312ee",
11
- "address": "0xd586e7f844cea2f87f50152665bcbc2c279d8d70",
12
- "decimals": 18
13
- },
14
- {
15
- "aSymbol": "aLINK",
16
- "aAddress": "0x191c10aa4af7c30e871e70c95db0e4eb77237530",
17
- "address": "0x5947bb275c521040051d82396192181b413227a3",
18
- "decimals": 18
19
- },
20
- {
21
- "aSymbol": "aUSDT",
22
- "aAddress": "0x6ab707aca953edaefbc4fd23ba73294241490620",
23
- "address": "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7",
24
- "decimals": 6
25
- },
26
- {
27
- "aSymbol": "aUSDC",
28
- "aAddress": "0x625e7708f30ca75bfd92586e17077590c60eb4cd",
29
- "address": "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
30
- "decimals": 6
31
- },
32
- {
33
- "aSymbol": "aAAVE",
34
- "aAddress": "0xf329e36c7bf6e5e86ce2150875a84ce77f477375",
35
- "address": "0x63a72806098bd3d9520cc43356dd78afe5d386d9",
36
- "decimals": 18
37
- },
38
- {
39
- "aSymbol": "aWBTC",
40
- "aAddress": "0x078f358208685046a11c85e8ad32895ded33a249",
41
- "address": "0x50b7545627a5162f82a992c33b87adc75187b218",
42
- "decimals": 8
43
- },
44
- {
45
- "aSymbol": "aWAVAX",
46
- "aAddress": "0x6d80113e533a2c0fe82eabd35f1875dcea89ea97",
47
- "address": "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7",
48
- "decimals": 18
49
- }
50
- ]
@@ -1,62 +0,0 @@
1
- [
2
- {
3
- "aSymbol": "aUSDT",
4
- "aAddress": "0x6ab707aca953edaefbc4fd23ba73294241490620",
5
- "address": "0x049d68029688eabf473097a2fc38ef61633a3c7a",
6
- "decimals": 6
7
- },
8
- {
9
- "aSymbol": "aWBTC",
10
- "aAddress": "0x078f358208685046a11c85e8ad32895ded33a249",
11
- "address": "0x321162cd933e2be498cd2267a90534a804051b11",
12
- "decimals": 8
13
- },
14
- {
15
- "aSymbol": "aWETH",
16
- "aAddress": "0xe50fa9b3c56ffb159cb0fca61f5c9d750e8128c8",
17
- "address": "0x74b23882a30290451a17c44f4f05243b6b58c76d",
18
- "decimals": 18
19
- },
20
- {
21
- "aSymbol": "aAAVE",
22
- "aAddress": "0xf329e36c7bf6e5e86ce2150875a84ce77f477375",
23
- "address": "0x6a07a792ab2965c72a5b8088d3a069a7ac3a993b",
24
- "decimals": 18
25
- },
26
- {
27
- "aSymbol": "aWFTM",
28
- "aAddress": "0x6d80113e533a2c0fe82eabd35f1875dcea89ea97",
29
- "address": "0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83",
30
- "decimals": 18
31
- },
32
- {
33
- "aSymbol": "aDAI",
34
- "aAddress": "0x82e64f49ed5ec1bc6e43dad4fc8af9bb3a2312ee",
35
- "address": "0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e",
36
- "decimals": 18
37
- },
38
- {
39
- "aSymbol": "aLINK",
40
- "aAddress": "0x191c10aa4af7c30e871e70c95db0e4eb77237530",
41
- "address": "0xb3654dc3d10ea7645f8319668e8f54d2574fbdc8",
42
- "decimals": 18
43
- },
44
- {
45
- "aSymbol": "aUSDC",
46
- "aAddress": "0x625e7708f30ca75bfd92586e17077590c60eb4cd",
47
- "address": "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
48
- "decimals": 6
49
- },
50
- {
51
- "aSymbol": "aCRV",
52
- "aAddress": "0x513c7e3a9c69ca3e22550ef58ac1c0088e918fff",
53
- "address": "0x1e4f97b9f9f913c46f1632781732927b9019c68b",
54
- "decimals": 18
55
- },
56
- {
57
- "aSymbol": "aSUSHI",
58
- "aAddress": "0xc45a479877e1e9dfe9fcd4056c699575a1045daa",
59
- "address": "0xae75a438b2e0cb8bb01ec1e1e376de11d44477cc",
60
- "decimals": 18
61
- }
62
- ]
@@ -1,44 +0,0 @@
1
- [
2
- {
3
- "aSymbol": "aDAI",
4
- "aAddress": "0x018008bfb33d285247A21d44E50697654f754e63",
5
- "address": "0x6b175474e89094c44da98b954eedeac495271d0f",
6
- "decimals": 18
7
- },
8
- {
9
- "aSymbol": "aUSDC",
10
- "aAddress": "0x98C23E9d8f34FEFb1B7BD6a91B7FF122F4e16F5c",
11
- "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
12
- "decimals": 6
13
- },
14
- {
15
- "aSymbol": "aAAVE",
16
- "aAddress": "0xA700b4eB416Be35b2911fd5Dee80678ff64fF6C9",
17
- "address": "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
18
- "decimals": 18
19
- },
20
- {
21
- "aSymbol": "aLINK",
22
- "aAddress": "0x5E8C8A7243651DB1384C0dDfDbE39761E8e7E51a",
23
- "address": "0x514910771af9ca656af840dff83e8264ecf986ca",
24
- "decimals": 18
25
- },
26
- {
27
- "aSymbol": "aWBTC",
28
- "aAddress": "0x5Ee5bf7ae06D1Be5997A1A72006FE6C607eC6DE8",
29
- "address": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
30
- "decimals": 8
31
- },
32
- {
33
- "aSymbol": "aWETH",
34
- "aAddress": "0x4d5F47FA6A74757f35C14fD3a6Ef8E3C9BC514E8",
35
- "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
36
- "decimals": 18
37
- },
38
- {
39
- "aSymbol": "awstETH",
40
- "aAddress": "0x0B925eD163218f6662a35e0f0371Ac234f9E9371",
41
- "address": "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0",
42
- "decimals": 18
43
- }
44
- ]
@@ -1,50 +0,0 @@
1
- [
2
- {
3
- "aSymbol": "aOptAAVE",
4
- "aAddress": "0xf329e36C7bF6E5E86ce2150875a84Ce77f477375",
5
- "address": "0x76fb31fb4af56892a25e32cfc43de717950c9278",
6
- "decimals": 18
7
- },
8
- {
9
- "aSymbol": "aOptDAI",
10
- "aAddress": "0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE",
11
- "address": "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1",
12
- "decimals": 18
13
- },
14
- {
15
- "aSymbol": "aOptUSDT",
16
- "aAddress": "0x6ab707aca953edaefbc4fd23ba73294241490620",
17
- "address": "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58",
18
- "decimals": 6
19
- },
20
- {
21
- "aSymbol": "aOptLINK",
22
- "aAddress": "0x191c10Aa4AF7C30e871E70C95dB0E4eb77237530",
23
- "address": "0x350a791Bfc2C21F9Ed5d10980Dad2e2638ffa7f6",
24
- "decimals": 18
25
- },
26
- {
27
- "aSymbol": "aOptSUSD",
28
- "aAddress": "0x6d80113e533a2C0fe82EaBD35f1875DcEA89Ea97",
29
- "address": "0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9",
30
- "decimals": 18
31
- },
32
- {
33
- "aSymbol": "aOptUSDC",
34
- "aAddress": "0x625E7708f30cA75bfd92586e17077590C60eb4cD",
35
- "address": "0x7f5c764cbc14f9669b88837ca1490cca17c31607",
36
- "decimals": 6
37
- },
38
- {
39
- "aSymbol": "aOptWBTC",
40
- "aAddress": "0x078f358208685046a11C85e8ad32895DED33A249",
41
- "address": "0x68f180fcce6836688e9084f035309e29bf0a2095",
42
- "decimals": 8
43
- },
44
- {
45
- "aSymbol": "aOptWETH",
46
- "aAddress": "0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8",
47
- "address": "0x4200000000000000000000000000000000000006",
48
- "decimals": 18
49
- }
50
- ]
@@ -1,98 +0,0 @@
1
- [
2
- {
3
- "aSymbol": "aAAVE",
4
- "aAddress": "0xf329e36c7bf6e5e86ce2150875a84ce77f477375",
5
- "address": "0xd6df932a45c0f255f85145f286ea0b292b21c90b",
6
- "decimals": 18
7
- },
8
- {
9
- "aSymbol": "aDAI",
10
- "aAddress": "0x82e64f49ed5ec1bc6e43dad4fc8af9bb3a2312ee",
11
- "address": "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063",
12
- "decimals": 18
13
- },
14
- {
15
- "aSymbol": "aUSDC",
16
- "aAddress": "0x625e7708f30ca75bfd92586e17077590c60eb4cd",
17
- "address": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
18
- "decimals": 6
19
- },
20
- {
21
- "aSymbol": "aUSDT",
22
- "aAddress": "0x6ab707aca953edaefbc4fd23ba73294241490620",
23
- "address": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
24
- "decimals": 6
25
- },
26
- {
27
- "aSymbol": "aWBTC",
28
- "aAddress": "0x078f358208685046a11c85e8ad32895ded33a249",
29
- "address": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
30
- "decimals": 8
31
- },
32
- {
33
- "aSymbol": "aWETH",
34
- "aAddress": "0xe50fa9b3c56ffb159cb0fca61f5c9d750e8128c8",
35
- "address": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
36
- "decimals": 18
37
- },
38
- {
39
- "aSymbol": "aWMATIC",
40
- "aAddress": "0x6d80113e533a2c0fe82eabd35f1875dcea89ea97",
41
- "address": "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",
42
- "decimals": 18
43
- },
44
- {
45
- "aSymbol": "aLINK",
46
- "aAddress": "0x191c10aa4af7c30e871e70c95db0e4eb77237530",
47
- "address": "0x53e0bca35ec356bd5dddfebbd1fc0fd03fabad39",
48
- "decimals": 18
49
- },
50
- {
51
- "aSymbol": "aEURS",
52
- "aAddress": "0x38d693ce1df5aadf7bc62595a37d667ad57922e5",
53
- "address": "0xe111178a87a3bff0c8d18decba5798827539ae99",
54
- "decimals": 2
55
- },
56
- {
57
- "aSymbol": "aGHST",
58
- "aAddress": "0x8eb270e296023e9d92081fdf967ddd7878724424",
59
- "address": "0x385eeac5cb85a38a9a07a70c73e0a3271cfb54a7",
60
- "decimals": 18
61
- },
62
- {
63
- "aSymbol": "aBAL",
64
- "aAddress": "0x8ffdf2de812095b1d19cb146e4c004587c0a0692",
65
- "address": "0x9a71012b13ca4d3d0cdc72a177df3ef03b0e76a3",
66
- "decimals": 18
67
- },
68
- {
69
- "aSymbol": "aCRV",
70
- "aAddress": "0x513c7e3a9c69ca3e22550ef58ac1c0088e918fff",
71
- "address": "0x172370d5cd63279efa6d502dab29171933a610af",
72
- "decimals": 18
73
- },
74
- {
75
- "aSymbol": "aDPI",
76
- "aAddress": "0x724dc807b04555b71ed48a6896b6f41593b8c637",
77
- "address": "0x85955046df4668e1dd369d2de9f3aeb98dd2a369",
78
- "decimals": 18
79
- },
80
- {
81
- "aSymbol": "aSUSHI",
82
- "aAddress": "0xc45a479877e1e9dfe9fcd4056c699575a1045daa",
83
- "address": "0x0b3f868e0be5597d5db7feb59e1cadbb0fdda50a",
84
- "decimals": 18
85
- },
86
- {
87
- "aSymbol": "aJEUR",
88
- "aAddress": "0x6533afac2e7bccb20dca161449a13a32d391fb00",
89
- "address": "0x4e3decbb3645551b8a19f0ea1678079fcb33fb4c",
90
- "decimals": 18
91
- },
92
- {
93
- "aSymbol": "aAGEUR",
94
- "aAddress": "0x8437d7c167dfb82ed4cb79cd44b7a32a1dd95c77",
95
- "address": "0xe0b52e49357fd4daf2c15e02058dce6bc0057db4",
96
- "decimals": 18
97
- }
98
- ]
@@ -1,79 +0,0 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { PoolState, SubgraphPoolBase, callData, BalancerSwap } from './types';
3
- import { SwapSide } from '../../constants';
4
- export declare type BoostedPools = {
5
- [id: string]: BoostedPool;
6
- };
7
- export declare type BoostedPool = {
8
- mainTokens: MainToken[];
9
- phantomStablePoolAddr: string;
10
- };
11
- export declare type MainToken = {
12
- address: string;
13
- decimals: number;
14
- linearPoolAddr: string;
15
- linearPoolId: string;
16
- };
17
- export declare type VirtualBoostedPools = {
18
- dictionary: BoostedPools;
19
- subgraph: SubgraphPoolBase[];
20
- };
21
- declare type BoostedPoolPairData = {
22
- tokenIn: string;
23
- tokenOut: string;
24
- phantomPoolId: any;
25
- poolStates: {
26
- [address: string]: PoolState;
27
- };
28
- boostedPools: BoostedPools;
29
- gasCost: number;
30
- };
31
- export declare type SwapData = {
32
- swaps: BalancerSwap[];
33
- assets: string[];
34
- };
35
- export declare class VirtualBoostedPool {
36
- /**
37
- * Creates VirtualBoostedPools from list of input pools. A VirtualBoostedPool is a combination of Linear pools nested in a PhantomStable pool. i.e. bb-a-USD.
38
- * @param pools Array of subgraph pools (should contain Phantom/Linear pools of interest)
39
- * @returns Array of VirtualBoosted subgraph pools. Dictionary object of virtualBoosted pool data.
40
- */
41
- static createPools(pools: SubgraphPoolBase[]): VirtualBoostedPools;
42
- static poolType: string;
43
- vaultAddress: string;
44
- vaultInterface: Interface;
45
- linearPoolInterface: Interface;
46
- phantomStablePoolInterface: Interface;
47
- constructor(vaultAddress: string, vaultInterface: Interface, linearPoolInterface: Interface, metaStablePoolInterface: Interface);
48
- getOnChainCalls(pool: SubgraphPoolBase, virtualBoostedPools: BoostedPools): callData[];
49
- decodeOnChainCalls(pool: SubgraphPoolBase, data: {
50
- success: boolean;
51
- returnData: any;
52
- }[], startIndex: number, boostedPools: BoostedPools): [{
53
- [address: string]: PoolState;
54
- }, number];
55
- static getTokenPool(phantomPoolAddr: string, phantomPoolId: string, tokenAddr: string, boostedPools: BoostedPools): {
56
- address: string;
57
- type: string;
58
- id: string;
59
- };
60
- parsePoolPairData(pool: SubgraphPoolBase, poolStates: {
61
- [address: string]: PoolState;
62
- }, tokenIn: string, tokenOut: string, boostedPools: BoostedPools): BoostedPoolPairData;
63
- checkBalance(amounts: bigint[], unitVolume: bigint, side: SwapSide, poolPairData: BoostedPoolPairData): boolean;
64
- onSell(amounts: bigint[], poolPairData: BoostedPoolPairData): bigint[];
65
- _calcOutGivenIn(tokenAmountsIn: bigint[], tokenIn: string, tokenOut: string, phantomPoolId: string, poolStates: {
66
- [address: string]: PoolState;
67
- }, boostedPools: BoostedPools): bigint[];
68
- /**
69
- * Creates Balancer multihop swaps and asset info required to swap a pair of underlying tokens through the Boosted pools.
70
- * @param tokenIn Underlying token in.
71
- * @param tokenOut Underlying token out.
72
- * @param boostedPoolId ID of the VirtualBoostedPool that tokenIn/Out belong to.
73
- * @param amount Amount being traded.
74
- * @param boostedPools Dictionary of boosted pools.
75
- * @returns Swaps and assets.
76
- */
77
- static getSwapData(tokenIn: string, tokenOut: string, boostedPoolId: string, amount: string, boostedPools: BoostedPools): SwapData;
78
- }
79
- export {};