@paraswap/dex-lib 2.42.26 → 2.42.27-solidly-v3.2
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.
- package/build/abi/smardex/all/smardex-router.json +648 -0
- package/build/abi/smardex/layer-1/smardex-factory.json +242 -0
- package/build/abi/smardex/layer-1/smardex-pool.json +506 -0
- package/build/abi/smardex/layer-2/smardex-factory.json +185 -0
- package/build/abi/smardex/layer-2/smardex-pool.json +578 -0
- package/build/abi/solidly-v3/SolidlyV3Pool.abi.json +738 -0
- package/build/abi/solidly-v3/SolidlyV3StateMulticall.abi.json +375 -0
- package/build/config.js +20 -10
- package/build/config.js.map +1 -1
- package/build/dex/index.js +4 -0
- package/build/dex/index.js.map +1 -1
- package/build/dex/smardex/config.d.ts +4 -0
- package/build/dex/smardex/config.js +64 -0
- package/build/dex/smardex/config.js.map +1 -0
- package/build/dex/smardex/constants.d.ts +18 -0
- package/build/dex/smardex/constants.js +33 -0
- package/build/dex/smardex/constants.js.map +1 -0
- package/build/dex/smardex/sdk/constants.d.ts +6 -0
- package/build/dex/smardex/sdk/constants.js +13 -0
- package/build/dex/smardex/sdk/constants.js.map +1 -0
- package/build/dex/smardex/sdk/core.d.ts +113 -0
- package/build/dex/smardex/sdk/core.js +499 -0
- package/build/dex/smardex/sdk/core.js.map +1 -0
- package/build/dex/smardex/sdk/errors.d.ts +15 -0
- package/build/dex/smardex/sdk/errors.js +22 -0
- package/build/dex/smardex/sdk/errors.js.map +1 -0
- package/build/dex/smardex/sdk/types.d.ts +62 -0
- package/build/dex/smardex/sdk/types.js +3 -0
- package/build/dex/smardex/sdk/types.js.map +1 -0
- package/build/dex/smardex/sdk/utils.d.ts +44 -0
- package/build/dex/smardex/sdk/utils.js +133 -0
- package/build/dex/smardex/sdk/utils.js.map +1 -0
- package/build/dex/smardex/smardex-event-pool.d.ts +28 -0
- package/build/dex/smardex/smardex-event-pool.js +119 -0
- package/build/dex/smardex/smardex-event-pool.js.map +1 -0
- package/build/dex/smardex/smardex.d.ts +65 -0
- package/build/dex/smardex/smardex.js +519 -0
- package/build/dex/smardex/smardex.js.map +1 -0
- package/build/dex/smardex/types.d.ts +55 -0
- package/build/dex/smardex/types.js +3 -0
- package/build/dex/smardex/types.js.map +1 -0
- package/build/dex/solidly-v3/config.d.ts +9 -0
- package/build/dex/solidly-v3/config.js +58 -0
- package/build/dex/solidly-v3/config.js.map +1 -0
- package/build/dex/solidly-v3/constants.d.ts +27 -0
- package/build/dex/solidly-v3/constants.js +34 -0
- package/build/dex/solidly-v3/constants.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/BitMath.d.ts +4 -0
- package/build/dex/solidly-v3/contract-math/BitMath.js +93 -0
- package/build/dex/solidly-v3/contract-math/BitMath.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/FixedPoint128.d.ts +3 -0
- package/build/dex/solidly-v3/contract-math/FixedPoint128.js +8 -0
- package/build/dex/solidly-v3/contract-math/FixedPoint128.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/FixedPoint96.d.ts +4 -0
- package/build/dex/solidly-v3/contract-math/FixedPoint96.js +9 -0
- package/build/dex/solidly-v3/contract-math/FixedPoint96.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/FullMath.d.ts +4 -0
- package/build/dex/solidly-v3/contract-math/FullMath.js +19 -0
- package/build/dex/solidly-v3/contract-math/FullMath.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/LiquidityMath.d.ts +3 -0
- package/build/dex/solidly-v3/contract-math/LiquidityMath.js +22 -0
- package/build/dex/solidly-v3/contract-math/LiquidityMath.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/SqrtPriceMath.d.ts +10 -0
- package/build/dex/solidly-v3/contract-math/SqrtPriceMath.js +91 -0
- package/build/dex/solidly-v3/contract-math/SqrtPriceMath.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/SwapMath.d.ts +8 -0
- package/build/dex/solidly-v3/contract-math/SwapMath.js +70 -0
- package/build/dex/solidly-v3/contract-math/SwapMath.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/Tick.d.ts +7 -0
- package/build/dex/solidly-v3/contract-math/Tick.js +36 -0
- package/build/dex/solidly-v3/contract-math/Tick.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/TickBitMap.d.ts +7 -0
- package/build/dex/solidly-v3/contract-math/TickBitMap.js +84 -0
- package/build/dex/solidly-v3/contract-math/TickBitMap.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/TickMath.d.ts +8 -0
- package/build/dex/solidly-v3/contract-math/TickMath.js +162 -0
- package/build/dex/solidly-v3/contract-math/TickMath.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/UnsafeMath.d.ts +3 -0
- package/build/dex/solidly-v3/contract-math/UnsafeMath.js +10 -0
- package/build/dex/solidly-v3/contract-math/UnsafeMath.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/uniswap-v3-math.d.ts +31 -0
- package/build/dex/solidly-v3/contract-math/uniswap-v3-math.js +363 -0
- package/build/dex/solidly-v3/contract-math/uniswap-v3-math.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/utils.d.ts +7 -0
- package/build/dex/solidly-v3/contract-math/utils.js +39 -0
- package/build/dex/solidly-v3/contract-math/utils.js.map +1 -0
- package/build/dex/solidly-v3/solidly-v3-factory.d.ts +26 -0
- package/build/dex/solidly-v3/solidly-v3-factory.js +44 -0
- package/build/dex/solidly-v3/solidly-v3-factory.js.map +1 -0
- package/build/dex/solidly-v3/solidly-v3-pool.d.ts +44 -0
- package/build/dex/solidly-v3/solidly-v3-pool.js +298 -0
- package/build/dex/solidly-v3/solidly-v3-pool.js.map +1 -0
- package/build/dex/solidly-v3/solidly-v3.d.ts +67 -0
- package/build/dex/solidly-v3/solidly-v3.js +590 -0
- package/build/dex/solidly-v3/solidly-v3.js.map +1 -0
- package/build/dex/solidly-v3/types.d.ts +132 -0
- package/build/dex/solidly-v3/types.js +9 -0
- package/build/dex/solidly-v3/types.js.map +1 -0
- package/build/dex/solidly-v3/utils.d.ts +6 -0
- package/build/dex/solidly-v3/utils.js +53 -0
- package/build/dex/solidly-v3/utils.js.map +1 -0
- package/build/dex/wombat/wombat-pool-poller.d.ts +22 -0
- package/build/dex/wombat/wombat-pool-poller.js +164 -0
- package/build/dex/wombat/wombat-pool-poller.js.map +1 -0
- package/build/types.d.ts +1 -0
- package/package.json +3 -2
- package/src/abi/smardex/all/smardex-router.json +648 -0
- package/src/abi/smardex/layer-1/smardex-factory.json +242 -0
- package/src/abi/smardex/layer-1/smardex-pool.json +506 -0
- package/src/abi/smardex/layer-2/smardex-factory.json +185 -0
- package/src/abi/smardex/layer-2/smardex-pool.json +578 -0
- package/src/abi/solidly-v3/SolidlyV3Pool.abi.json +738 -0
- package/src/abi/solidly-v3/SolidlyV3StateMulticall.abi.json +375 -0
- package/src/config.ts +21 -10
- package/src/dex/index.ts +4 -0
- package/src/dex/smardex/config.ts +67 -0
- package/src/dex/smardex/constants.ts +35 -0
- package/src/dex/smardex/sdk/constants.ts +10 -0
- package/src/dex/smardex/sdk/core.ts +832 -0
- package/src/dex/smardex/sdk/errors.ts +18 -0
- package/src/dex/smardex/sdk/types.ts +68 -0
- package/src/dex/smardex/sdk/utils.ts +156 -0
- package/src/dex/smardex/smardex-e2e.test.ts +275 -0
- package/src/dex/smardex/smardex-event-pool.ts +164 -0
- package/src/dex/smardex/smardex-events.test.ts +297 -0
- package/src/dex/smardex/smardex-integration.test.ts +258 -0
- package/src/dex/smardex/smardex.ts +770 -0
- package/src/dex/smardex/types.ts +69 -0
- package/src/dex/solidly-v3/config.ts +64 -0
- package/src/dex/solidly-v3/constants.ts +42 -0
- package/src/dex/solidly-v3/contract-math/BitMath.ts +90 -0
- package/src/dex/solidly-v3/contract-math/FixedPoint128.ts +3 -0
- package/src/dex/solidly-v3/contract-math/FixedPoint96.ts +4 -0
- package/src/dex/solidly-v3/contract-math/FullMath.ts +30 -0
- package/src/dex/solidly-v3/contract-math/LiquidityMath.ts +17 -0
- package/src/dex/solidly-v3/contract-math/SqrtPriceMath.ts +226 -0
- package/src/dex/solidly-v3/contract-math/SwapMath.ts +139 -0
- package/src/dex/solidly-v3/contract-math/Tick.ts +66 -0
- package/src/dex/solidly-v3/contract-math/TickBitMap.ts +123 -0
- package/src/dex/solidly-v3/contract-math/TickMath.ts +211 -0
- package/src/dex/solidly-v3/contract-math/UnsafeMath.ts +5 -0
- package/src/dex/solidly-v3/contract-math/uniswap-v3-math.ts +570 -0
- package/src/dex/solidly-v3/contract-math/utils.ts +50 -0
- package/src/dex/solidly-v3/solidly-v3-e2e.test.ts +124 -0
- package/src/dex/solidly-v3/solidly-v3-events.test.ts +144 -0
- package/src/dex/solidly-v3/solidly-v3-factory.ts +73 -0
- package/src/dex/solidly-v3/solidly-v3-integration.test.ts +358 -0
- package/src/dex/solidly-v3/solidly-v3-pool.ts +494 -0
- package/src/dex/solidly-v3/solidly-v3.ts +988 -0
- package/src/dex/solidly-v3/types.ts +158 -0
- package/src/dex/solidly-v3/utils.ts +71 -0
- package/src/dex/uniswap-v3/uniswap-v3-events.test.ts +3 -0
- package/src/types.ts +1 -0
- package/tests/constants-e2e.ts +26 -1
- package/.vscode/launch.json +0 -54
- package/.vscode/settings.json +0 -2
- package/.vscode/tasks.json +0 -15
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{
|
|
5
|
+
"internalType": "contract IUniswapV3Factory",
|
|
6
|
+
"name": "factory",
|
|
7
|
+
"type": "address"
|
|
8
|
+
},
|
|
9
|
+
{ "internalType": "address", "name": "tokenIn", "type": "address" },
|
|
10
|
+
{ "internalType": "address", "name": "tokenOut", "type": "address" },
|
|
11
|
+
{ "internalType": "int24", "name": "tickSpacing", "type": "int24" },
|
|
12
|
+
{ "internalType": "int16", "name": "tickBitmapStart", "type": "int16" },
|
|
13
|
+
{ "internalType": "int16", "name": "tickBitmapEnd", "type": "int16" }
|
|
14
|
+
],
|
|
15
|
+
"name": "getAdditionalBitmapWithTicks",
|
|
16
|
+
"outputs": [
|
|
17
|
+
{
|
|
18
|
+
"components": [
|
|
19
|
+
{ "internalType": "int16", "name": "index", "type": "int16" },
|
|
20
|
+
{ "internalType": "uint256", "name": "value", "type": "uint256" }
|
|
21
|
+
],
|
|
22
|
+
"internalType": "struct IUniswapV3StateMulticall.TickBitMapMappings[]",
|
|
23
|
+
"name": "tickBitmap",
|
|
24
|
+
"type": "tuple[]"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"components": [
|
|
28
|
+
{ "internalType": "int24", "name": "index", "type": "int24" },
|
|
29
|
+
{
|
|
30
|
+
"components": [
|
|
31
|
+
{
|
|
32
|
+
"internalType": "uint128",
|
|
33
|
+
"name": "liquidityGross",
|
|
34
|
+
"type": "uint128"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"internalType": "int128",
|
|
38
|
+
"name": "liquidityNet",
|
|
39
|
+
"type": "int128"
|
|
40
|
+
},
|
|
41
|
+
{ "internalType": "bool", "name": "initialized", "type": "bool" }
|
|
42
|
+
],
|
|
43
|
+
"internalType": "struct IUniswapV3StateMulticall.TickInfo",
|
|
44
|
+
"name": "value",
|
|
45
|
+
"type": "tuple"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"internalType": "struct IUniswapV3StateMulticall.TickInfoMappings[]",
|
|
49
|
+
"name": "ticks",
|
|
50
|
+
"type": "tuple[]"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"stateMutability": "view",
|
|
54
|
+
"type": "function"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"inputs": [
|
|
58
|
+
{
|
|
59
|
+
"internalType": "contract IUniswapV3Factory",
|
|
60
|
+
"name": "factory",
|
|
61
|
+
"type": "address"
|
|
62
|
+
},
|
|
63
|
+
{ "internalType": "address", "name": "tokenIn", "type": "address" },
|
|
64
|
+
{ "internalType": "address", "name": "tokenOut", "type": "address" },
|
|
65
|
+
{ "internalType": "int24", "name": "tickSpacing", "type": "int24" },
|
|
66
|
+
{ "internalType": "int16", "name": "tickBitmapStart", "type": "int16" },
|
|
67
|
+
{ "internalType": "int16", "name": "tickBitmapEnd", "type": "int16" }
|
|
68
|
+
],
|
|
69
|
+
"name": "getAdditionalBitmapWithoutTicks",
|
|
70
|
+
"outputs": [
|
|
71
|
+
{
|
|
72
|
+
"components": [
|
|
73
|
+
{ "internalType": "int16", "name": "index", "type": "int16" },
|
|
74
|
+
{ "internalType": "uint256", "name": "value", "type": "uint256" }
|
|
75
|
+
],
|
|
76
|
+
"internalType": "struct IUniswapV3StateMulticall.TickBitMapMappings[]",
|
|
77
|
+
"name": "tickBitmap",
|
|
78
|
+
"type": "tuple[]"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"stateMutability": "view",
|
|
82
|
+
"type": "function"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"inputs": [
|
|
86
|
+
{
|
|
87
|
+
"internalType": "contract IUniswapV3Factory",
|
|
88
|
+
"name": "factory",
|
|
89
|
+
"type": "address"
|
|
90
|
+
},
|
|
91
|
+
{ "internalType": "address", "name": "tokenIn", "type": "address" },
|
|
92
|
+
{ "internalType": "address", "name": "tokenOut", "type": "address" },
|
|
93
|
+
{ "internalType": "int24", "name": "tickSpacing", "type": "int24" },
|
|
94
|
+
{ "internalType": "int16", "name": "tickBitmapStart", "type": "int16" },
|
|
95
|
+
{ "internalType": "int16", "name": "tickBitmapEnd", "type": "int16" }
|
|
96
|
+
],
|
|
97
|
+
"name": "getFullState",
|
|
98
|
+
"outputs": [
|
|
99
|
+
{
|
|
100
|
+
"components": [
|
|
101
|
+
{
|
|
102
|
+
"internalType": "contract IUniswapV3Pool",
|
|
103
|
+
"name": "pool",
|
|
104
|
+
"type": "address"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"internalType": "uint256",
|
|
108
|
+
"name": "blockTimestamp",
|
|
109
|
+
"type": "uint256"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"components": [
|
|
113
|
+
{
|
|
114
|
+
"internalType": "uint160",
|
|
115
|
+
"name": "sqrtPriceX96",
|
|
116
|
+
"type": "uint160"
|
|
117
|
+
},
|
|
118
|
+
{ "internalType": "int24", "name": "tick", "type": "int24" },
|
|
119
|
+
{ "internalType": "uint24", "name": "fee", "type": "uint24" },
|
|
120
|
+
{ "internalType": "bool", "name": "unlocked", "type": "bool" }
|
|
121
|
+
],
|
|
122
|
+
"internalType": "struct IUniswapV3StateMulticall.Slot0",
|
|
123
|
+
"name": "slot0",
|
|
124
|
+
"type": "tuple"
|
|
125
|
+
},
|
|
126
|
+
{ "internalType": "uint128", "name": "liquidity", "type": "uint128" },
|
|
127
|
+
{ "internalType": "int24", "name": "tickSpacing", "type": "int24" },
|
|
128
|
+
{
|
|
129
|
+
"internalType": "uint128",
|
|
130
|
+
"name": "maxLiquidityPerTick",
|
|
131
|
+
"type": "uint128"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"components": [
|
|
135
|
+
{ "internalType": "int16", "name": "index", "type": "int16" },
|
|
136
|
+
{ "internalType": "uint256", "name": "value", "type": "uint256" }
|
|
137
|
+
],
|
|
138
|
+
"internalType": "struct IUniswapV3StateMulticall.TickBitMapMappings[]",
|
|
139
|
+
"name": "tickBitmap",
|
|
140
|
+
"type": "tuple[]"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"components": [
|
|
144
|
+
{ "internalType": "int24", "name": "index", "type": "int24" },
|
|
145
|
+
{
|
|
146
|
+
"components": [
|
|
147
|
+
{
|
|
148
|
+
"internalType": "uint128",
|
|
149
|
+
"name": "liquidityGross",
|
|
150
|
+
"type": "uint128"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"internalType": "int128",
|
|
154
|
+
"name": "liquidityNet",
|
|
155
|
+
"type": "int128"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"internalType": "bool",
|
|
159
|
+
"name": "initialized",
|
|
160
|
+
"type": "bool"
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"internalType": "struct IUniswapV3StateMulticall.TickInfo",
|
|
164
|
+
"name": "value",
|
|
165
|
+
"type": "tuple"
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
"internalType": "struct IUniswapV3StateMulticall.TickInfoMappings[]",
|
|
169
|
+
"name": "ticks",
|
|
170
|
+
"type": "tuple[]"
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
"internalType": "struct IUniswapV3StateMulticall.StateResult",
|
|
174
|
+
"name": "state",
|
|
175
|
+
"type": "tuple"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"stateMutability": "view",
|
|
179
|
+
"type": "function"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"inputs": [
|
|
183
|
+
{
|
|
184
|
+
"internalType": "contract IUniswapV3Factory",
|
|
185
|
+
"name": "factory",
|
|
186
|
+
"type": "address"
|
|
187
|
+
},
|
|
188
|
+
{ "internalType": "address", "name": "tokenIn", "type": "address" },
|
|
189
|
+
{ "internalType": "address", "name": "tokenOut", "type": "address" },
|
|
190
|
+
{ "internalType": "int24", "name": "tickSpacing", "type": "int24" },
|
|
191
|
+
{ "internalType": "int16", "name": "leftBitmapAmount", "type": "int16" },
|
|
192
|
+
{ "internalType": "int16", "name": "rightBitmapAmount", "type": "int16" }
|
|
193
|
+
],
|
|
194
|
+
"name": "getFullStateWithRelativeBitmaps",
|
|
195
|
+
"outputs": [
|
|
196
|
+
{
|
|
197
|
+
"components": [
|
|
198
|
+
{
|
|
199
|
+
"internalType": "contract IUniswapV3Pool",
|
|
200
|
+
"name": "pool",
|
|
201
|
+
"type": "address"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"internalType": "uint256",
|
|
205
|
+
"name": "blockTimestamp",
|
|
206
|
+
"type": "uint256"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"components": [
|
|
210
|
+
{
|
|
211
|
+
"internalType": "uint160",
|
|
212
|
+
"name": "sqrtPriceX96",
|
|
213
|
+
"type": "uint160"
|
|
214
|
+
},
|
|
215
|
+
{ "internalType": "int24", "name": "tick", "type": "int24" },
|
|
216
|
+
{ "internalType": "uint24", "name": "fee", "type": "uint24" },
|
|
217
|
+
{ "internalType": "bool", "name": "unlocked", "type": "bool" }
|
|
218
|
+
],
|
|
219
|
+
"internalType": "struct IUniswapV3StateMulticall.Slot0",
|
|
220
|
+
"name": "slot0",
|
|
221
|
+
"type": "tuple"
|
|
222
|
+
},
|
|
223
|
+
{ "internalType": "uint128", "name": "liquidity", "type": "uint128" },
|
|
224
|
+
{ "internalType": "int24", "name": "tickSpacing", "type": "int24" },
|
|
225
|
+
{
|
|
226
|
+
"internalType": "uint128",
|
|
227
|
+
"name": "maxLiquidityPerTick",
|
|
228
|
+
"type": "uint128"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"components": [
|
|
232
|
+
{ "internalType": "int16", "name": "index", "type": "int16" },
|
|
233
|
+
{ "internalType": "uint256", "name": "value", "type": "uint256" }
|
|
234
|
+
],
|
|
235
|
+
"internalType": "struct IUniswapV3StateMulticall.TickBitMapMappings[]",
|
|
236
|
+
"name": "tickBitmap",
|
|
237
|
+
"type": "tuple[]"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"components": [
|
|
241
|
+
{ "internalType": "int24", "name": "index", "type": "int24" },
|
|
242
|
+
{
|
|
243
|
+
"components": [
|
|
244
|
+
{
|
|
245
|
+
"internalType": "uint128",
|
|
246
|
+
"name": "liquidityGross",
|
|
247
|
+
"type": "uint128"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"internalType": "int128",
|
|
251
|
+
"name": "liquidityNet",
|
|
252
|
+
"type": "int128"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"internalType": "bool",
|
|
256
|
+
"name": "initialized",
|
|
257
|
+
"type": "bool"
|
|
258
|
+
}
|
|
259
|
+
],
|
|
260
|
+
"internalType": "struct IUniswapV3StateMulticall.TickInfo",
|
|
261
|
+
"name": "value",
|
|
262
|
+
"type": "tuple"
|
|
263
|
+
}
|
|
264
|
+
],
|
|
265
|
+
"internalType": "struct IUniswapV3StateMulticall.TickInfoMappings[]",
|
|
266
|
+
"name": "ticks",
|
|
267
|
+
"type": "tuple[]"
|
|
268
|
+
}
|
|
269
|
+
],
|
|
270
|
+
"internalType": "struct IUniswapV3StateMulticall.StateResult",
|
|
271
|
+
"name": "state",
|
|
272
|
+
"type": "tuple"
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
"stateMutability": "view",
|
|
276
|
+
"type": "function"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"inputs": [
|
|
280
|
+
{
|
|
281
|
+
"internalType": "contract IUniswapV3Factory",
|
|
282
|
+
"name": "factory",
|
|
283
|
+
"type": "address"
|
|
284
|
+
},
|
|
285
|
+
{ "internalType": "address", "name": "tokenIn", "type": "address" },
|
|
286
|
+
{ "internalType": "address", "name": "tokenOut", "type": "address" },
|
|
287
|
+
{ "internalType": "int24", "name": "tickSpacing", "type": "int24" },
|
|
288
|
+
{ "internalType": "int16", "name": "tickBitmapStart", "type": "int16" },
|
|
289
|
+
{ "internalType": "int16", "name": "tickBitmapEnd", "type": "int16" }
|
|
290
|
+
],
|
|
291
|
+
"name": "getFullStateWithoutTicks",
|
|
292
|
+
"outputs": [
|
|
293
|
+
{
|
|
294
|
+
"components": [
|
|
295
|
+
{
|
|
296
|
+
"internalType": "contract IUniswapV3Pool",
|
|
297
|
+
"name": "pool",
|
|
298
|
+
"type": "address"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"internalType": "uint256",
|
|
302
|
+
"name": "blockTimestamp",
|
|
303
|
+
"type": "uint256"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"components": [
|
|
307
|
+
{
|
|
308
|
+
"internalType": "uint160",
|
|
309
|
+
"name": "sqrtPriceX96",
|
|
310
|
+
"type": "uint160"
|
|
311
|
+
},
|
|
312
|
+
{ "internalType": "int24", "name": "tick", "type": "int24" },
|
|
313
|
+
{ "internalType": "uint24", "name": "fee", "type": "uint24" },
|
|
314
|
+
{ "internalType": "bool", "name": "unlocked", "type": "bool" }
|
|
315
|
+
],
|
|
316
|
+
"internalType": "struct IUniswapV3StateMulticall.Slot0",
|
|
317
|
+
"name": "slot0",
|
|
318
|
+
"type": "tuple"
|
|
319
|
+
},
|
|
320
|
+
{ "internalType": "uint128", "name": "liquidity", "type": "uint128" },
|
|
321
|
+
{ "internalType": "int24", "name": "tickSpacing", "type": "int24" },
|
|
322
|
+
{
|
|
323
|
+
"internalType": "uint128",
|
|
324
|
+
"name": "maxLiquidityPerTick",
|
|
325
|
+
"type": "uint128"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"components": [
|
|
329
|
+
{ "internalType": "int16", "name": "index", "type": "int16" },
|
|
330
|
+
{ "internalType": "uint256", "name": "value", "type": "uint256" }
|
|
331
|
+
],
|
|
332
|
+
"internalType": "struct IUniswapV3StateMulticall.TickBitMapMappings[]",
|
|
333
|
+
"name": "tickBitmap",
|
|
334
|
+
"type": "tuple[]"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"components": [
|
|
338
|
+
{ "internalType": "int24", "name": "index", "type": "int24" },
|
|
339
|
+
{
|
|
340
|
+
"components": [
|
|
341
|
+
{
|
|
342
|
+
"internalType": "uint128",
|
|
343
|
+
"name": "liquidityGross",
|
|
344
|
+
"type": "uint128"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"internalType": "int128",
|
|
348
|
+
"name": "liquidityNet",
|
|
349
|
+
"type": "int128"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"internalType": "bool",
|
|
353
|
+
"name": "initialized",
|
|
354
|
+
"type": "bool"
|
|
355
|
+
}
|
|
356
|
+
],
|
|
357
|
+
"internalType": "struct IUniswapV3StateMulticall.TickInfo",
|
|
358
|
+
"name": "value",
|
|
359
|
+
"type": "tuple"
|
|
360
|
+
}
|
|
361
|
+
],
|
|
362
|
+
"internalType": "struct IUniswapV3StateMulticall.TickInfoMappings[]",
|
|
363
|
+
"name": "ticks",
|
|
364
|
+
"type": "tuple[]"
|
|
365
|
+
}
|
|
366
|
+
],
|
|
367
|
+
"internalType": "struct IUniswapV3StateMulticall.StateResult",
|
|
368
|
+
"name": "state",
|
|
369
|
+
"type": "tuple"
|
|
370
|
+
}
|
|
371
|
+
],
|
|
372
|
+
"stateMutability": "view",
|
|
373
|
+
"type": "function"
|
|
374
|
+
}
|
|
375
|
+
]
|
package/src/config.ts
CHANGED
|
@@ -31,6 +31,7 @@ type BaseConfig = {
|
|
|
31
31
|
hashFlowDisabledMMs: string[];
|
|
32
32
|
swaapV2AuthToken?: string;
|
|
33
33
|
dexalotAuthToken?: string;
|
|
34
|
+
smardexSubgraphAuthToken?: string;
|
|
34
35
|
forceRpcFallbackDexs: string[];
|
|
35
36
|
};
|
|
36
37
|
|
|
@@ -52,9 +53,9 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
52
53
|
Adapter01: '0x9bE264469eF954c139Da4A45Cf76CbCC5e3A6A73',
|
|
53
54
|
Adapter02: '0xFC2Ba6E830a04C25e207B8214b26d8C713F6881F',
|
|
54
55
|
Adapter03: '0xBAEeb4540f59d30E567a5B563CC0c4587eDd9366',
|
|
55
|
-
Adapter04: '
|
|
56
|
+
Adapter04: '0x369A2FDb910d432f0a07381a5E3d27572c876713',
|
|
56
57
|
BuyAdapter: '0x84bEF12C9931cE12662cc9F2366b6a5029E4BD29',
|
|
57
|
-
BuyAdapter02: '
|
|
58
|
+
BuyAdapter02: '0xe53d24CD81cC81bbf271AD7B02D0d67f851D727c',
|
|
58
59
|
},
|
|
59
60
|
uniswapV2ExchangeRouterAddress:
|
|
60
61
|
'0xF9234CB08edb93c0d4a4d4c70cC3FfD070e78e07',
|
|
@@ -62,6 +63,7 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
62
63
|
rpcPollingBlocksBackToTriggerUpdate: 0,
|
|
63
64
|
swaapV2AuthToken: process.env.API_KEY_SWAAP_V2_AUTH_TOKEN || '',
|
|
64
65
|
hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
|
|
66
|
+
smardexSubgraphAuthToken: process.env.API_KEY_SMARDEX_SUBGRAPH || '',
|
|
65
67
|
hashFlowDisabledMMs:
|
|
66
68
|
process.env[`HASHFLOW_DISABLED_MMS_1`]?.split(',') || [],
|
|
67
69
|
uniswapV3EventLoggingSampleRate: 0,
|
|
@@ -161,12 +163,13 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
161
163
|
multicallV2Address: '0xC50F4c1E81c873B2204D7eFf7069Ffec6Fbe136D',
|
|
162
164
|
privateHttpProvider: process.env.HTTP_PROVIDER_56,
|
|
163
165
|
hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
|
|
166
|
+
smardexSubgraphAuthToken: process.env.API_KEY_SMARDEX_SUBGRAPH || '',
|
|
164
167
|
hashFlowDisabledMMs:
|
|
165
168
|
process.env[`HASHFLOW_DISABLED_MMS_56`]?.split(',') || [],
|
|
166
169
|
adapterAddresses: {
|
|
167
170
|
BscAdapter01: '0xA31d9C571DF00e0F428B0bD24c34D103E8112222',
|
|
168
|
-
BscAdapter02: '
|
|
169
|
-
BscBuyAdapter: '
|
|
171
|
+
BscAdapter02: '0x9A92D2649C38415860FA59ba8B9a9960cd2839Db',
|
|
172
|
+
BscBuyAdapter: '0xd32C191e0febaa6Cc93A29Cb676474c72486E00b',
|
|
170
173
|
},
|
|
171
174
|
rpcPollingMaxAllowedStateDelayInBlocks: 1,
|
|
172
175
|
rpcPollingBlocksBackToTriggerUpdate: 1,
|
|
@@ -189,12 +192,13 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
189
192
|
multicallV2Address: '0x275617327c958bD06b5D6b871E7f491D76113dd8',
|
|
190
193
|
privateHttpProvider: process.env.HTTP_PROVIDER_137,
|
|
191
194
|
hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
|
|
195
|
+
smardexSubgraphAuthToken: process.env.API_KEY_SMARDEX_SUBGRAPH || '',
|
|
192
196
|
hashFlowDisabledMMs:
|
|
193
197
|
process.env[`HASHFLOW_DISABLED_MMS_137`]?.split(',') || [],
|
|
194
198
|
adapterAddresses: {
|
|
195
199
|
PolygonAdapter01: '0xE44769f42E1e9592f86B82f206407a8f7C84b4ed',
|
|
196
|
-
PolygonAdapter02: '
|
|
197
|
-
PolygonBuyAdapter: '
|
|
200
|
+
PolygonAdapter02: '0x84bEF12C9931cE12662cc9F2366b6a5029E4BD29',
|
|
201
|
+
PolygonBuyAdapter: '0xBAEeb4540f59d30E567a5B563CC0c4587eDd9366',
|
|
198
202
|
},
|
|
199
203
|
uniswapV2ExchangeRouterAddress:
|
|
200
204
|
'0xf3938337F7294fEf84e9B2c6D548A93F956Cc281',
|
|
@@ -219,6 +223,7 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
219
223
|
multicallV2Address: '0xd7Fc8aD069f95B6e2835f4DEff03eF84241cF0E1',
|
|
220
224
|
privateHttpProvider: process.env.HTTP_PROVIDER_43114,
|
|
221
225
|
hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
|
|
226
|
+
smardexSubgraphAuthToken: process.env.API_KEY_SMARDEX_SUBGRAPH || '',
|
|
222
227
|
hashFlowDisabledMMs:
|
|
223
228
|
process.env[`HASHFLOW_DISABLED_MMS_43114`]?.split(',') || [],
|
|
224
229
|
dexalotAuthToken: process.env.API_KEY_DEXALOT_AUTH_TOKEN || '',
|
|
@@ -248,6 +253,7 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
248
253
|
multicallV2Address: '0xdC6E2b14260F972ad4e5a31c68294Fba7E720701',
|
|
249
254
|
privateHttpProvider: process.env.HTTP_PROVIDER_250,
|
|
250
255
|
hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
|
|
256
|
+
smardexSubgraphAuthToken: process.env.API_KEY_SMARDEX_SUBGRAPH || '',
|
|
251
257
|
hashFlowDisabledMMs:
|
|
252
258
|
process.env[`HASHFLOW_DISABLED_MMS_250`]?.split(',') || [],
|
|
253
259
|
|
|
@@ -276,13 +282,14 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
276
282
|
multicallV2Address: '0x7eCfBaa8742fDf5756DAC92fbc8b90a19b8815bF',
|
|
277
283
|
privateHttpProvider: process.env.HTTP_PROVIDER_42161,
|
|
278
284
|
hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
|
|
285
|
+
smardexSubgraphAuthToken: process.env.API_KEY_SMARDEX_SUBGRAPH || '',
|
|
279
286
|
swaapV2AuthToken: process.env.API_KEY_SWAAP_V2_AUTH_TOKEN || '',
|
|
280
287
|
hashFlowDisabledMMs:
|
|
281
288
|
process.env[`HASHFLOW_DISABLED_MMS_42161`]?.split(',') || [],
|
|
282
289
|
adapterAddresses: {
|
|
283
290
|
ArbitrumAdapter01: '0x369A2FDb910d432f0a07381a5E3d27572c876713',
|
|
284
|
-
ArbitrumAdapter02: '
|
|
285
|
-
ArbitrumBuyAdapter: '
|
|
291
|
+
ArbitrumAdapter02: '0x58a5f0b73969800FAFf8556cD2187E3FCE71A6cb',
|
|
292
|
+
ArbitrumBuyAdapter: '0x4483Ae378897eB9FbF7f15Df98Bf07233ffFEe8b',
|
|
286
293
|
},
|
|
287
294
|
uniswapV2ExchangeRouterAddress:
|
|
288
295
|
'0xB41dD984730dAf82f5C41489E21ac79D5e3B61bC',
|
|
@@ -306,6 +313,7 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
306
313
|
multicallV2Address: '0x2DC0E2aa608532Da689e89e237dF582B783E552C',
|
|
307
314
|
privateHttpProvider: process.env.HTTP_PROVIDER_10,
|
|
308
315
|
hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
|
|
316
|
+
smardexSubgraphAuthToken: process.env.API_KEY_SMARDEX_SUBGRAPH || '',
|
|
309
317
|
hashFlowDisabledMMs:
|
|
310
318
|
process.env[`HASHFLOW_DISABLED_MMS_10`]?.split(',') || [],
|
|
311
319
|
adapterAddresses: {
|
|
@@ -341,6 +349,7 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
341
349
|
rpcPollingMaxAllowedStateDelayInBlocks: 0,
|
|
342
350
|
rpcPollingBlocksBackToTriggerUpdate: 0,
|
|
343
351
|
hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
|
|
352
|
+
smardexSubgraphAuthToken: process.env.API_KEY_SMARDEX_SUBGRAPH || '',
|
|
344
353
|
hashFlowDisabledMMs:
|
|
345
354
|
process.env[`HASHFLOW_DISABLED_MMS_10`]?.split(',') || [],
|
|
346
355
|
uniswapV3EventLoggingSampleRate: 0,
|
|
@@ -363,10 +372,11 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
363
372
|
multicallV2Address: '0xeDF6D2a16e8081F777eB623EeB4411466556aF3d',
|
|
364
373
|
privateHttpProvider: process.env.HTTP_PROVIDER_8453,
|
|
365
374
|
hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
|
|
375
|
+
smardexSubgraphAuthToken: process.env.API_KEY_SMARDEX_SUBGRAPH || '',
|
|
366
376
|
hashFlowDisabledMMs: [],
|
|
367
377
|
adapterAddresses: {
|
|
368
|
-
BaseAdapter01: '
|
|
369
|
-
BaseBuyAdapter: '
|
|
378
|
+
BaseAdapter01: '0xA10c9a84E72d9DfF424Fe2284B6460784bed407E',
|
|
379
|
+
BaseBuyAdapter: '0xEECA9223063bD13e8ca77ed9e39a07f2BD1923E6',
|
|
370
380
|
},
|
|
371
381
|
uniswapV2ExchangeRouterAddress:
|
|
372
382
|
'0x75d199EfB540e47D27D52c62Da3E7daC2B9e834F',
|
|
@@ -416,6 +426,7 @@ export function generateConfig(network: number): Config {
|
|
|
416
426
|
rpcPollingBlocksBackToTriggerUpdate:
|
|
417
427
|
baseConfig.rpcPollingBlocksBackToTriggerUpdate,
|
|
418
428
|
hashFlowAuthToken: baseConfig.hashFlowAuthToken,
|
|
429
|
+
smardexSubgraphAuthToken: baseConfig.smardexSubgraphAuthToken,
|
|
419
430
|
swaapV2AuthToken: baseConfig.swaapV2AuthToken,
|
|
420
431
|
dexalotAuthToken: baseConfig.dexalotAuthToken,
|
|
421
432
|
hashFlowDisabledMMs: baseConfig.hashFlowDisabledMMs,
|
package/src/dex/index.ts
CHANGED
|
@@ -44,6 +44,7 @@ import { WooFiV2 } from './woo-fi-v2/woo-fi-v2';
|
|
|
44
44
|
import { ParaSwapLimitOrders } from './paraswap-limit-orders/paraswap-limit-orders';
|
|
45
45
|
import { AugustusRFQOrder } from './augustus-rfq';
|
|
46
46
|
import { Solidly } from './solidly/solidly';
|
|
47
|
+
import { SolidlyV3 } from './solidly-v3/solidly-v3';
|
|
47
48
|
import { Ramses } from './solidly/forks-override/ramses';
|
|
48
49
|
import { Thena } from './solidly/forks-override/thena';
|
|
49
50
|
import { Chronos } from './solidly/forks-override/chronos';
|
|
@@ -81,6 +82,7 @@ import { Algebra } from './algebra/algebra';
|
|
|
81
82
|
import { QuickPerps } from './quick-perps/quick-perps';
|
|
82
83
|
import { NomiswapV2 } from './uniswap-v2/nomiswap-v2';
|
|
83
84
|
import { Dexalot } from './dexalot/dexalot';
|
|
85
|
+
import { Smardex } from './smardex/smardex';
|
|
84
86
|
|
|
85
87
|
const LegacyDexes = [
|
|
86
88
|
CurveV2,
|
|
@@ -158,6 +160,8 @@ const Dexes = [
|
|
|
158
160
|
SwaapV2,
|
|
159
161
|
QuickPerps,
|
|
160
162
|
NomiswapV2,
|
|
163
|
+
SolidlyV3,
|
|
164
|
+
Smardex,
|
|
161
165
|
Wombat,
|
|
162
166
|
];
|
|
163
167
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DexParams } from './types';
|
|
2
|
+
import { DexConfigMap, AdapterMappings } from '../../types';
|
|
3
|
+
import { Network, SwapSide } from '../../constants';
|
|
4
|
+
|
|
5
|
+
const GATEWAY_SUBGRAPH = 'https://subgraph.smardex.io';
|
|
6
|
+
const MAINNET_INIT_HASH =
|
|
7
|
+
'0xc762a0f9885cc92b9fd8eef224b75997682b634460611bc0f2138986e20b653f';
|
|
8
|
+
const LAYER2_INIT_HASH =
|
|
9
|
+
'0x33bee911475f015247aeb1eebe149d1c6d2669be54126c29d85df6b0abb4c4e9';
|
|
10
|
+
|
|
11
|
+
export const SmardexConfig: DexConfigMap<DexParams> = {
|
|
12
|
+
Smardex: {
|
|
13
|
+
[Network.MAINNET]: {
|
|
14
|
+
factoryAddress: '0xB878DC600550367e14220d4916Ff678fB284214F',
|
|
15
|
+
router: '0xC33984ABcAe20f47a754eF78f6526FeF266c0C6F',
|
|
16
|
+
initCode: MAINNET_INIT_HASH,
|
|
17
|
+
subgraphURL: `${GATEWAY_SUBGRAPH}/ethereum`,
|
|
18
|
+
},
|
|
19
|
+
[Network.ARBITRUM]: {
|
|
20
|
+
factoryAddress: '0x41A00e3FbE7F479A99bA6822704d9c5dEB611F22',
|
|
21
|
+
router: '0xDA3970a20cdc2B1269fc96C4E8D300E0fdDB7b3D',
|
|
22
|
+
initCode: LAYER2_INIT_HASH,
|
|
23
|
+
subgraphURL: `${GATEWAY_SUBGRAPH}/arbitrum`,
|
|
24
|
+
},
|
|
25
|
+
[Network.BSC]: {
|
|
26
|
+
factoryAddress: '0xA8EF6FEa013034E62E2C4A9Ec1CDb059fE23Af33',
|
|
27
|
+
router: '0xaB3699B71e89a53c529eC037C3389B5A2Caf545A',
|
|
28
|
+
initCode: LAYER2_INIT_HASH,
|
|
29
|
+
subgraphURL: `${GATEWAY_SUBGRAPH}/bsc`,
|
|
30
|
+
},
|
|
31
|
+
[Network.POLYGON]: {
|
|
32
|
+
factoryAddress: '0x9A1e1681f6D59Ca051776410465AfAda6384398f',
|
|
33
|
+
router: '0xedD758D17175Dc9131992ebd02F55Cc4ebeb7B7c',
|
|
34
|
+
initCode: LAYER2_INIT_HASH,
|
|
35
|
+
subgraphURL: `${GATEWAY_SUBGRAPH}/polygon`,
|
|
36
|
+
},
|
|
37
|
+
[Network.BASE]: {
|
|
38
|
+
factoryAddress: '0xdd4536dD9636564D891c919416880a3e250f975A',
|
|
39
|
+
router: '0xF03D133627364E5eDDaB8134faB3A030cf7b3020',
|
|
40
|
+
initCode: LAYER2_INIT_HASH,
|
|
41
|
+
subgraphURL: `${GATEWAY_SUBGRAPH}/base`,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const Adapters: Record<number, AdapterMappings> = {
|
|
47
|
+
[Network.MAINNET]: {
|
|
48
|
+
[SwapSide.SELL]: [{ name: 'Adapter04', index: 6 }],
|
|
49
|
+
[SwapSide.BUY]: [{ name: 'BuyAdapter02', index: 2 }],
|
|
50
|
+
},
|
|
51
|
+
[Network.ARBITRUM]: {
|
|
52
|
+
[SwapSide.SELL]: [{ name: 'ArbitrumAdapter02', index: 9 }],
|
|
53
|
+
[SwapSide.BUY]: [{ name: 'ArbitrumBuyAdapter', index: 9 }],
|
|
54
|
+
},
|
|
55
|
+
[Network.BSC]: {
|
|
56
|
+
[SwapSide.SELL]: [{ name: 'BscAdapter02', index: 8 }],
|
|
57
|
+
[SwapSide.BUY]: [{ name: 'BscBuyAdapter', index: 7 }],
|
|
58
|
+
},
|
|
59
|
+
[Network.POLYGON]: {
|
|
60
|
+
[SwapSide.SELL]: [{ name: 'PolygonAdapter02', index: 9 }],
|
|
61
|
+
[SwapSide.BUY]: [{ name: 'PolygonBuyAdapter', index: 8 }],
|
|
62
|
+
},
|
|
63
|
+
[Network.BASE]: {
|
|
64
|
+
[SwapSide.SELL]: [{ name: 'BaseAdapter01', index: 8 }],
|
|
65
|
+
[SwapSide.BUY]: [{ name: 'BaseBuyAdapter', index: 5 }],
|
|
66
|
+
},
|
|
67
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// event Sync (uint256 reserve0, uint256 reserve1, uint256 fictiveReserve0, uint256 fictiveReserve1, uint256 priceAverage0, uint256 priceAverage1)
|
|
2
|
+
import { SmardexFees } from './types';
|
|
3
|
+
|
|
4
|
+
export enum TOPICS {
|
|
5
|
+
SYNC_EVENT = '0x2a368c7f33bb86e2d999940a3989d849031aff29b750f67947e6b8e8c3d2ffd6',
|
|
6
|
+
SWAP_EVENT = '0xa4228e1eb11eb9b31069d9ed20e7af9a010ca1a02d4855cee54e08e188fcc32c',
|
|
7
|
+
FEES_EVENT = '0x64f84976d9c917a44796104a59950fdbd9b3c16a5dd348b546d738301f6bd068',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum SmardexRouterFunctions {
|
|
11
|
+
sellExactEth = 'swapExactETHForTokens',
|
|
12
|
+
sellExactToken = 'swapExactTokensForETH',
|
|
13
|
+
swapExactIn = 'swapExactTokensForTokens',
|
|
14
|
+
buyExactEth = 'swapTokensForExactETH',
|
|
15
|
+
buyExactToken = 'swapETHForExactTokens',
|
|
16
|
+
swapExactOut = 'swapTokensForExactTokens',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const directSmardexFunctionName = [
|
|
20
|
+
SmardexRouterFunctions.sellExactEth,
|
|
21
|
+
SmardexRouterFunctions.sellExactToken,
|
|
22
|
+
SmardexRouterFunctions.swapExactIn,
|
|
23
|
+
SmardexRouterFunctions.buyExactEth,
|
|
24
|
+
SmardexRouterFunctions.buyExactToken,
|
|
25
|
+
SmardexRouterFunctions.swapExactOut,
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
export const SUBGRAPH_TIMEOUT = 20 * 1000;
|
|
29
|
+
|
|
30
|
+
export const DefaultSmardexPoolGasCost = 130 * 1000;
|
|
31
|
+
|
|
32
|
+
export const FEES_LAYER_ONE: SmardexFees = {
|
|
33
|
+
feesLP: 500n,
|
|
34
|
+
feesPool: 200n,
|
|
35
|
+
};
|