@paraswap/dex-lib 2.37.6-dexalot → 2.37.7-baseswap.0

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 (228) hide show
  1. package/build/config.js +2 -4
  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-v2/config.js +22 -0
  7. package/build/dex/uniswap-v2/config.js.map +1 -1
  8. package/build/router/buy.d.ts +1 -1
  9. package/build/router/buy.js +3 -3
  10. package/build/router/buy.js.map +1 -1
  11. package/build/router/directswap.d.ts +1 -1
  12. package/build/router/directswap.js +3 -3
  13. package/build/router/directswap.js.map +1 -1
  14. package/build/router/irouter.d.ts +1 -1
  15. package/build/router/megaswap.d.ts +1 -1
  16. package/build/router/megaswap.js +3 -3
  17. package/build/router/megaswap.js.map +1 -1
  18. package/build/router/multiswap.d.ts +1 -1
  19. package/build/router/multiswap.js +3 -3
  20. package/build/router/multiswap.js.map +1 -1
  21. package/build/router/payload-encoder.d.ts +3 -3
  22. package/build/router/payload-encoder.js +6 -6
  23. package/build/router/payload-encoder.js.map +1 -1
  24. package/build/router/simpleswap.d.ts +2 -2
  25. package/build/router/simpleswap.js +3 -3
  26. package/build/router/simpleswap.js.map +1 -1
  27. package/build/router/simpleswapnft.d.ts +1 -1
  28. package/build/router/simpleswapnft.js +3 -3
  29. package/build/router/simpleswapnft.js.map +1 -1
  30. package/build/transaction-builder.d.ts +2 -2
  31. package/build/transaction-builder.js +2 -2
  32. package/build/transaction-builder.js.map +1 -1
  33. package/build/types.d.ts +0 -1
  34. package/package.json +1 -1
  35. package/src/config.ts +2 -5
  36. package/src/dex/idex.ts +0 -2
  37. package/src/dex/index.ts +0 -2
  38. package/src/dex/uniswap-v2/config.ts +23 -0
  39. package/src/router/buy.ts +3 -7
  40. package/src/router/directswap.ts +3 -7
  41. package/src/router/irouter.ts +1 -1
  42. package/src/router/megaswap.ts +3 -7
  43. package/src/router/multiswap.ts +3 -7
  44. package/src/router/payload-encoder.ts +7 -7
  45. package/src/router/simpleswap.ts +4 -8
  46. package/src/router/simpleswapnft.ts +3 -7
  47. package/src/transaction-builder.ts +3 -3
  48. package/src/types.ts +0 -1
  49. package/tests/constants-e2e.ts +2 -2
  50. package/.idea/aws.xml +0 -17
  51. package/.idea/codeStyles/Project.xml +0 -19
  52. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  53. package/.idea/misc.xml +0 -6
  54. package/.idea/modules.xml +0 -8
  55. package/.idea/paraswap-dex-lib.iml +0 -9
  56. package/.idea/vcs.xml +0 -6
  57. package/build/abi/curve-v1/StableSwapFRXETH.json +0 -889
  58. package/build/abi/curve-v1/StableSwapWBETH.json +0 -1223
  59. package/build/abi/dexalot/DexalotMainnetRFQ.json +0 -952
  60. package/build/abi/sushiswap-v3/QuoterV2.json +0 -267
  61. package/build/abi/sushiswap-v3/RouterProcessor3.json +0 -289
  62. package/build/abi/uniswap-v3/pancakeswap-v3/PancakeswapV3QuoterV2.abi.json +0 -285
  63. package/build/abi/uniswap-v3/pancakeswap-v3/PancakeswapV3Router.abi.json +0 -583
  64. package/build/abi/wBETH.json +0 -1527
  65. package/build/abi/woo-fi/WooFeeManager.abi.json +0 -318
  66. package/build/abi/woo-fi/WooPP.abi.json +0 -548
  67. package/build/abi/woo-fi/Wooracle.abi.json +0 -260
  68. package/build/dex/aave-v3/tokens/arbitrum.json +0 -50
  69. package/build/dex/aave-v3/tokens/avalanche.json +0 -74
  70. package/build/dex/aave-v3/tokens/fantom.json +0 -62
  71. package/build/dex/aave-v3/tokens/optimism.json +0 -50
  72. package/build/dex/aave-v3/tokens/polygon.json +0 -116
  73. package/build/dex/balancer-v2/LinearMath.d.ts +0 -19
  74. package/build/dex/balancer-v2/LinearMath.js +0 -179
  75. package/build/dex/balancer-v2/LinearMath.js.map +0 -1
  76. package/build/dex/balancer-v2/LinearPool.d.ts +0 -47
  77. package/build/dex/balancer-v2/LinearPool.js +0 -324
  78. package/build/dex/balancer-v2/LinearPool.js.map +0 -1
  79. package/build/dex/balancer-v2/PhantomStablePool.d.ts +0 -47
  80. package/build/dex/balancer-v2/PhantomStablePool.js +0 -294
  81. package/build/dex/balancer-v2/PhantomStablePool.js.map +0 -1
  82. package/build/dex/balancer-v2/StableMath.d.ts +0 -9
  83. package/build/dex/balancer-v2/StableMath.js +0 -272
  84. package/build/dex/balancer-v2/StableMath.js.map +0 -1
  85. package/build/dex/balancer-v2/balancer-v2-pool.d.ts +0 -75
  86. package/build/dex/balancer-v2/balancer-v2-pool.js +0 -417
  87. package/build/dex/balancer-v2/balancer-v2-pool.js.map +0 -1
  88. package/build/dex/curve-v1/pools/frxETHpool.d.ts +0 -7
  89. package/build/dex/curve-v1/pools/frxETHpool.js +0 -27
  90. package/build/dex/curve-v1/pools/frxETHpool.js.map +0 -1
  91. package/build/dex/curve-v1/pools/wbETHpool.d.ts +0 -29
  92. package/build/dex/curve-v1/pools/wbETHpool.js +0 -408
  93. package/build/dex/curve-v1/pools/wbETHpool.js.map +0 -1
  94. package/build/dex/dexalot/config.d.ts +0 -4
  95. package/build/dex/dexalot/config.js +0 -18
  96. package/build/dex/dexalot/config.js.map +0 -1
  97. package/build/dex/dexalot/constants.d.ts +0 -15
  98. package/build/dex/dexalot/constants.js +0 -22
  99. package/build/dex/dexalot/constants.js.map +0 -1
  100. package/build/dex/dexalot/dexalot.d.ts +0 -69
  101. package/build/dex/dexalot/dexalot.js +0 -642
  102. package/build/dex/dexalot/dexalot.js.map +0 -1
  103. package/build/dex/dexalot/rate-fetcher.d.ts +0 -28
  104. package/build/dex/dexalot/rate-fetcher.js +0 -100
  105. package/build/dex/dexalot/rate-fetcher.js.map +0 -1
  106. package/build/dex/dexalot/types.d.ts +0 -114
  107. package/build/dex/dexalot/types.js +0 -12
  108. package/build/dex/dexalot/types.js.map +0 -1
  109. package/build/dex/dexalot/validators.d.ts +0 -5
  110. package/build/dex/dexalot/validators.js +0 -45
  111. package/build/dex/dexalot/validators.js.map +0 -1
  112. package/build/dex/pancakeswap-v3/types.d.ts +0 -14
  113. package/build/dex/pancakeswap-v3/types.js +0 -3
  114. package/build/dex/pancakeswap-v3/types.js.map +0 -1
  115. package/build/dex/quickswap-v3.d.ts +0 -21
  116. package/build/dex/quickswap-v3.js +0 -40
  117. package/build/dex/quickswap-v3.js.map +0 -1
  118. package/build/dex/ramses-v2/config.d.ts +0 -4
  119. package/build/dex/ramses-v2/config.js +0 -28
  120. package/build/dex/ramses-v2/config.js.map +0 -1
  121. package/build/dex/ramses-v2/constants.d.ts +0 -28
  122. package/build/dex/ramses-v2/constants.js +0 -35
  123. package/build/dex/ramses-v2/constants.js.map +0 -1
  124. package/build/dex/ramses-v2/contract-math/BitMath.d.ts +0 -4
  125. package/build/dex/ramses-v2/contract-math/BitMath.js +0 -93
  126. package/build/dex/ramses-v2/contract-math/BitMath.js.map +0 -1
  127. package/build/dex/ramses-v2/contract-math/FixedPoint128.d.ts +0 -3
  128. package/build/dex/ramses-v2/contract-math/FixedPoint128.js +0 -8
  129. package/build/dex/ramses-v2/contract-math/FixedPoint128.js.map +0 -1
  130. package/build/dex/ramses-v2/contract-math/FixedPoint96.d.ts +0 -4
  131. package/build/dex/ramses-v2/contract-math/FixedPoint96.js +0 -9
  132. package/build/dex/ramses-v2/contract-math/FixedPoint96.js.map +0 -1
  133. package/build/dex/ramses-v2/contract-math/FullMath.d.ts +0 -4
  134. package/build/dex/ramses-v2/contract-math/FullMath.js +0 -19
  135. package/build/dex/ramses-v2/contract-math/FullMath.js.map +0 -1
  136. package/build/dex/ramses-v2/contract-math/LiquidityMath.d.ts +0 -3
  137. package/build/dex/ramses-v2/contract-math/LiquidityMath.js +0 -22
  138. package/build/dex/ramses-v2/contract-math/LiquidityMath.js.map +0 -1
  139. package/build/dex/ramses-v2/contract-math/Oracle.d.ts +0 -10
  140. package/build/dex/ramses-v2/contract-math/Oracle.js +0 -133
  141. package/build/dex/ramses-v2/contract-math/Oracle.js.map +0 -1
  142. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.d.ts +0 -10
  143. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js +0 -91
  144. package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js.map +0 -1
  145. package/build/dex/ramses-v2/contract-math/SwapMath.d.ts +0 -8
  146. package/build/dex/ramses-v2/contract-math/SwapMath.js +0 -70
  147. package/build/dex/ramses-v2/contract-math/SwapMath.js.map +0 -1
  148. package/build/dex/ramses-v2/contract-math/Tick.d.ts +0 -7
  149. package/build/dex/ramses-v2/contract-math/Tick.js +0 -45
  150. package/build/dex/ramses-v2/contract-math/Tick.js.map +0 -1
  151. package/build/dex/ramses-v2/contract-math/TickBitMap.d.ts +0 -8
  152. package/build/dex/ramses-v2/contract-math/TickBitMap.js +0 -87
  153. package/build/dex/ramses-v2/contract-math/TickBitMap.js.map +0 -1
  154. package/build/dex/ramses-v2/contract-math/TickMath.d.ts +0 -8
  155. package/build/dex/ramses-v2/contract-math/TickMath.js +0 -162
  156. package/build/dex/ramses-v2/contract-math/TickMath.js.map +0 -1
  157. package/build/dex/ramses-v2/contract-math/UnsafeMath.d.ts +0 -3
  158. package/build/dex/ramses-v2/contract-math/UnsafeMath.js +0 -10
  159. package/build/dex/ramses-v2/contract-math/UnsafeMath.js.map +0 -1
  160. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.d.ts +0 -18
  161. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js +0 -392
  162. package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js.map +0 -1
  163. package/build/dex/ramses-v2/contract-math/utils.d.ts +0 -3
  164. package/build/dex/ramses-v2/contract-math/utils.js +0 -16
  165. package/build/dex/ramses-v2/contract-math/utils.js.map +0 -1
  166. package/build/dex/ramses-v2/ramses-v2-pool.d.ts +0 -42
  167. package/build/dex/ramses-v2/ramses-v2-pool.js +0 -307
  168. package/build/dex/ramses-v2/ramses-v2-pool.js.map +0 -1
  169. package/build/dex/ramses-v2/ramses-v2.d.ts +0 -61
  170. package/build/dex/ramses-v2/ramses-v2.js +0 -690
  171. package/build/dex/ramses-v2/ramses-v2.js.map +0 -1
  172. package/build/dex/ramses-v2/types.d.ts +0 -154
  173. package/build/dex/ramses-v2/types.js +0 -9
  174. package/build/dex/ramses-v2/types.js.map +0 -1
  175. package/build/dex/ramses-v2/utils.d.ts +0 -6
  176. package/build/dex/ramses-v2/utils.js +0 -71
  177. package/build/dex/ramses-v2/utils.js.map +0 -1
  178. package/build/dex/sushiswap-v3/config.d.ts +0 -4
  179. package/build/dex/sushiswap-v3/config.js +0 -132
  180. package/build/dex/sushiswap-v3/config.js.map +0 -1
  181. package/build/dex/sushiswap-v3/constants.d.ts +0 -4
  182. package/build/dex/sushiswap-v3/constants.js +0 -32
  183. package/build/dex/sushiswap-v3/constants.js.map +0 -1
  184. package/build/dex/sushiswap-v3/sushiswap-v3-original.d.ts +0 -56
  185. package/build/dex/sushiswap-v3/sushiswap-v3-original.js +0 -598
  186. package/build/dex/sushiswap-v3/sushiswap-v3-original.js.map +0 -1
  187. package/build/dex/sushiswap-v3/sushiswap-v3-pool.d.ts +0 -1
  188. package/build/dex/sushiswap-v3/sushiswap-v3-pool.js +0 -6
  189. package/build/dex/sushiswap-v3/sushiswap-v3-pool.js.map +0 -1
  190. package/build/dex/sushiswap-v3/sushiswap-v3.d.ts +0 -21
  191. package/build/dex/sushiswap-v3/sushiswap-v3.js +0 -58
  192. package/build/dex/sushiswap-v3/sushiswap-v3.js.map +0 -1
  193. package/build/dex/sushiswap-v3/token.d.ts +0 -6
  194. package/build/dex/sushiswap-v3/token.js +0 -23
  195. package/build/dex/sushiswap-v3/token.js.map +0 -1
  196. package/build/dex/sushiswap-v3/types.d.ts +0 -15
  197. package/build/dex/sushiswap-v3/types.js +0 -18
  198. package/build/dex/sushiswap-v3/types.js.map +0 -1
  199. package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.d.ts +0 -12
  200. package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.js +0 -23
  201. package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.js.map +0 -1
  202. package/build/dex/woo-fi/config.d.ts +0 -4
  203. package/build/dex/woo-fi/config.js +0 -141
  204. package/build/dex/woo-fi/config.js.map +0 -1
  205. package/build/dex/woo-fi/constants.d.ts +0 -5
  206. package/build/dex/woo-fi/constants.js +0 -20
  207. package/build/dex/woo-fi/constants.js.map +0 -1
  208. package/build/dex/woo-fi/types.d.ts +0 -48
  209. package/build/dex/woo-fi/types.js +0 -3
  210. package/build/dex/woo-fi/types.js.map +0 -1
  211. package/build/dex/woo-fi/woo-fi-decimal-math.d.ts +0 -14
  212. package/build/dex/woo-fi/woo-fi-decimal-math.js +0 -42
  213. package/build/dex/woo-fi/woo-fi-decimal-math.js.map +0 -1
  214. package/build/dex/woo-fi/woo-fi-math.d.ts +0 -31
  215. package/build/dex/woo-fi/woo-fi-math.js +0 -300
  216. package/build/dex/woo-fi/woo-fi-math.js.map +0 -1
  217. package/build/dex/woo-fi/woo-fi.d.ts +0 -65
  218. package/build/dex/woo-fi/woo-fi.js +0 -480
  219. package/build/dex/woo-fi/woo-fi.js.map +0 -1
  220. package/src/abi/dexalot/DexalotMainnetRFQ.json +0 -952
  221. package/src/dex/dexalot/config.ts +0 -18
  222. package/src/dex/dexalot/constants.ts +0 -29
  223. package/src/dex/dexalot/dexalot-e2e.test.ts +0 -192
  224. package/src/dex/dexalot/dexalot-integration.test.ts +0 -188
  225. package/src/dex/dexalot/dexalot.ts +0 -998
  226. package/src/dex/dexalot/rate-fetcher.ts +0 -197
  227. package/src/dex/dexalot/types.ts +0 -131
  228. package/src/dex/dexalot/validators.ts +0 -46
@@ -31,7 +31,7 @@ class SimpleBuyNFT extends simpleswap_1.SimpleRouterBase {
31
31
  !se.data.makerAssetId ||
32
32
  !se.data.takerAssetId))));
33
33
  }
34
- async build(priceRoute, minMaxAmount, userAddress, referrerAddress, partnerAddress, partnerFeePercent, positiveSlippageToUser, beneficiary, permit, deadline, uuid) {
34
+ async build(priceRoute, minMaxAmount, userAddress, referrerAddress, partnerAddress, partnerFeePercent, takeSurplus, beneficiary, permit, deadline, uuid) {
35
35
  if (!this.validateBestRoute(priceRoute))
36
36
  throw new Error(`${this.contractMethodName} invalid bestRoute`);
37
37
  const { partialContractSimpleData, networkFee } = await this.buildCalls(priceRoute, minMaxAmount);
@@ -62,9 +62,9 @@ class SimpleBuyNFT extends simpleswap_1.SimpleRouterBase {
62
62
  (0, payload_encoder_1.encodePartnerAddressForFeeLogic)({
63
63
  partnerAddress,
64
64
  partnerFeePercent,
65
- positiveSlippageToUser,
65
+ takeSurplus,
66
66
  }),
67
- (0, payload_encoder_1.encodeFeePercent)(partnerFeePercent, positiveSlippageToUser, constants_1.SwapSide.BUY),
67
+ (0, payload_encoder_1.encodeFeePercent)(partnerFeePercent, takeSurplus, constants_1.SwapSide.BUY),
68
68
  ];
69
69
  const buyData = {
70
70
  ...partialContractSimpleData,
@@ -1 +1 @@
1
- {"version":3,"file":"simpleswapnft.js","sourceRoot":"","sources":["../../src/router/simpleswapnft.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AAOvB,4CAAwC;AACxC,oCAAyC;AAEzC,uDAI2B;AAC3B,6CAA2E;AAC3E,0DAAmD;AAGnD,MAAM,6BAA6B,GAAG,EAAE,CAAC;AACzC,MAAM,+BAA+B,GAAG,EAAE,CAAC;AAC3C,MAAM,8BAA8B,GAAG,EAAE,CAAC;AAE1C,MAAM,iCAAiC,GAAG,EAAE,IAAI,IAAI,CAAC;AACrD,MAAM,gCAAgC,GAAG,EAAE,CAAC;AAI5C,MAAa,YAAa,SAAQ,6BAAmC;IAEnE,YAAY,iBAAoC;QAC9C,KAAK,CAAC,iBAAiB,EAAE,oBAAQ,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IACzD,CAAC;IAES,iBAAiB,CAAC,UAAuB;QACjD,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AC,GAAG,CACtE,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC,IAAI,CAAC,CAC/B;YACD,UAAU,EAAE,YAAY;YACxB,cAAc,EAAE,UAAU,CAAC,SAAS;YACpC,WAAW;YACX,OAAO;YACP,UAAU;YACV,MAAM;YACN,QAAQ;YACR,IAAI,EAAE,IAAA,qBAAa,EAAC,IAAI,CAAC;SAC1B,CAAC;QAEF,MAAM,OAAO,GAAG,CAAC,GAAG,MAAa,EAAE,EAAE,CACnC,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CACvC,IAAI,CAAC,kBAAkB,EACvB,MAAM,CACP,CAAC;QACJ,wBAAwB;QACxB,OAAO;YACL,OAAO;YACP,MAAM,EAAE,CAAC,OAAO,CAAC;YACjB,UAAU;SACX,CAAC;IACJ,CAAC;;AA5GH,oCA6GC;AA5GQ,kBAAK,GAAG,IAAI,CAAC"}
@@ -5,14 +5,14 @@ export declare class TransactionBuilder {
5
5
  protected dexAdapterService: DexAdapterService;
6
6
  routerService: RouterService;
7
7
  constructor(dexAdapterService: DexAdapterService);
8
- build({ priceRoute, minMaxAmount, userAddress, referrerAddress, partnerAddress, partnerFeePercent, positiveSlippageToUser, gasPrice, maxFeePerGas, maxPriorityFeePerGas, permit, deadline, uuid, beneficiary, onlyParams, }: {
8
+ build({ priceRoute, minMaxAmount, userAddress, referrerAddress, partnerAddress, partnerFeePercent, takeSurplus, gasPrice, maxFeePerGas, maxPriorityFeePerGas, permit, deadline, uuid, beneficiary, onlyParams, }: {
9
9
  priceRoute: OptimalRate;
10
10
  minMaxAmount: string;
11
11
  userAddress: Address;
12
12
  referrerAddress?: Address;
13
13
  partnerAddress: Address;
14
14
  partnerFeePercent: string;
15
- positiveSlippageToUser?: boolean;
15
+ takeSurplus?: boolean;
16
16
  gasPrice?: string;
17
17
  maxFeePerGas?: string;
18
18
  maxPriorityFeePerGas?: string;
@@ -8,11 +8,11 @@ class TransactionBuilder {
8
8
  this.dexAdapterService = dexAdapterService;
9
9
  this.routerService = new router_1.RouterService(this.dexAdapterService);
10
10
  }
11
- async build({ priceRoute, minMaxAmount, userAddress, referrerAddress, partnerAddress, partnerFeePercent, positiveSlippageToUser, gasPrice, maxFeePerGas, maxPriorityFeePerGas, permit, deadline, uuid, beneficiary, onlyParams = false, }) {
11
+ async build({ priceRoute, minMaxAmount, userAddress, referrerAddress, partnerAddress, partnerFeePercent, takeSurplus, gasPrice, maxFeePerGas, maxPriorityFeePerGas, permit, deadline, uuid, beneficiary, onlyParams = false, }) {
12
12
  const _beneficiary = beneficiary || userAddress;
13
13
  const { encoder, params, networkFee } = await this.routerService
14
14
  .getRouterByContractMethod(priceRoute.contractMethod)
15
- .build(priceRoute, minMaxAmount, userAddress, referrerAddress, partnerAddress, partnerFeePercent, positiveSlippageToUser ?? true, _beneficiary, permit || '0x', deadline, uuid);
15
+ .build(priceRoute, minMaxAmount, userAddress, referrerAddress, partnerAddress, partnerFeePercent, takeSurplus ?? false, _beneficiary, permit || '0x', deadline, uuid);
16
16
  if (onlyParams)
17
17
  return params;
18
18
  const value = (priceRoute.srcToken.toLowerCase() === constants_1.ETHER_ADDRESS.toLowerCase()
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-builder.js","sourceRoot":"","sources":["../src/transaction-builder.ts"],"names":[],"mappings":";;;AACA,2CAAsD;AACtD,qCAAyC;AAGzC,MAAa,kBAAkB;IAG7B,YAAsB,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;QACxD,IAAI,CAAC,aAAa,GAAG,IAAI,sBAAa,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACjE,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,EACjB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,UAAU,GAA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ACF;AA/ED,gDA+EC"}
package/build/types.d.ts CHANGED
@@ -235,7 +235,6 @@ export declare type Config = {
235
235
  hashFlowDisabledMMs: string[];
236
236
  uniswapV3EventLoggingSampleRate?: number;
237
237
  swaapV2AuthToken?: string;
238
- dexalotAuthToken?: string;
239
238
  forceRpcFallbackDexs: string[];
240
239
  };
241
240
  export declare type BigIntAsString = string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraswap/dex-lib",
3
- "version": "2.37.6-dexalot",
3
+ "version": "2.37.7-baseswap.0",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "repository": "https://github.com/paraswap/paraswap-dex-lib",
package/src/config.ts CHANGED
@@ -30,7 +30,6 @@ type BaseConfig = {
30
30
  hashFlowAuthToken?: string;
31
31
  hashFlowDisabledMMs: string[];
32
32
  swaapV2AuthToken?: string;
33
- dexalotAuthToken?: string;
34
33
  forceRpcFallbackDexs: string[];
35
34
  };
36
35
 
@@ -220,11 +219,10 @@ const baseConfigs: { [network: number]: BaseConfig } = {
220
219
  hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
221
220
  hashFlowDisabledMMs:
222
221
  process.env[`HASHFLOW_DISABLED_MMS_43114`]?.split(',') || [],
223
- dexalotAuthToken: process.env.API_KEY_DEXALOT_AUTH_TOKEN || '',
224
222
  adapterAddresses: {
225
223
  AvalancheAdapter01: '0x745Ec73855CeC7249E5fF4c9DD81cc65b4D297a9',
226
- AvalancheAdapter02: '0x2cdB0cDc2a9321ac2ED5b741828a5216C265Be80',
227
- AvalancheBuyAdapter: '0x9Aa41A24A10af2a965A6D406b913a7Cd9C6886ea',
224
+ AvalancheAdapter02: '0xFb8773AA4Fd02e54bbd352061D8Be1911FAa210a',
225
+ AvalancheBuyAdapter: '0x434C1Cca4842629230067674Dd54E21a14D9FD5D',
228
226
  },
229
227
  uniswapV2ExchangeRouterAddress:
230
228
  '0x53e693c6C7FFC4446c53B205Cf513105Bf140D7b',
@@ -416,7 +414,6 @@ export function generateConfig(network: number): Config {
416
414
  baseConfig.rpcPollingBlocksBackToTriggerUpdate,
417
415
  hashFlowAuthToken: baseConfig.hashFlowAuthToken,
418
416
  swaapV2AuthToken: baseConfig.swaapV2AuthToken,
419
- dexalotAuthToken: baseConfig.dexalotAuthToken,
420
417
  hashFlowDisabledMMs: baseConfig.hashFlowDisabledMMs,
421
418
  forceRpcFallbackDexs: baseConfig.forceRpcFallbackDexs,
422
419
  };
package/src/dex/idex.ts CHANGED
@@ -131,11 +131,9 @@ export interface IDexPricing<ExchangeData> {
131
131
  blockNumber: number,
132
132
  // list of pool identifiers to use for pricing, if undefined use all pools
133
133
  limitPools?: string[],
134
-
135
134
  // I don't like putting this as new params, but in order to not change interface
136
135
  // across all integrations, done it like this
137
136
  transferFees?: TransferFeeParams,
138
- isFirstSwap?: boolean,
139
137
  ): Promise<ExchangePrices<ExchangeData> | null>;
140
138
 
141
139
  // Returns estimated gas cost for calldata for DEX when used in multiSwap.
package/src/dex/index.ts CHANGED
@@ -76,7 +76,6 @@ import { PancakeswapV3 } from './pancakeswap-v3/pancakeswap-v3';
76
76
  import { Algebra } from './algebra/algebra';
77
77
  import { QuickPerps } from './quick-perps/quick-perps';
78
78
  import { NomiswapV2 } from './uniswap-v2/nomiswap-v2';
79
- import { Dexalot } from './dexalot/dexalot';
80
79
 
81
80
  const LegacyDexes = [
82
81
  CurveV2,
@@ -103,7 +102,6 @@ const LegacyDexes = [
103
102
  ];
104
103
 
105
104
  const Dexes = [
106
- Dexalot,
107
105
  CurveV1,
108
106
  CurveFork,
109
107
  Swerve,
@@ -117,6 +117,20 @@ export const Adapters: {
117
117
  },
118
118
  ],
119
119
  },
120
+ [Network.BASE]: {
121
+ [SwapSide.SELL]: [
122
+ {
123
+ name: 'BaseAdapter01',
124
+ index: 6,
125
+ },
126
+ ],
127
+ [SwapSide.BUY]: [
128
+ {
129
+ name: 'BaseBuyAdapter',
130
+ index: 4,
131
+ },
132
+ ],
133
+ },
120
134
  };
121
135
 
122
136
  export const UniswapV2Config: DexConfigMap<DexParams> = {
@@ -696,4 +710,13 @@ export const UniswapV2Config: DexConfigMap<DexParams> = {
696
710
  feeCode: 30,
697
711
  },
698
712
  },
713
+ BaseSwap: {
714
+ [Network.BASE]: {
715
+ factoryAddress: '0xFDa619b6d20975be80A10332cD39b9a4b0FAa8BB',
716
+ initCode:
717
+ '0xb618a2730fae167f5f8ac7bd659dd8436d571872655bcb6fd11f2158c8a64a3b',
718
+ poolGasCost: 90 * 1000,
719
+ feeCode: 25,
720
+ },
721
+ },
699
722
  };
package/src/router/buy.ts CHANGED
@@ -42,7 +42,7 @@ export class Buy extends PayloadEncoder implements IRouter<BuyParam> {
42
42
  referrerAddress: Address | undefined,
43
43
  partnerAddress: Address,
44
44
  partnerFeePercent: string,
45
- positiveSlippageToUser: boolean,
45
+ takeSurplus: boolean,
46
46
  beneficiary: Address,
47
47
  permit: string,
48
48
  deadline: string,
@@ -69,13 +69,9 @@ export class Buy extends PayloadEncoder implements IRouter<BuyParam> {
69
69
  encodePartnerAddressForFeeLogic({
70
70
  partnerAddress,
71
71
  partnerFeePercent,
72
- positiveSlippageToUser,
72
+ takeSurplus,
73
73
  }),
74
- encodeFeePercent(
75
- partnerFeePercent,
76
- positiveSlippageToUser,
77
- SwapSide.BUY,
78
- ),
74
+ encodeFeePercent(partnerFeePercent, takeSurplus, SwapSide.BUY),
79
75
  ];
80
76
 
81
77
  const buyData: ContractBuyData = {
@@ -29,7 +29,7 @@ export class DirectSwap<DexDirectReturn> implements IRouter<DexDirectReturn> {
29
29
  referrerAddress: Address | undefined,
30
30
  partnerAddress: Address,
31
31
  partnerFeePercent: string,
32
- positiveSlippageToUser: boolean,
32
+ takeSurplus: boolean,
33
33
  beneficiary: Address,
34
34
  permit: string,
35
35
  deadline: string,
@@ -76,13 +76,9 @@ export class DirectSwap<DexDirectReturn> implements IRouter<DexDirectReturn> {
76
76
  encodePartnerAddressForFeeLogic({
77
77
  partnerAddress,
78
78
  partnerFeePercent,
79
- positiveSlippageToUser,
79
+ takeSurplus,
80
80
  }),
81
- encodeFeePercent(
82
- partnerFeePercent,
83
- positiveSlippageToUser,
84
- priceRoute.side,
85
- ),
81
+ encodeFeePercent(partnerFeePercent, takeSurplus, priceRoute.side),
86
82
  ];
87
83
 
88
84
  return dex.getDirectParam!(
@@ -9,7 +9,7 @@ export interface IRouter<RouterParam> {
9
9
  referrerAddress: Address | undefined,
10
10
  partner: Address,
11
11
  partnerFeePercent: string,
12
- positiveSlippageToUser: boolean,
12
+ takeSurplus: boolean,
13
13
  beneficiary: Address,
14
14
  permit: string,
15
15
  deadline: string,
@@ -42,7 +42,7 @@ export class MegaSwap extends PayloadEncoder implements IRouter<MegaSwapParam> {
42
42
  referrerAddress: Address | undefined,
43
43
  partnerAddress: Address,
44
44
  partnerFeePercent: string,
45
- positiveSlippageToUser: boolean,
45
+ takeSurplus: boolean,
46
46
  beneficiary: Address,
47
47
  permit: string,
48
48
  deadline: string,
@@ -58,13 +58,9 @@ export class MegaSwap extends PayloadEncoder implements IRouter<MegaSwapParam> {
58
58
  encodePartnerAddressForFeeLogic({
59
59
  partnerAddress,
60
60
  partnerFeePercent,
61
- positiveSlippageToUser,
61
+ takeSurplus,
62
62
  }),
63
- encodeFeePercent(
64
- partnerFeePercent,
65
- positiveSlippageToUser,
66
- SwapSide.SELL,
67
- ),
63
+ encodeFeePercent(partnerFeePercent, takeSurplus, SwapSide.SELL),
68
64
  ];
69
65
 
70
66
  const sellData: ContractMegaSwapSellData = {
@@ -45,7 +45,7 @@ export class MultiSwap
45
45
  referrerAddress: Address | undefined,
46
46
  partnerAddress: Address,
47
47
  partnerFeePercent: string,
48
- positiveSlippageToUser: boolean,
48
+ takeSurplus: boolean,
49
49
  beneficiary: Address,
50
50
  permit: string,
51
51
  deadline: string,
@@ -66,13 +66,9 @@ export class MultiSwap
66
66
  encodePartnerAddressForFeeLogic({
67
67
  partnerAddress,
68
68
  partnerFeePercent,
69
- positiveSlippageToUser,
69
+ takeSurplus,
70
70
  }),
71
- encodeFeePercent(
72
- partnerFeePercent,
73
- positiveSlippageToUser,
74
- SwapSide.SELL,
75
- ),
71
+ encodeFeePercent(partnerFeePercent, takeSurplus, SwapSide.SELL),
76
72
  ];
77
73
 
78
74
  const sellData: ContractSellData = {
@@ -29,14 +29,14 @@ const HALF_SPLIT = '5000';
29
29
  export function encodePartnerAddressForFeeLogic({
30
30
  partnerAddress,
31
31
  partnerFeePercent,
32
- positiveSlippageToUser,
32
+ takeSurplus,
33
33
  }: {
34
34
  partnerAddress: string;
35
35
  partnerFeePercent: string;
36
- positiveSlippageToUser: boolean;
36
+ takeSurplus: boolean;
37
37
  }): string {
38
38
  const isPartnerTakeNoFeeNoPos =
39
- +partnerFeePercent === 0 && positiveSlippageToUser == true;
39
+ +partnerFeePercent === 0 && takeSurplus == false;
40
40
 
41
41
  // nullify partner address to fallback default circuit contract without partner/referrer (no harm as no fee taken at all)
42
42
  const partner = isPartnerTakeNoFeeNoPos ? NULL_ADDRESS : partnerAddress;
@@ -51,11 +51,11 @@ export function encodePartnerAddressForFeeLogic({
51
51
 
52
52
  export function encodeFeePercent(
53
53
  partnerFeePercent: string,
54
- positiveSlippageToUser: boolean,
54
+ takeSurplus: boolean,
55
55
  side: SwapSide,
56
56
  ) {
57
57
  const isNoFeeAndPositiveSlippageToPartner =
58
- positiveSlippageToUser === false && BigInt(partnerFeePercent) === 0n;
58
+ takeSurplus === true && BigInt(partnerFeePercent) === 0n;
59
59
 
60
60
  let fee = isNoFeeAndPositiveSlippageToPartner
61
61
  ? BigInt(HALF_SPLIT)
@@ -70,9 +70,9 @@ export function encodeFeePercent(
70
70
  fee |= OneShift17;
71
71
  }
72
72
 
73
- // Set 14th bit if positiveSlippageToUser is true
73
+ // Set 14th bit if takeSurplus is false
74
74
  // Upd: not used onchain anymore but better to keep to prevent collisions and ensure continuity of analytics
75
- if (positiveSlippageToUser) fee |= OneShift14;
75
+ if (!takeSurplus) fee |= OneShift14;
76
76
 
77
77
  // Set 15th bit to take fee from srcToken
78
78
  if (side === SwapSide.BUY && !isNoFeeAndPositiveSlippageToPartner)
@@ -223,7 +223,7 @@ export abstract class SimpleRouterBase<RouterParam>
223
223
  referrerAddress: Address | undefined,
224
224
  partnerAddress: Address,
225
225
  partnerFeePercent: string,
226
- positiveSlippageToUser: boolean,
226
+ takeSurplus: boolean,
227
227
  beneficiary: Address,
228
228
  permit: string,
229
229
  deadline: string,
@@ -272,7 +272,7 @@ export abstract class SimpleRouter extends SimpleRouterBase<SimpleSwapParam> {
272
272
  referrerAddress: Address | undefined,
273
273
  partnerAddress: Address,
274
274
  partnerFeePercent: string,
275
- positiveSlippageToUser: boolean,
275
+ takeSurplus: boolean,
276
276
  beneficiary: Address,
277
277
  permit: string,
278
278
  deadline: string,
@@ -292,13 +292,9 @@ export abstract class SimpleRouter extends SimpleRouterBase<SimpleSwapParam> {
292
292
  encodePartnerAddressForFeeLogic({
293
293
  partnerAddress,
294
294
  partnerFeePercent,
295
- positiveSlippageToUser,
295
+ takeSurplus,
296
296
  }),
297
- encodeFeePercent(
298
- partnerFeePercent,
299
- positiveSlippageToUser,
300
- this.side,
301
- ),
297
+ encodeFeePercent(partnerFeePercent, takeSurplus, this.side),
302
298
  ];
303
299
 
304
300
  const sellData: ConstractSimpleData = {
@@ -60,7 +60,7 @@ export class SimpleBuyNFT extends SimpleRouterBase<SimpleBuyNFTParam> {
60
60
  referrerAddress: Address | undefined,
61
61
  partnerAddress: Address,
62
62
  partnerFeePercent: string,
63
- positiveSlippageToUser: boolean,
63
+ takeSurplus: boolean,
64
64
  beneficiary: Address,
65
65
  permit: string,
66
66
  deadline: string,
@@ -102,13 +102,9 @@ export class SimpleBuyNFT extends SimpleRouterBase<SimpleBuyNFTParam> {
102
102
  encodePartnerAddressForFeeLogic({
103
103
  partnerAddress,
104
104
  partnerFeePercent,
105
- positiveSlippageToUser,
105
+ takeSurplus,
106
106
  }),
107
- encodeFeePercent(
108
- partnerFeePercent,
109
- positiveSlippageToUser,
110
- SwapSide.BUY,
111
- ),
107
+ encodeFeePercent(partnerFeePercent, takeSurplus, SwapSide.BUY),
112
108
  ];
113
109
 
114
110
  const buyData: ContractSimpleBuyNFTData = {
@@ -17,7 +17,7 @@ export class TransactionBuilder {
17
17
  referrerAddress,
18
18
  partnerAddress,
19
19
  partnerFeePercent,
20
- positiveSlippageToUser,
20
+ takeSurplus,
21
21
  gasPrice,
22
22
  maxFeePerGas,
23
23
  maxPriorityFeePerGas,
@@ -33,7 +33,7 @@ export class TransactionBuilder {
33
33
  referrerAddress?: Address;
34
34
  partnerAddress: Address;
35
35
  partnerFeePercent: string;
36
- positiveSlippageToUser?: boolean;
36
+ takeSurplus?: boolean;
37
37
  gasPrice?: string; // // @TODO: improve types? so that either gasPrice or ALL of max.*FeePerGas MUST be returned?
38
38
  maxFeePerGas?: string;
39
39
  maxPriorityFeePerGas?: string;
@@ -53,7 +53,7 @@ export class TransactionBuilder {
53
53
  referrerAddress,
54
54
  partnerAddress,
55
55
  partnerFeePercent,
56
- positiveSlippageToUser ?? true,
56
+ takeSurplus ?? false,
57
57
  _beneficiary,
58
58
  permit || '0x',
59
59
  deadline,
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
 
@@ -1065,7 +1065,7 @@ export const Holders: {
1065
1065
  BETS: '0x8cc2284c90d05578633418f9cde104f402375a65',
1066
1066
  HATCHY: '0x14ec295ec8def851ec6e2959df872dd24e422631',
1067
1067
  USDCe: '0x3a2434c698f8d79af1f5a9e43013157ca8b11a66',
1068
- USDC: '0x0d0707963952f2fba59dd06f2b425ace40b492fe',
1068
+ USDC: '0xbf14db80d9275fb721383a77c00ae180fc40ae98',
1069
1069
  USDTe: '0x84d34f4f83a87596cd3fb6887cff8f17bf5a7b83',
1070
1070
  WETHe: '0xD291B51f7a1a1F4917D085F2a7731A447E4aF82D',
1071
1071
  POPS: '0x5268c2331658cb0b2858cfa9db27d8f22f5434bc',
@@ -1081,7 +1081,7 @@ export const Holders: {
1081
1081
  TSD: '0x691A89db352B72dDb249bFe16503494eC0D920A4',
1082
1082
  THO: '0xc40d16c47394a506d451475c8a7c46c1175c1da1',
1083
1083
  aAvaUSDT: '0x50B1Ba98Cf117c9682048D56628B294ebbAA4ec2',
1084
- USDT: '0x764fe7fb23f0f995c45faef5e32a4526f2028814',
1084
+ USDT: '0x4aeFa39caEAdD662aE31ab0CE7c8C2c9c0a013E8',
1085
1085
  aAvaWAVAX: '0x1B18Df70863636AEe4BfBAb6F7C70ceBCA9bA404',
1086
1086
  oldFRAX: '0x4e3376018add04ebe4c46bf6f924ddec8c67aa7b',
1087
1087
  newFRAX: '0x4e3376018add04ebe4c46bf6f924ddec8c67aa7b',
package/.idea/aws.xml DELETED
@@ -1,17 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="accountSettings">
4
- <option name="activeProfile" value="profile:default" />
5
- <option name="activeRegion" value="us-east-1" />
6
- <option name="recentlyUsedProfiles">
7
- <list>
8
- <option value="profile:default" />
9
- </list>
10
- </option>
11
- <option name="recentlyUsedRegions">
12
- <list>
13
- <option value="us-east-1" />
14
- </list>
15
- </option>
16
- </component>
17
- </project>
@@ -1,19 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <code_scheme name="Project" version="173">
3
- <ScalaCodeStyleSettings>
4
- <option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
5
- </ScalaCodeStyleSettings>
6
- <TypeScriptCodeStyleSettings version="0">
7
- <option name="SPACE_WITHIN_ARRAY_INITIALIZER_BRACKETS" value="true" />
8
- <option name="USE_DOUBLE_QUOTES" value="false" />
9
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
10
- </TypeScriptCodeStyleSettings>
11
- <codeStyleSettings language="TypeScript">
12
- <indentOptions>
13
- <option name="INDENT_SIZE" value="2" />
14
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
15
- <option name="TAB_SIZE" value="2" />
16
- </indentOptions>
17
- </codeStyleSettings>
18
- </code_scheme>
19
- </component>
@@ -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$/.idea/paraswap-dex-lib.iml" filepath="$PROJECT_DIR$/.idea/paraswap-dex-lib.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="JAVA_MODULE" version="4">
3
- <component name="NewModuleRootManager" inherit-compiler-output="true">
4
- <exclude-output />
5
- <content url="file://$MODULE_DIR$" />
6
- <orderEntry type="inheritedJdk" />
7
- <orderEntry type="sourceFolder" forTests="false" />
8
- </component>
9
- </module>
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>