Skip to content

Commit d08ef18

Browse files
authored
Merge pull request #917 from paraswap/aburkut/back-1883-uniswap-v4-pool-discovery
Aburkut/back 1883 uniswap v4 pool discovery
2 parents 695c984 + 22336ff commit d08ef18

13 files changed

+2501
-118
lines changed

src/abi/uniswap-v4/pool-manager.abi.json

+1,366
Large diffs are not rendered by default.
+365
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,365 @@
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+
]

src/dex/uniswap-v4/constants.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const SUBGRAPH_TIMEOUT = 30 * 1000;
2+
3+
export const POOL_CACHE_REFRESH_INTERVAL = 60 * 5; // 5 minutes

0 commit comments

Comments
 (0)