@paraswap/dex-lib 4.0.16-fluid-restr → 4.0.17-statav2

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 (60) hide show
  1. package/build/abi/aavev3statav2/Factory.json +131 -0
  2. package/build/abi/aavev3statav2/Pool.json +1459 -0
  3. package/build/abi/aavev3statav2/Token.json +997 -0
  4. package/build/dex/aave-gsm/config.js +2 -2
  5. package/build/dex/aave-gsm/config.js.map +1 -1
  6. package/build/dex/aave-v2/tokenlist.json +904 -0
  7. package/build/dex/aave-v2/tokens.js +6 -4
  8. package/build/dex/aave-v2/tokens.js.map +1 -1
  9. package/build/dex/aave-v3/config.js +6 -6
  10. package/build/dex/aave-v3/config.js.map +1 -1
  11. package/build/dex/aave-v3-stata-v2/aave-v3-stata-v2.d.ts +49 -0
  12. package/build/dex/aave-v3-stata-v2/aave-v3-stata-v2.js +377 -0
  13. package/build/dex/aave-v3-stata-v2/aave-v3-stata-v2.js.map +1 -0
  14. package/build/dex/aave-v3-stata-v2/config.d.ts +3 -0
  15. package/build/dex/aave-v3-stata-v2/config.js +21 -0
  16. package/build/dex/aave-v3-stata-v2/config.js.map +1 -0
  17. package/build/dex/aave-v3-stata-v2/tokens.d.ts +10 -0
  18. package/build/dex/aave-v3-stata-v2/tokens.js +43 -0
  19. package/build/dex/aave-v3-stata-v2/tokens.js.map +1 -0
  20. package/build/dex/aave-v3-stata-v2/types.d.ts +35 -0
  21. package/build/dex/aave-v3-stata-v2/types.js +25 -0
  22. package/build/dex/aave-v3-stata-v2/types.js.map +1 -0
  23. package/build/dex/aave-v3-stata-v2/utils.d.ts +4 -0
  24. package/build/dex/aave-v3-stata-v2/utils.js +67 -0
  25. package/build/dex/aave-v3-stata-v2/utils.js.map +1 -0
  26. package/build/dex/fluid-dex/fluid-dex.js +2 -4
  27. package/build/dex/fluid-dex/fluid-dex.js.map +1 -1
  28. package/build/dex/index.js +2 -0
  29. package/build/dex/index.js.map +1 -1
  30. package/build/dex/pancakeswap-v3/pancakeswap-v3-pool.js +9 -3
  31. package/build/dex/pancakeswap-v3/pancakeswap-v3-pool.js.map +1 -1
  32. package/build/dex/stkgho/config.js +2 -2
  33. package/build/dex/stkgho/config.js.map +1 -1
  34. package/build/dex/uniswap-v3/config.js +0 -25
  35. package/build/dex/uniswap-v3/config.js.map +1 -1
  36. package/build/dex/uniswap-v3/uniswap-v3-pool.js +9 -3
  37. package/build/dex/uniswap-v3/uniswap-v3-pool.js.map +1 -1
  38. package/package.json +2 -2
  39. package/src/abi/aavev3statav2/Factory.json +131 -0
  40. package/src/abi/aavev3statav2/Pool.json +1459 -0
  41. package/src/abi/aavev3statav2/Token.json +997 -0
  42. package/src/dex/aave-gsm/config.ts +3 -3
  43. package/src/dex/aave-v2/tokenlist.json +904 -0
  44. package/src/dex/aave-v2/tokens.ts +3 -4
  45. package/src/dex/aave-v3/config.ts +6 -7
  46. package/src/dex/aave-v3-stata-v2/aave-v3-stata-v2-e2e.test.ts +397 -0
  47. package/src/dex/aave-v3-stata-v2/aave-v3-stata-v2-integration.test.ts +600 -0
  48. package/src/dex/aave-v3-stata-v2/aave-v3-stata-v2.ts +477 -0
  49. package/src/dex/aave-v3-stata-v2/config.ts +24 -0
  50. package/src/dex/aave-v3-stata-v2/tokens.ts +48 -0
  51. package/src/dex/aave-v3-stata-v2/types.ts +41 -0
  52. package/src/dex/aave-v3-stata-v2/utils.ts +88 -0
  53. package/src/dex/fluid-dex/fluid-dex-e2e.test.ts +17 -17
  54. package/src/dex/fluid-dex/fluid-dex.ts +4 -7
  55. package/src/dex/index.ts +2 -0
  56. package/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts +9 -9
  57. package/src/dex/stkgho/config.ts +3 -3
  58. package/src/dex/uniswap-v3/config.ts +0 -26
  59. package/src/dex/uniswap-v3/uniswap-v3-pool.ts +9 -9
  60. package/tests/constants-e2e.ts +11 -1
@@ -118,23 +118,23 @@ describe('FluidDex E2E', () => {
118
118
  describe('Mainnet', () => {
119
119
  const network = Network.MAINNET;
120
120
 
121
- // TODO: Uncomment when the issue is resolved. Currently no price as expected.
122
- describe.only('FLUID -> ETH', () => {
123
- const tokenASymbol: string = 'FLUID';
124
- const tokenBSymbol: string = 'ETH';
125
-
126
- const tokenAAmount: string = '160097047322810379';
127
- const tokenBAmount: string = '79923068733005505624';
128
-
129
- testForNetwork(
130
- network,
131
- dexKey,
132
- tokenASymbol,
133
- tokenBSymbol,
134
- tokenAAmount,
135
- tokenBAmount,
136
- );
137
- });
121
+ // TODO: Uncomment & test when the issue is resolved. Currently no price as expected.
122
+ // describe.only('FLUID -> ETH', () => {
123
+ // const tokenASymbol: string = 'FLUID';
124
+ // const tokenBSymbol: string = 'ETH';
125
+ //
126
+ // const tokenAAmount: string = '160097047322810379';
127
+ // const tokenBAmount: string = '79923068733005505624';
128
+ //
129
+ // testForNetwork(
130
+ // network,
131
+ // dexKey,
132
+ // tokenASymbol,
133
+ // tokenBSymbol,
134
+ // tokenAAmount,
135
+ // tokenBAmount,
136
+ // );
137
+ // });
138
138
 
139
139
  describe('ETH -> INST', () => {
140
140
  const tokenASymbol: string = 'ETH';
@@ -115,11 +115,9 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
115
115
  // implement this function
116
116
  async initializePricing(blockNumber: number) {
117
117
  await this.factory.initialize(blockNumber);
118
- this.pools = await this.fetchFluidDexPools(blockNumber);
119
- this.pools = this.pools.filter(
118
+ this.pools = (await this.fetchFluidDexPools(blockNumber)).filter(
120
119
  pool => !this.restrictedIds.includes(pool.id),
121
120
  );
122
-
123
121
  this.eventPools = await Promise.all(
124
122
  this.pools.map(async pool => {
125
123
  const eventPool = new FluidDexEventPool(
@@ -142,10 +140,9 @@ export class FluidDex extends SimpleExchange implements IDex<FluidDexData> {
142
140
  }
143
141
 
144
142
  protected onPoolCreatedUpdatePools(poolsFromFactory: readonly Pool[]) {
145
- this.pools = this.generateFluidDexPoolsFromPoolsFactory(poolsFromFactory);
146
- this.pools = this.pools.filter(
147
- pool => !this.restrictedIds.includes(pool.id),
148
- );
143
+ this.pools = this.generateFluidDexPoolsFromPoolsFactory(
144
+ poolsFromFactory,
145
+ ).filter(pool => !this.restrictedIds.includes(pool.id));
149
146
  this.logger.info(`${this.dexKey}: pools list was updated ...`);
150
147
  }
151
148
 
package/src/dex/index.ts CHANGED
@@ -85,6 +85,7 @@ import { EtherFi } from './etherfi';
85
85
  import { Spark } from './spark/spark';
86
86
  import { VelodromeSlipstream } from './uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream';
87
87
  import { AaveV3Stata } from './aave-v3-stata/aave-v3-stata';
88
+ import { AaveV3StataV2 } from './aave-v3-stata-v2/aave-v3-stata-v2';
88
89
  import { OSwap } from './oswap/oswap';
89
90
  import { FluidDex } from './fluid-dex/fluid-dex';
90
91
  import { ConcentratorArusd } from './concentrator-arusd/concentrator-arusd';
@@ -182,6 +183,7 @@ const Dexes = [
182
183
  PharaohV1,
183
184
  Spark,
184
185
  AaveV3Stata,
186
+ AaveV3StataV2,
185
187
  OSwap,
186
188
  ConcentratorArusd,
187
189
  FxProtocolRusd,
@@ -265,15 +265,15 @@ export class PancakeSwapV3EventPool extends StatefulEventSubscriber<PoolState> {
265
265
  }
266
266
 
267
267
  _setState(state: any, blockNumber: number, reason?: string): void {
268
- if (this.parentName === 'PancakeswapV3') {
269
- this.logger.info(
270
- `PancakeV3: Setting state: ${!!state ? 'non-empty' : 'empty'} for '${
271
- this.name
272
- }' for bn: '${blockNumber}' due to reason: '${
273
- reason ?? 'outside_of_event_subscriber'
274
- }'`,
275
- );
276
- }
268
+ // if (this.parentName === 'PancakeswapV3') {
269
+ // this.logger.info(
270
+ // `PancakeV3: Setting state: ${!!state ? 'non-empty' : 'empty'} for '${
271
+ // this.name
272
+ // }' for bn: '${blockNumber}' due to reason: '${
273
+ // reason ?? 'outside_of_event_subscriber'
274
+ // }'`,
275
+ // );
276
+ // }
277
277
  super._setState(state, blockNumber);
278
278
  }
279
279
 
@@ -2,13 +2,13 @@ import { DexParams } from './types';
2
2
  import { DexConfigMap } from '../../types';
3
3
  import { Network } from '../../constants';
4
4
 
5
- import { MiscEthereum } from '@bgd-labs/aave-address-book';
5
+ import { GhoEthereum, AaveSafetyModule } from '@bgd-labs/aave-address-book';
6
6
 
7
7
  export const StkGHOConfig: DexConfigMap<DexParams> = {
8
8
  StkGHO: {
9
9
  [Network.MAINNET]: {
10
- stkGHO: '0x1a88Df1cFe15Af22B3c4c783D4e6F7F9e0C1885d',
11
- GHO: MiscEthereum.GHO_TOKEN,
10
+ stkGHO: AaveSafetyModule.STK_GHO,
11
+ GHO: GhoEthereum.GHO_TOKEN,
12
12
  },
13
13
  },
14
14
  };
@@ -359,32 +359,6 @@ export const UniswapV3Config: DexConfigMap<DexParams> = {
359
359
  subgraphURL: 'Dimv1udMsJu1DqirVM4G2vNRvH8CWzWTn7GffQQCGAaq',
360
360
  },
361
361
  },
362
- VelodromeSlipstream: {
363
- [Network.OPTIMISM]: {
364
- factory: '0x548118C7E0B865C2CfA94D15EC86B666468ac758',
365
- quoter: '0xA2DEcF05c16537C702779083Fe067e308463CE45',
366
- router: '0x93A3b44C38A8557E935B3e2549B2809a582c28EE',
367
- supportedFees: SUPPORTED_FEES,
368
- tickSpacings: [1n, 50n, 100n, 200n, 2000n],
369
- tickSpacingsToFees: {
370
- '1': 100n,
371
- '50': 500n,
372
- '100': 500n,
373
- '200': 3000n,
374
- '2000': 10000n,
375
- },
376
- stateMulticall: '0xc055b23319b3a140D4De2d0001bd0A885B3d7DbB',
377
- stateMultiCallAbi: VelodromeSlipstreamMulticallABi as AbiItem[],
378
- eventPoolImplementation: VelodromeSlipstreamEventPool,
379
- factoryImplementation: VelodromeSlipstreamFactory,
380
- decodeStateMultiCallResultWithRelativeBitmaps:
381
- decodeStateMultiCallResultWithRelativeBitmapsForVelodromeSlipstream,
382
- uniswapMulticall: '0x1F98415757620B543A52E61c46B32eB19261F984',
383
- chunksCount: 10,
384
- initRetryFrequency: 10,
385
- initHash: '0xE0A596c403E854FFb9C828aB4f07eEae04A05D37', // pool implementation address from factory contract is used instead of initHash here
386
- },
387
- },
388
362
  VelodromeSlipstreamNewFactory: {
389
363
  [Network.OPTIMISM]: {
390
364
  factory: '0xCc0bDDB707055e04e497aB22a59c2aF4391cd12F',
@@ -269,15 +269,15 @@ export class UniswapV3EventPool extends StatefulEventSubscriber<PoolState> {
269
269
  }
270
270
 
271
271
  _setState(state: any, blockNumber: number, reason?: string): void {
272
- if (this.parentName === 'UniswapV3') {
273
- this.logger.info(
274
- `UniV3: Setting state: '${!!state ? 'non-empty' : 'empty'}' for '${
275
- this.name
276
- }' for bn: '${blockNumber}' due to reason: '${
277
- reason ?? 'outside_of_event_subscriber'
278
- }'`,
279
- );
280
- }
272
+ // if (this.parentName === 'UniswapV3') {
273
+ // this.logger.info(
274
+ // `UniV3: Setting state: '${!!state ? 'non-empty' : 'empty'}' for '${
275
+ // this.name
276
+ // }' for bn: '${blockNumber}' due to reason: '${
277
+ // reason ?? 'outside_of_event_subscriber'
278
+ // }'`,
279
+ // );
280
+ // }
281
281
  super._setState(state, blockNumber);
282
282
  }
283
283
 
@@ -536,6 +536,10 @@ export const Tokens: {
536
536
  address: '0x862c57d48becb45583aeba3f489696d22466ca1b',
537
537
  decimals: 6,
538
538
  },
539
+ waEthUSDT: {
540
+ address: '0x7Bc3485026Ac48b6cf9BaF0A377477Fff5703Af8',
541
+ decimals: 6,
542
+ },
539
543
  aaveUSDT: {
540
544
  address: '0x23878914efe38d27c4d67ab83ed1b93a74d4086a',
541
545
  decimals: 6,
@@ -1539,6 +1543,10 @@ export const Tokens: {
1539
1543
  address: '0x773CDA0CADe2A3d86E6D4e30699d40bB95174ff2',
1540
1544
  decimals: 18,
1541
1545
  },
1546
+ waGnoGNO: {
1547
+ address: '0x7c16F0185A26Db0AE7a9377f23BC18ea7ce5d644',
1548
+ decimals: 18,
1549
+ },
1542
1550
  aGnoUSDC: {
1543
1551
  address: '0xc6b7aca6de8a6044e0e32d0c841a89244a10d284',
1544
1552
  decimals: 6,
@@ -1811,7 +1819,8 @@ export const Holders: {
1811
1819
  USDe: '0x74e6c48e667d698a4cf90665b6960a5bae39e603',
1812
1820
  eETH: '0x0f1DfeF1a40557d279d0de6E49aB306891A638b8',
1813
1821
  stataUSDT: '0x6803364AceD5181877abC11E865FB27cB654a426',
1814
- aaveUSDT: '0x32c98a981Fe7C333Bd4e8E7630E8e0CF5ce20987',
1822
+ aaveUSDT: '0x464C71f6c2F760DdA6093dCB91C24c39e5d6e18c',
1823
+ waEthUSDT: '0xbA1333333333a1BA1108E8412f11850A5C319bA9',
1815
1824
  weETH: '0x267ed5f71EE47D3E45Bb1569Aa37889a2d10f91e',
1816
1825
  rUSD: '0xEC2eda1C4F981E468ABF62424a10B69B738b498E',
1817
1826
  arUSD: '0xeFc24206053a452e2299BF3b8f964512b041Db4C',
@@ -2063,6 +2072,7 @@ export const Holders: {
2063
2072
  SWPR: '0x9467dcFD4519287e3878C018c02f5670465a9003',
2064
2073
  waGnoWETH: '0x854B004700885A61107B458f11eCC169A019b764',
2065
2074
  waGnowstETH: '0x854B004700885A61107B458f11eCC169A019b764',
2075
+ waGnoGNO: '0x9Ec6472Fc33D9a5D17613484aDF0295A001fDF32',
2066
2076
  },
2067
2077
  [Network.BASE]: {
2068
2078
  WETH: '0x4bb6b2efe7036020ba6f02a05602546c9f25bf28',