@paraswap/dex-lib 4.1.15 → 4.1.16

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 (244) hide show
  1. package/.vscode/launch.json +53 -0
  2. package/.vscode/settings.json +2 -0
  3. package/.vscode/tasks.json +15 -0
  4. package/build/abi/{integral/pool.json → inception/inception-ineth-pool.json} +558 -537
  5. package/build/abi/inception/inception-ratio-feed.json +329 -0
  6. package/build/abi/inception/inception-vault.json +991 -0
  7. package/build/abi/uniswap-v3/AlienBaseV3Router.abi.json +52 -0
  8. package/build/abi/usual-m-smart-m/usualM.abi.json +483 -0
  9. package/build/abi/{integral/relayer.json → wombat/pool.json} +474 -721
  10. package/build/dex/aave-v1/aave-v1.d.ts +2 -1
  11. package/build/dex/aave-v1/aave-v1.js +23 -0
  12. package/build/dex/aave-v1/aave-v1.js.map +1 -1
  13. package/build/dex/aave-v2/tokens-avalanche.json +44 -0
  14. package/build/dex/aave-v2/tokens-mainnet.json +188 -0
  15. package/build/dex/aave-v2/tokens-polygon.json +44 -0
  16. package/build/dex/balancer-v3/abi/balancerBatchRouter.d.ts +729 -0
  17. package/build/dex/balancer-v3/abi/balancerBatchRouter.js +732 -0
  18. package/build/dex/balancer-v3/abi/balancerBatchRouter.js.map +1 -0
  19. package/build/dex/balancer-v3/abi/balancerRouter.d.ts +1406 -0
  20. package/build/dex/balancer-v3/abi/balancerRouter.js +1175 -0
  21. package/build/dex/balancer-v3/abi/balancerRouter.js.map +1 -0
  22. package/build/dex/balancer-v3/abi/vaultExtension.V3.d.ts +2081 -0
  23. package/build/dex/balancer-v3/abi/vaultExtension.V3.js +1851 -0
  24. package/build/dex/balancer-v3/abi/vaultExtension.V3.js.map +1 -0
  25. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.d.ts +34 -0
  26. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js +406 -0
  27. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js.map +1 -0
  28. package/build/dex/balancer-v3/gyroECLPPool.d.ts +11 -0
  29. package/build/dex/balancer-v3/gyroECLPPool.js +6 -0
  30. package/build/dex/balancer-v3/gyroECLPPool.js.map +1 -0
  31. package/build/dex/balancer-v3/utils.d.ts +2 -0
  32. package/build/dex/balancer-v3/utils.js +11 -0
  33. package/build/dex/balancer-v3/utils.js.map +1 -0
  34. package/build/dex/erc4626/scripts/validate-state.d.ts +0 -0
  35. package/build/dex/erc4626/scripts/validate-state.js +146 -0
  36. package/build/dex/erc4626/scripts/validate-state.js.map +1 -0
  37. package/build/dex/inception/config.d.ts +4 -0
  38. package/build/dex/inception/config.js +109 -0
  39. package/build/dex/inception/config.js.map +1 -0
  40. package/build/dex/inception/inception-event-pool.d.ts +16 -0
  41. package/build/dex/inception/inception-event-pool.js +49 -0
  42. package/build/dex/inception/inception-event-pool.js.map +1 -0
  43. package/build/dex/inception/inception.d.ts +43 -0
  44. package/build/dex/inception/inception.js +180 -0
  45. package/build/dex/inception/inception.js.map +1 -0
  46. package/build/dex/inception/tokens.d.ts +9 -0
  47. package/build/dex/inception/tokens.js +28 -0
  48. package/build/dex/inception/tokens.js.map +1 -0
  49. package/build/dex/inception/types.d.ts +22 -0
  50. package/build/dex/{m-token → inception}/types.js.map +1 -1
  51. package/build/dex/inception/utils.d.ts +7 -0
  52. package/build/dex/inception/utils.js +58 -0
  53. package/build/dex/inception/utils.js.map +1 -0
  54. package/build/dex/jarvis.d.ts +2 -1
  55. package/build/dex/jarvis.js +58 -0
  56. package/build/dex/jarvis.js.map +1 -1
  57. package/build/dex/maker-psm/scripts/gem.abi.json +136 -0
  58. package/build/dex/maker-psm/scripts/validate-state.d.ts +0 -0
  59. package/build/dex/maker-psm/scripts/validate-state.js +185 -0
  60. package/build/dex/maker-psm/scripts/validate-state.js.map +1 -0
  61. package/build/dex/maker-psm/scripts/vat.abi.json +243 -0
  62. package/build/dex/maverick-v2/maverick-v2-pool.js +2 -2
  63. package/build/dex/maverick-v2/maverick-v2-pool.js.map +1 -1
  64. package/build/dex/platypus/platypus.d.ts +2 -1
  65. package/build/dex/platypus/platypus.js +45 -0
  66. package/build/dex/platypus/platypus.js.map +1 -1
  67. package/build/dex/solidly-v3/scripts/check-event-pool-event.d.ts +1 -0
  68. package/build/dex/solidly-v3/scripts/check-event-pool-event.js +53 -0
  69. package/build/dex/solidly-v3/scripts/check-event-pool-event.js.map +1 -0
  70. package/build/dex/stable-pool.js +1 -8
  71. package/build/dex/stable-pool.js.map +1 -1
  72. package/build/dex/swaap-v1/swaap-v1.d.ts +2 -1
  73. package/build/dex/swaap-v1/swaap-v1.js +14 -0
  74. package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
  75. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.d.ts +17 -0
  76. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js +64 -0
  77. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js.map +1 -0
  78. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.d.ts +17 -0
  79. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js +79 -0
  80. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js.map +1 -0
  81. package/build/dex/uniswap-v3/uniswap-v3-pricing.d.ts +4 -0
  82. package/build/dex/uniswap-v3/uniswap-v3-pricing.js +43 -0
  83. package/build/dex/uniswap-v3/uniswap-v3-pricing.js.map +1 -0
  84. package/build/dex/uniswap-v3/uniswap-v3-worker.d.ts +1 -0
  85. package/build/dex/uniswap-v3/uniswap-v3-worker.js +10 -0
  86. package/build/dex/uniswap-v3/uniswap-v3-worker.js.map +1 -0
  87. package/build/dex/uniswap-v4/config.js +0 -43
  88. package/build/dex/uniswap-v4/config.js.map +1 -1
  89. package/build/dex/uniswap-v4/encoder.js +2 -12
  90. package/build/dex/uniswap-v4/encoder.js.map +1 -1
  91. package/build/dex/uniswap-v4/types.d.ts +4 -72
  92. package/build/dex/uniswap-v4/uniswap-v4.d.ts +6 -6
  93. package/build/dex/uniswap-v4/uniswap-v4.js +47 -29
  94. package/build/dex/uniswap-v4/uniswap-v4.js.map +1 -1
  95. package/build/dex/usual/usual-m-smart-m.d.ts +17 -0
  96. package/build/dex/usual/usual-m-smart-m.js +50 -0
  97. package/build/dex/usual/usual-m-smart-m.js.map +1 -0
  98. package/build/dex/usual-m-smart-m/config.d.ts +3 -0
  99. package/build/dex/usual-m-smart-m/config.js +13 -0
  100. package/build/dex/usual-m-smart-m/config.js.map +1 -0
  101. package/build/dex/usual-m-smart-m/types.d.ts +7 -0
  102. package/build/dex/usual-m-smart-m/types.js +3 -0
  103. package/build/dex/usual-m-smart-m/types.js.map +1 -0
  104. package/build/dex/usual-m-smart-m/usual-m-smart-m.d.ts +35 -0
  105. package/build/dex/usual-m-smart-m/usual-m-smart-m.js +161 -0
  106. package/build/dex/usual-m-smart-m/usual-m-smart-m.js.map +1 -0
  107. package/build/dex/{m-token → usual-m-usd0}/config.d.ts +2 -2
  108. package/build/dex/usual-m-usd0/config.js +14 -0
  109. package/build/dex/usual-m-usd0/config.js.map +1 -0
  110. package/build/dex/usual-m-usd0/types.d.ts +8 -0
  111. package/build/dex/usual-m-usd0/types.js +3 -0
  112. package/build/dex/usual-m-usd0/types.js.map +1 -0
  113. package/build/dex/usual-m-usd0/usual-m-usd0.d.ts +35 -0
  114. package/build/dex/usual-m-usd0/usual-m-usd0.js +159 -0
  115. package/build/dex/usual-m-usd0/usual-m-usd0.js.map +1 -0
  116. package/build/dex/zerox/index.d.ts +4 -26
  117. package/build/dex/zerox/index.js +50 -42
  118. package/build/dex/zerox/index.js.map +1 -1
  119. package/build/dex/zerox/types.d.ts +29 -0
  120. package/build/dex/zerox/types.js +8 -1
  121. package/build/dex/zerox/types.js.map +1 -1
  122. package/package.json +1 -1
  123. package/src/dex/maverick-v2/maverick-v2-pool.ts +2 -2
  124. package/.idea/aws.xml +0 -17
  125. package/.idea/codeStyles/Project.xml +0 -19
  126. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  127. package/.idea/misc.xml +0 -6
  128. package/.idea/modules.xml +0 -8
  129. package/.idea/paraswap-dex-lib.iml +0 -9
  130. package/.idea/prettier.xml +0 -7
  131. package/.idea/vcs.xml +0 -6
  132. package/build/abi/integral/factory.json +0 -333
  133. package/build/abi/integral/oracle.json +0 -501
  134. package/build/abi/uniswap-v4/pool-manager.abi.json +0 -1366
  135. package/build/abi/uniswap-v4/state-view.abi.json +0 -365
  136. package/build/dex/fluid-dex/fluid-dex-generate-pool.d.ts +0 -49
  137. package/build/dex/fluid-dex/fluid-dex-generate-pool.js +0 -104
  138. package/build/dex/fluid-dex/fluid-dex-generate-pool.js.map +0 -1
  139. package/build/dex/integral/config.d.ts +0 -4
  140. package/build/dex/integral/config.js +0 -20
  141. package/build/dex/integral/config.js.map +0 -1
  142. package/build/dex/integral/context.d.ts +0 -40
  143. package/build/dex/integral/context.js +0 -158
  144. package/build/dex/integral/context.js.map +0 -1
  145. package/build/dex/integral/integral-factory.d.ts +0 -24
  146. package/build/dex/integral/integral-factory.js +0 -95
  147. package/build/dex/integral/integral-factory.js.map +0 -1
  148. package/build/dex/integral/integral-pool.d.ts +0 -50
  149. package/build/dex/integral/integral-pool.js +0 -149
  150. package/build/dex/integral/integral-pool.js.map +0 -1
  151. package/build/dex/integral/integral-pricing.d.ts +0 -18
  152. package/build/dex/integral/integral-pricing.js +0 -114
  153. package/build/dex/integral/integral-pricing.js.map +0 -1
  154. package/build/dex/integral/integral-relayer.d.ts +0 -42
  155. package/build/dex/integral/integral-relayer.js +0 -192
  156. package/build/dex/integral/integral-relayer.js.map +0 -1
  157. package/build/dex/integral/integral-token.d.ts +0 -27
  158. package/build/dex/integral/integral-token.js +0 -59
  159. package/build/dex/integral/integral-token.js.map +0 -1
  160. package/build/dex/integral/integral.d.ts +0 -41
  161. package/build/dex/integral/integral.js +0 -376
  162. package/build/dex/integral/integral.js.map +0 -1
  163. package/build/dex/integral/types.d.ts +0 -85
  164. package/build/dex/integral/types.js +0 -9
  165. package/build/dex/integral/types.js.map +0 -1
  166. package/build/dex/integral/utils-e2e.d.ts +0 -9
  167. package/build/dex/integral/utils-e2e.js +0 -131
  168. package/build/dex/integral/utils-e2e.js.map +0 -1
  169. package/build/dex/integral/utils.d.ts +0 -17
  170. package/build/dex/integral/utils.js +0 -94
  171. package/build/dex/integral/utils.js.map +0 -1
  172. package/build/dex/m-token/config.js +0 -19
  173. package/build/dex/m-token/config.js.map +0 -1
  174. package/build/dex/m-token/m-token.d.ts +0 -29
  175. package/build/dex/m-token/m-token.js +0 -145
  176. package/build/dex/m-token/m-token.js.map +0 -1
  177. package/build/dex/m-token/m-wrapped-m.d.ts +0 -17
  178. package/build/dex/m-token/m-wrapped-m.js +0 -50
  179. package/build/dex/m-token/m-wrapped-m.js.map +0 -1
  180. package/build/dex/m-token/types.d.ts +0 -12
  181. package/build/dex/spark/susds-psm.d.ts +0 -49
  182. package/build/dex/spark/susds-psm.js +0 -245
  183. package/build/dex/spark/susds-psm.js.map +0 -1
  184. package/build/dex/trader-joe-v2.1/optimizer.d.ts +0 -2
  185. package/build/dex/trader-joe-v2.1/optimizer.js +0 -47
  186. package/build/dex/trader-joe-v2.1/optimizer.js.map +0 -1
  187. package/build/dex/uniswap-v4/constants.d.ts +0 -7
  188. package/build/dex/uniswap-v4/constants.js +0 -18
  189. package/build/dex/uniswap-v4/constants.js.map +0 -1
  190. package/build/dex/uniswap-v4/contract-math/BitMath.d.ts +0 -4
  191. package/build/dex/uniswap-v4/contract-math/BitMath.js +0 -53
  192. package/build/dex/uniswap-v4/contract-math/BitMath.js.map +0 -1
  193. package/build/dex/uniswap-v4/contract-math/FixedPoint128.d.ts +0 -3
  194. package/build/dex/uniswap-v4/contract-math/FixedPoint128.js +0 -8
  195. package/build/dex/uniswap-v4/contract-math/FixedPoint128.js.map +0 -1
  196. package/build/dex/uniswap-v4/contract-math/FixedPoint96.d.ts +0 -4
  197. package/build/dex/uniswap-v4/contract-math/FixedPoint96.js +0 -9
  198. package/build/dex/uniswap-v4/contract-math/FixedPoint96.js.map +0 -1
  199. package/build/dex/uniswap-v4/contract-math/FullMath.d.ts +0 -4
  200. package/build/dex/uniswap-v4/contract-math/FullMath.js +0 -19
  201. package/build/dex/uniswap-v4/contract-math/FullMath.js.map +0 -1
  202. package/build/dex/uniswap-v4/contract-math/LiquidityMath.d.ts +0 -3
  203. package/build/dex/uniswap-v4/contract-math/LiquidityMath.js +0 -18
  204. package/build/dex/uniswap-v4/contract-math/LiquidityMath.js.map +0 -1
  205. package/build/dex/uniswap-v4/contract-math/Position.d.ts +0 -9
  206. package/build/dex/uniswap-v4/contract-math/Position.js +0 -39
  207. package/build/dex/uniswap-v4/contract-math/Position.js.map +0 -1
  208. package/build/dex/uniswap-v4/contract-math/SqrtPriceMath.d.ts +0 -11
  209. package/build/dex/uniswap-v4/contract-math/SqrtPriceMath.js +0 -80
  210. package/build/dex/uniswap-v4/contract-math/SqrtPriceMath.js.map +0 -1
  211. package/build/dex/uniswap-v4/contract-math/SwapMath.d.ts +0 -8
  212. package/build/dex/uniswap-v4/contract-math/SwapMath.js +0 -70
  213. package/build/dex/uniswap-v4/contract-math/SwapMath.js.map +0 -1
  214. package/build/dex/uniswap-v4/contract-math/Tick.d.ts +0 -9
  215. package/build/dex/uniswap-v4/contract-math/Tick.js +0 -40
  216. package/build/dex/uniswap-v4/contract-math/Tick.js.map +0 -1
  217. package/build/dex/uniswap-v4/contract-math/TickBitMap.d.ts +0 -8
  218. package/build/dex/uniswap-v4/contract-math/TickBitMap.js +0 -40
  219. package/build/dex/uniswap-v4/contract-math/TickBitMap.js.map +0 -1
  220. package/build/dex/uniswap-v4/contract-math/TickMath.d.ts +0 -9
  221. package/build/dex/uniswap-v4/contract-math/TickMath.js +0 -164
  222. package/build/dex/uniswap-v4/contract-math/TickMath.js.map +0 -1
  223. package/build/dex/uniswap-v4/contract-math/UnsafeMath.d.ts +0 -4
  224. package/build/dex/uniswap-v4/contract-math/UnsafeMath.js +0 -16
  225. package/build/dex/uniswap-v4/contract-math/UnsafeMath.js.map +0 -1
  226. package/build/dex/uniswap-v4/contract-math/uniswap-v4-math.d.ts +0 -8
  227. package/build/dex/uniswap-v4/contract-math/uniswap-v4-math.js +0 -11
  228. package/build/dex/uniswap-v4/contract-math/uniswap-v4-math.js.map +0 -1
  229. package/build/dex/uniswap-v4/contract-math/uniswap-v4-pool-math.d.ts +0 -15
  230. package/build/dex/uniswap-v4/contract-math/uniswap-v4-pool-math.js +0 -108
  231. package/build/dex/uniswap-v4/contract-math/uniswap-v4-pool-math.js.map +0 -1
  232. package/build/dex/uniswap-v4/contract-math/utils.d.ts +0 -4
  233. package/build/dex/uniswap-v4/contract-math/utils.js +0 -23
  234. package/build/dex/uniswap-v4/contract-math/utils.js.map +0 -1
  235. package/build/dex/uniswap-v4/subgraph.d.ts +0 -5
  236. package/build/dex/uniswap-v4/subgraph.js +0 -80
  237. package/build/dex/uniswap-v4/subgraph.js.map +0 -1
  238. package/build/dex/uniswap-v4/uniswap-v4-pool-manager.d.ts +0 -33
  239. package/build/dex/uniswap-v4/uniswap-v4-pool-manager.js +0 -260
  240. package/build/dex/uniswap-v4/uniswap-v4-pool-manager.js.map +0 -1
  241. package/build/dex/uniswap-v4/utils.d.ts +0 -2
  242. package/build/dex/uniswap-v4/utils.js +0 -15
  243. package/build/dex/uniswap-v4/utils.js.map +0 -1
  244. /package/build/dex/{m-token → inception}/types.js +0 -0
@@ -1,365 +0,0 @@
1
- [
2
- {
3
- "inputs": [
4
- {
5
- "internalType": "contract IPoolManager",
6
- "name": "_poolManager",
7
- "type": "address"
8
- }
9
- ],
10
- "stateMutability": "nonpayable",
11
- "type": "constructor"
12
- },
13
- {
14
- "inputs": [
15
- {
16
- "internalType": "PoolId",
17
- "name": "poolId",
18
- "type": "bytes32"
19
- }
20
- ],
21
- "name": "getFeeGrowthGlobals",
22
- "outputs": [
23
- {
24
- "internalType": "uint256",
25
- "name": "feeGrowthGlobal0",
26
- "type": "uint256"
27
- },
28
- {
29
- "internalType": "uint256",
30
- "name": "feeGrowthGlobal1",
31
- "type": "uint256"
32
- }
33
- ],
34
- "stateMutability": "view",
35
- "type": "function"
36
- },
37
- {
38
- "inputs": [
39
- {
40
- "internalType": "PoolId",
41
- "name": "poolId",
42
- "type": "bytes32"
43
- },
44
- {
45
- "internalType": "int24",
46
- "name": "tickLower",
47
- "type": "int24"
48
- },
49
- {
50
- "internalType": "int24",
51
- "name": "tickUpper",
52
- "type": "int24"
53
- }
54
- ],
55
- "name": "getFeeGrowthInside",
56
- "outputs": [
57
- {
58
- "internalType": "uint256",
59
- "name": "feeGrowthInside0X128",
60
- "type": "uint256"
61
- },
62
- {
63
- "internalType": "uint256",
64
- "name": "feeGrowthInside1X128",
65
- "type": "uint256"
66
- }
67
- ],
68
- "stateMutability": "view",
69
- "type": "function"
70
- },
71
- {
72
- "inputs": [
73
- {
74
- "internalType": "PoolId",
75
- "name": "poolId",
76
- "type": "bytes32"
77
- }
78
- ],
79
- "name": "getLiquidity",
80
- "outputs": [
81
- {
82
- "internalType": "uint128",
83
- "name": "liquidity",
84
- "type": "uint128"
85
- }
86
- ],
87
- "stateMutability": "view",
88
- "type": "function"
89
- },
90
- {
91
- "inputs": [
92
- {
93
- "internalType": "PoolId",
94
- "name": "poolId",
95
- "type": "bytes32"
96
- },
97
- {
98
- "internalType": "bytes32",
99
- "name": "positionId",
100
- "type": "bytes32"
101
- }
102
- ],
103
- "name": "getPositionInfo",
104
- "outputs": [
105
- {
106
- "internalType": "uint128",
107
- "name": "liquidity",
108
- "type": "uint128"
109
- },
110
- {
111
- "internalType": "uint256",
112
- "name": "feeGrowthInside0LastX128",
113
- "type": "uint256"
114
- },
115
- {
116
- "internalType": "uint256",
117
- "name": "feeGrowthInside1LastX128",
118
- "type": "uint256"
119
- }
120
- ],
121
- "stateMutability": "view",
122
- "type": "function"
123
- },
124
- {
125
- "inputs": [
126
- {
127
- "internalType": "PoolId",
128
- "name": "poolId",
129
- "type": "bytes32"
130
- },
131
- {
132
- "internalType": "address",
133
- "name": "owner",
134
- "type": "address"
135
- },
136
- {
137
- "internalType": "int24",
138
- "name": "tickLower",
139
- "type": "int24"
140
- },
141
- {
142
- "internalType": "int24",
143
- "name": "tickUpper",
144
- "type": "int24"
145
- },
146
- {
147
- "internalType": "bytes32",
148
- "name": "salt",
149
- "type": "bytes32"
150
- }
151
- ],
152
- "name": "getPositionInfo",
153
- "outputs": [
154
- {
155
- "internalType": "uint128",
156
- "name": "liquidity",
157
- "type": "uint128"
158
- },
159
- {
160
- "internalType": "uint256",
161
- "name": "feeGrowthInside0LastX128",
162
- "type": "uint256"
163
- },
164
- {
165
- "internalType": "uint256",
166
- "name": "feeGrowthInside1LastX128",
167
- "type": "uint256"
168
- }
169
- ],
170
- "stateMutability": "view",
171
- "type": "function"
172
- },
173
- {
174
- "inputs": [
175
- {
176
- "internalType": "PoolId",
177
- "name": "poolId",
178
- "type": "bytes32"
179
- },
180
- {
181
- "internalType": "bytes32",
182
- "name": "positionId",
183
- "type": "bytes32"
184
- }
185
- ],
186
- "name": "getPositionLiquidity",
187
- "outputs": [
188
- {
189
- "internalType": "uint128",
190
- "name": "liquidity",
191
- "type": "uint128"
192
- }
193
- ],
194
- "stateMutability": "view",
195
- "type": "function"
196
- },
197
- {
198
- "inputs": [
199
- {
200
- "internalType": "PoolId",
201
- "name": "poolId",
202
- "type": "bytes32"
203
- }
204
- ],
205
- "name": "getSlot0",
206
- "outputs": [
207
- {
208
- "internalType": "uint160",
209
- "name": "sqrtPriceX96",
210
- "type": "uint160"
211
- },
212
- {
213
- "internalType": "int24",
214
- "name": "tick",
215
- "type": "int24"
216
- },
217
- {
218
- "internalType": "uint24",
219
- "name": "protocolFee",
220
- "type": "uint24"
221
- },
222
- {
223
- "internalType": "uint24",
224
- "name": "lpFee",
225
- "type": "uint24"
226
- }
227
- ],
228
- "stateMutability": "view",
229
- "type": "function"
230
- },
231
- {
232
- "inputs": [
233
- {
234
- "internalType": "PoolId",
235
- "name": "poolId",
236
- "type": "bytes32"
237
- },
238
- {
239
- "internalType": "int16",
240
- "name": "tick",
241
- "type": "int16"
242
- }
243
- ],
244
- "name": "getTickBitmap",
245
- "outputs": [
246
- {
247
- "internalType": "uint256",
248
- "name": "tickBitmap",
249
- "type": "uint256"
250
- }
251
- ],
252
- "stateMutability": "view",
253
- "type": "function"
254
- },
255
- {
256
- "inputs": [
257
- {
258
- "internalType": "PoolId",
259
- "name": "poolId",
260
- "type": "bytes32"
261
- },
262
- {
263
- "internalType": "int24",
264
- "name": "tick",
265
- "type": "int24"
266
- }
267
- ],
268
- "name": "getTickFeeGrowthOutside",
269
- "outputs": [
270
- {
271
- "internalType": "uint256",
272
- "name": "feeGrowthOutside0X128",
273
- "type": "uint256"
274
- },
275
- {
276
- "internalType": "uint256",
277
- "name": "feeGrowthOutside1X128",
278
- "type": "uint256"
279
- }
280
- ],
281
- "stateMutability": "view",
282
- "type": "function"
283
- },
284
- {
285
- "inputs": [
286
- {
287
- "internalType": "PoolId",
288
- "name": "poolId",
289
- "type": "bytes32"
290
- },
291
- {
292
- "internalType": "int24",
293
- "name": "tick",
294
- "type": "int24"
295
- }
296
- ],
297
- "name": "getTickInfo",
298
- "outputs": [
299
- {
300
- "internalType": "uint128",
301
- "name": "liquidityGross",
302
- "type": "uint128"
303
- },
304
- {
305
- "internalType": "int128",
306
- "name": "liquidityNet",
307
- "type": "int128"
308
- },
309
- {
310
- "internalType": "uint256",
311
- "name": "feeGrowthOutside0X128",
312
- "type": "uint256"
313
- },
314
- {
315
- "internalType": "uint256",
316
- "name": "feeGrowthOutside1X128",
317
- "type": "uint256"
318
- }
319
- ],
320
- "stateMutability": "view",
321
- "type": "function"
322
- },
323
- {
324
- "inputs": [
325
- {
326
- "internalType": "PoolId",
327
- "name": "poolId",
328
- "type": "bytes32"
329
- },
330
- {
331
- "internalType": "int24",
332
- "name": "tick",
333
- "type": "int24"
334
- }
335
- ],
336
- "name": "getTickLiquidity",
337
- "outputs": [
338
- {
339
- "internalType": "uint128",
340
- "name": "liquidityGross",
341
- "type": "uint128"
342
- },
343
- {
344
- "internalType": "int128",
345
- "name": "liquidityNet",
346
- "type": "int128"
347
- }
348
- ],
349
- "stateMutability": "view",
350
- "type": "function"
351
- },
352
- {
353
- "inputs": [],
354
- "name": "poolManager",
355
- "outputs": [
356
- {
357
- "internalType": "contract IPoolManager",
358
- "name": "",
359
- "type": "address"
360
- }
361
- ],
362
- "stateMutability": "view",
363
- "type": "function"
364
- }
365
- ]
@@ -1,49 +0,0 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { BytesLike } from 'ethers/lib/utils';
3
- import { DeepReadonly } from 'ts-essentials';
4
- import { Log, Logger } from '../../types';
5
- import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
6
- import { IDexHelper } from '../../dex-helper/idex-helper';
7
- import { CommonAddresses, Pool } from './types';
8
- import { MultiResult } from '../../lib/multi-wrapper';
9
- import { Address } from '../../types';
10
- export declare class FluidDexCommonAddresses extends StatefulEventSubscriber<Pool[]> {
11
- readonly parentName: string;
12
- readonly commonAddresses: CommonAddresses;
13
- protected network: number;
14
- protected dexHelper: IDexHelper;
15
- handlers: {
16
- [event: string]: (event: any, state: DeepReadonly<Pool[]>, log: Readonly<Log>) => Promise<DeepReadonly<Pool[]> | null>;
17
- };
18
- logDecoder: (log: Log) => any;
19
- addressesSubscribed: Address[];
20
- protected dexFactoryIface: Interface;
21
- protected resolverIface: Interface;
22
- constructor(parentName: string, commonAddresses: CommonAddresses, network: number, dexHelper: IDexHelper, logger: Logger);
23
- /**
24
- * Handle a trade rate change on the pool.
25
- */
26
- handleDexDeployed(event: any, state: DeepReadonly<Pool[]>, log: Readonly<Log>): Promise<DeepReadonly<Pool[]> | null>;
27
- decodePool: (result: MultiResult<BytesLike> | BytesLike) => Pool;
28
- /**
29
- * The function is called every time any of the subscribed
30
- * addresses release log. The function accepts the current
31
- * state, updates the state according to the log, and returns
32
- * the updated state.
33
- * @param state - Current state of event subscriber
34
- * @param log - Log released by one of the subscribed addresses
35
- * @returns Updates state of the event subscriber after the log
36
- */
37
- processLog(state: DeepReadonly<Pool[]>, log: Readonly<Log>): Promise<DeepReadonly<Pool[]> | null>;
38
- getStateOrGenerate(blockNumber: number, readonly?: boolean): Promise<DeepReadonly<Pool[]>>;
39
- /**
40
- * The function generates state using on-chain calls. This
41
- * function is called to regenerate state if the event based
42
- * system fails to fetch events and the local state is no
43
- * more correct.
44
- * @param blockNumber - Blocknumber for which the state should
45
- * should be generated
46
- * @returns state of the event subscriber at blocknumber
47
- */
48
- generateState(blockNumber: number): Promise<DeepReadonly<Pool[]>>;
49
- }
@@ -1,104 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FluidDexCommonAddresses = void 0;
7
- const abi_1 = require("@ethersproject/abi");
8
- const utils_1 = require("../../utils");
9
- const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
10
- const resolver_abi_json_1 = __importDefault(require("../../abi/fluid-dex/resolver.abi.json"));
11
- const dexFactory_abi_json_1 = __importDefault(require("../../abi/fluid-dex/dexFactory.abi.json"));
12
- const decoders_1 = require("../../lib/decoders");
13
- const ethers_1 = require("ethers");
14
- class FluidDexCommonAddresses extends stateful_event_subscriber_1.StatefulEventSubscriber {
15
- constructor(parentName, commonAddresses, network, dexHelper, logger) {
16
- super(parentName, 'getAllPools', dexHelper, logger);
17
- this.parentName = parentName;
18
- this.commonAddresses = commonAddresses;
19
- this.network = network;
20
- this.dexHelper = dexHelper;
21
- this.handlers = {};
22
- this.dexFactoryIface = new abi_1.Interface(dexFactory_abi_json_1.default);
23
- this.resolverIface = new abi_1.Interface(resolver_abi_json_1.default);
24
- this.decodePool = (result) => {
25
- return (0, decoders_1.generalDecoder)(result, ['tuple(address pool, address token0, address token1, uint256 fee)'], undefined, decoded => {
26
- return {
27
- address: decoded[0].toLowerCase(),
28
- token0: decoded[1].toLowerCase(),
29
- token1: decoded[2].toLowerCase(),
30
- };
31
- });
32
- };
33
- this.logDecoder = (log) => this.dexFactoryIface.parseLog(log);
34
- this.addressesSubscribed = [commonAddresses.dexFactory];
35
- // Add handlers
36
- this.handlers['DexDeployed'] = this.handleDexDeployed.bind(this);
37
- }
38
- /**
39
- * Handle a trade rate change on the pool.
40
- */
41
- async handleDexDeployed(event, state, log) {
42
- const blockNumber_ = await this.dexHelper.provider.getBlockNumber();
43
- return this.getStateOrGenerate(blockNumber_, false);
44
- }
45
- /**
46
- * The function is called every time any of the subscribed
47
- * addresses release log. The function accepts the current
48
- * state, updates the state according to the log, and returns
49
- * the updated state.
50
- * @param state - Current state of event subscriber
51
- * @param log - Log released by one of the subscribed addresses
52
- * @returns Updates state of the event subscriber after the log
53
- */
54
- async processLog(state, log) {
55
- try {
56
- let event;
57
- try {
58
- event = this.logDecoder(log);
59
- }
60
- catch (e) {
61
- return null;
62
- }
63
- if (event.name in this.handlers) {
64
- return await this.handlers[event.name](event, state, log);
65
- }
66
- }
67
- catch (e) {
68
- (0, utils_1.catchParseLogError)(e, this.logger);
69
- }
70
- return null;
71
- }
72
- async getStateOrGenerate(blockNumber, readonly = false) {
73
- let state = this.getState(blockNumber);
74
- if (!state) {
75
- state = await this.generateState(blockNumber);
76
- if (!readonly)
77
- this.setState(state, blockNumber);
78
- }
79
- return state;
80
- }
81
- /**
82
- * The function generates state using on-chain calls. This
83
- * function is called to regenerate state if the event based
84
- * system fails to fetch events and the local state is no
85
- * more correct.
86
- * @param blockNumber - Blocknumber for which the state should
87
- * should be generated
88
- * @returns state of the event subscriber at blocknumber
89
- */
90
- async generateState(blockNumber) {
91
- const resolverContract = new ethers_1.Contract(this.commonAddresses.resolver, resolver_abi_json_1.default, this.dexHelper.provider);
92
- const rawResult = await resolverContract.callStatic.getAllPools({
93
- blockTag: blockNumber,
94
- });
95
- const pools = rawResult.map((result) => ({
96
- address: result[0],
97
- token0: result[1],
98
- token1: result[2],
99
- }));
100
- return pools;
101
- }
102
- }
103
- exports.FluidDexCommonAddresses = FluidDexCommonAddresses;
104
- //# sourceMappingURL=fluid-dex-generate-pool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fluid-dex-generate-pool.js","sourceRoot":"","sources":["../../../src/dex/fluid-dex/fluid-dex-generate-pool.ts"],"names":[],"mappings":"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"}
@@ -1,4 +0,0 @@
1
- import { DexParams } from './types';
2
- import { DexConfigMap, AdapterMappings } from '../../types';
3
- export declare const IntegralConfig: DexConfigMap<DexParams>;
4
- export declare const Adapters: Record<number, AdapterMappings>;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Adapters = exports.IntegralConfig = void 0;
4
- const constants_1 = require("../../constants");
5
- exports.IntegralConfig = {
6
- Integral: {
7
- [constants_1.Network.MAINNET]: {
8
- factoryAddress: '0xC480b33eE5229DE3FbDFAD1D2DCD3F3BAD0C56c6',
9
- relayerAddress: '0xd17b3c9784510E33cD5B87b490E79253BcD81e2E',
10
- subgraphURL: 'ANd5QJuYtyfngmXvBMu9kZAv935vhcqp4xAGBkmCADN3',
11
- },
12
- [constants_1.Network.ARBITRUM]: {
13
- factoryAddress: '0x717EF162cf831db83c51134734A15D1EBe9E516a',
14
- relayerAddress: '0x3c6951FDB433b5b8442e7aa126D50fBFB54b5f42',
15
- subgraphURL: 'HXeVedRK7VgogXwbK5Sc4mjyLkhBAS5akskRvbSYnkHU',
16
- },
17
- },
18
- };
19
- exports.Adapters = {};
20
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/integral/config.ts"],"names":[],"mappings":";;;AAEA,+CAA0C;AAE7B,QAAA,cAAc,GAA4B;IACrD,QAAQ,EAAE;QACR,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB,cAAc,EAAE,4CAA4C;YAC5D,cAAc,EAAE,4CAA4C;YAC5D,WAAW,EAAE,8CAA8C;SAC5D;QACD,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE;YAClB,cAAc,EAAE,4CAA4C;YAC5D,cAAc,EAAE,4CAA4C;YAC5D,WAAW,EAAE,8CAA8C;SAC5D;KACF;CACF,CAAC;AAEW,QAAA,QAAQ,GAAoC,EAAE,CAAC"}
@@ -1,40 +0,0 @@
1
- import { Address } from '@paraswap/core';
2
- import { IntegralFactory } from './integral-factory';
3
- import { IntegralRelayer } from './integral-relayer';
4
- import { Network } from '../../constants';
5
- import { IDexHelper } from '../../dex-helper';
6
- import { Logger } from 'log4js';
7
- import { Interface } from '@ethersproject/abi';
8
- import { IntegralPool, PoolInitProps, RelayerPoolState } from './types';
9
- import { IntegralToken } from './integral-token';
10
- export declare class IntegralContext {
11
- readonly network: Network;
12
- readonly dexKey: string;
13
- readonly dexHelper: IDexHelper;
14
- readonly erc20Interface: Interface;
15
- readonly factoryAddress: Address;
16
- readonly relayerAddress: Address;
17
- static instances: {
18
- [network: number]: IntegralContext;
19
- };
20
- pools: {
21
- [poolId: string]: IntegralPool;
22
- };
23
- tokens: {
24
- [tokenAddress: Address]: IntegralToken;
25
- };
26
- factory: IntegralFactory;
27
- relayer: IntegralRelayer;
28
- logger: Logger;
29
- private constructor();
30
- addPools(pools: PoolInitProps, blockNumber: number, initPhase?: boolean): Promise<void>;
31
- getPoolAddresses(): string[];
32
- private removeDisabledPoolInitProps;
33
- static initialize(network: Network, dexKey: string, dexHelper: IDexHelper, erc20Interface: Interface, factoryAddress: Address, relayerAddress: Address): IntegralContext;
34
- static getInstance(network: Network): IntegralContext;
35
- onRelayerPoolEnabledSet(poolAddress: Address, state: RelayerPoolState, blockNumber: number): Promise<void>;
36
- onRebalanceSellOrderExecuted(blockNumber: number, orderId: bigint): void;
37
- onPoolCreatedAddPool(token0: Address, token1: Address, poolAddress: Address, blockNumber: number): Promise<void>;
38
- onPoolSwapForRelayer(blockNumber: number, poolAddress: Address, recipient: Address, amount0Out: bigint, amount1Out: bigint): Promise<void>;
39
- onTransferUpdateBalance(token: Address, from: Address, to: Address, amount: bigint, blockNumber: number): Promise<void>;
40
- }