@paraswap/dex-lib 2.36.3-dexalot.5 → 2.36.3-retro

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 (36) hide show
  1. package/build/config.js +0 -2
  2. package/build/config.js.map +1 -1
  3. package/build/dex/idex.d.ts +1 -1
  4. package/build/dex/index.js +0 -2
  5. package/build/dex/index.js.map +1 -1
  6. package/build/dex/uniswap-v3/config.js +14 -0
  7. package/build/dex/uniswap-v3/config.js.map +1 -1
  8. package/build/dex/uniswap-v3/uniswap-v3.js +1 -0
  9. package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
  10. package/build/implementations/local-paraswap-sdk.js +1 -1
  11. package/build/implementations/local-paraswap-sdk.js.map +1 -1
  12. package/build/pricing-helper.d.ts +1 -1
  13. package/build/pricing-helper.js +2 -2
  14. package/build/pricing-helper.js.map +1 -1
  15. package/build/types.d.ts +0 -1
  16. package/package.json +1 -1
  17. package/src/config.ts +0 -3
  18. package/src/dex/idex.ts +0 -2
  19. package/src/dex/index.ts +0 -2
  20. package/src/dex/uniswap-v3/config.ts +15 -0
  21. package/src/dex/uniswap-v3/uniswap-v3-e2e.test.ts +25 -0
  22. package/src/dex/uniswap-v3/uniswap-v3-integration.test.ts +144 -0
  23. package/src/dex/uniswap-v3/uniswap-v3.ts +1 -0
  24. package/src/implementations/local-paraswap-sdk.ts +0 -1
  25. package/src/pricing-helper.ts +0 -2
  26. package/src/types.ts +0 -1
  27. package/tests/constants-e2e.ts +1 -1
  28. package/src/abi/dexalot/DexalotMainnetRFQ.json +0 -887
  29. package/src/dex/dexalot/config.ts +0 -18
  30. package/src/dex/dexalot/constants.ts +0 -29
  31. package/src/dex/dexalot/dexalot-e2e.test.ts +0 -192
  32. package/src/dex/dexalot/dexalot-integration.test.ts +0 -188
  33. package/src/dex/dexalot/dexalot.ts +0 -1005
  34. package/src/dex/dexalot/rate-fetcher.ts +0 -197
  35. package/src/dex/dexalot/types.ts +0 -131
  36. package/src/dex/dexalot/validators.ts +0 -46
@@ -1100,3 +1100,147 @@ describe('SushiSwapV3', () => {
1100
1100
  });
1101
1101
  });
1102
1102
  });
1103
+
1104
+
1105
+ describe('Retro', () => {
1106
+ const dexKey = 'Retro';
1107
+
1108
+ describe('Polygon', () => {
1109
+ let blockNumber: number;
1110
+ let retro: UniswapV3;
1111
+
1112
+ const network = Network.POLYGON;
1113
+ const dexHelper = new DummyDexHelper(network);
1114
+ const TokenASymbol = 'USDC';
1115
+ const TokenA = Tokens[network][TokenASymbol];
1116
+
1117
+ const TokenBSymbol = 'USDT';
1118
+ const TokenB = Tokens[network][TokenBSymbol];
1119
+
1120
+ beforeEach(async () => {
1121
+ blockNumber = await dexHelper.web3Provider.eth.getBlockNumber();
1122
+ retro = new UniswapV3(network, dexKey, dexHelper);
1123
+ });
1124
+
1125
+ it('getPoolIdentifiers and getPricesVolume SELL', async function () {
1126
+ const amounts = [0n, BI_POWS[6], 2000000n];
1127
+
1128
+ const pools = await retro.getPoolIdentifiers(
1129
+ TokenA,
1130
+ TokenB,
1131
+ SwapSide.SELL,
1132
+ blockNumber,
1133
+ );
1134
+ console.log(
1135
+ `${TokenASymbol} <> ${TokenBSymbol} Pool Identifiers: `,
1136
+ pools,
1137
+ );
1138
+
1139
+ expect(pools.length).toBeGreaterThan(0);
1140
+
1141
+ const poolPrices = await retro.getPricesVolume(
1142
+ TokenA,
1143
+ TokenB,
1144
+ amounts,
1145
+ SwapSide.SELL,
1146
+ blockNumber,
1147
+ pools,
1148
+ );
1149
+ console.log(
1150
+ `${TokenASymbol} <> ${TokenBSymbol} Pool Prices: `,
1151
+ poolPrices,
1152
+ );
1153
+
1154
+ expect(poolPrices).not.toBeNull();
1155
+ checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
1156
+
1157
+ let falseChecksCounter = 0;
1158
+ await Promise.all(
1159
+ poolPrices!.map(async price => {
1160
+ const fee = retro.eventPools[price.poolIdentifier!]!.feeCode;
1161
+ const res = await checkOnChainPricing(
1162
+ dexHelper,
1163
+ retro,
1164
+ 'quoteExactInputSingle',
1165
+ blockNumber,
1166
+ '0xfe08be075758935cb6cb9318d1fbb60920416d4e',
1167
+ price.prices,
1168
+ TokenA.address,
1169
+ TokenB.address,
1170
+ fee,
1171
+ amounts,
1172
+ );
1173
+ if (res === false) falseChecksCounter++;
1174
+ }),
1175
+ );
1176
+
1177
+ expect(falseChecksCounter).toBeLessThan(poolPrices!.length);
1178
+ });
1179
+
1180
+ it('getPoolIdentifiers and getPricesVolume BUY', async function () {
1181
+ const amounts = [0n, BI_POWS[6], 2000000n];
1182
+
1183
+ const pools = await retro.getPoolIdentifiers(
1184
+ TokenA,
1185
+ TokenB,
1186
+ SwapSide.BUY,
1187
+ blockNumber,
1188
+ );
1189
+ console.log(
1190
+ `${TokenASymbol} <> ${TokenBSymbol} Pool Identifiers: `,
1191
+ pools,
1192
+ );
1193
+
1194
+ expect(pools.length).toBeGreaterThan(0);
1195
+
1196
+ const poolPrices = await retro.getPricesVolume(
1197
+ TokenA,
1198
+ TokenB,
1199
+ amounts,
1200
+ SwapSide.BUY,
1201
+ blockNumber,
1202
+ pools,
1203
+ );
1204
+ console.log(
1205
+ `${TokenASymbol} <> ${TokenBSymbol} Pool Prices: `,
1206
+ poolPrices,
1207
+ );
1208
+
1209
+ expect(poolPrices).not.toBeNull();
1210
+ checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
1211
+
1212
+ let falseChecksCounter = 0;
1213
+ await Promise.all(
1214
+ poolPrices!.map(async price => {
1215
+ const fee = retro.eventPools[price.poolIdentifier!]!.feeCode;
1216
+ const res = await checkOnChainPricing(
1217
+ dexHelper,
1218
+ retro,
1219
+ 'quoteExactOutputSingle',
1220
+ blockNumber,
1221
+ '0xfe08be075758935cb6cb9318d1fbb60920416d4e',
1222
+ price.prices,
1223
+ TokenA.address,
1224
+ TokenB.address,
1225
+ fee,
1226
+ amounts,
1227
+ );
1228
+ if (res === false) falseChecksCounter++;
1229
+ }),
1230
+ );
1231
+
1232
+ expect(falseChecksCounter).toBeLessThan(poolPrices!.length);
1233
+ });
1234
+
1235
+ it('getTopPoolsForToken', async function () {
1236
+ const poolLiquidity = await retro.getTopPoolsForToken(
1237
+ TokenB.address,
1238
+ 10,
1239
+ );
1240
+ console.log(`${TokenASymbol} Top Pools:`, poolLiquidity);
1241
+
1242
+ checkPoolsLiquidity(poolLiquidity, TokenB.address, dexKey);
1243
+ });
1244
+ });
1245
+
1246
+ });
@@ -97,6 +97,7 @@ export class UniswapV3
97
97
  'QuickSwapV3.1',
98
98
  'RamsesV2',
99
99
  'ChronosV3',
100
+ 'Retro',
100
101
  ]),
101
102
  );
102
103
 
@@ -117,7 +117,6 @@ export class LocalParaswapSDK implements IParaSwapSDK {
117
117
  blockNumber,
118
118
  [this.dexKey],
119
119
  poolIdentifiers,
120
- true,
121
120
  transferFees,
122
121
  );
123
122
 
@@ -185,7 +185,6 @@ export class PricingHelper {
185
185
  blockNumber: number,
186
186
  dexKeys: string[],
187
187
  limitPoolsMap: { [key: string]: string[] | null } | null,
188
- isFirstSwap: boolean,
189
188
  transferFees: TransferFeeParams = {
190
189
  srcFee: 0,
191
190
  destFee: 0,
@@ -227,7 +226,6 @@ export class PricingHelper {
227
226
  blockNumber,
228
227
  limitPools ? limitPools : undefined,
229
228
  transferFees,
230
- isFirstSwap,
231
229
  )
232
230
  .then(poolPrices => {
233
231
  try {
package/src/types.ts CHANGED
@@ -276,7 +276,6 @@ export type Config = {
276
276
  hashFlowDisabledMMs: string[];
277
277
  uniswapV3EventLoggingSampleRate?: number;
278
278
  swaapV2AuthToken?: string;
279
- dexalotAuthToken?: string;
280
279
  forceRpcFallbackDexs: string[];
281
280
  };
282
281
 
@@ -1081,7 +1081,7 @@ export const Holders: {
1081
1081
  TSD: '0x691A89db352B72dDb249bFe16503494eC0D920A4',
1082
1082
  THO: '0xc40d16c47394a506d451475c8a7c46c1175c1da1',
1083
1083
  aAvaUSDT: '0x50B1Ba98Cf117c9682048D56628B294ebbAA4ec2',
1084
- USDT: '0x4a58555884297dcd9d2198c9fec52b4cabc90fc6',
1084
+ USDT: '0x4aeFa39caEAdD662aE31ab0CE7c8C2c9c0a013E8',
1085
1085
  aAvaWAVAX: '0x1B18Df70863636AEe4BfBAb6F7C70ceBCA9bA404',
1086
1086
  oldFRAX: '0x4e3376018add04ebe4c46bf6f924ddec8c67aa7b',
1087
1087
  newFRAX: '0x4e3376018add04ebe4c46bf6f924ddec8c67aa7b',