@paraswap/dex-lib 4.7.16 → 4.7.17-uniswap-v4-hooks-support.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.
- package/build/abi/uniswap-v4/hooks/arena/arena-fee-helper.abi.json +0 -465
- package/build/dex/uniswap-v4/config.js +2 -0
- package/build/dex/uniswap-v4/config.js.map +1 -1
- package/build/dex/uniswap-v4/contract-math/uniswap-v4-pool-math.d.ts +2 -1
- package/build/dex/uniswap-v4/contract-math/uniswap-v4-pool-math.js +32 -13
- package/build/dex/uniswap-v4/contract-math/uniswap-v4-pool-math.js.map +1 -1
- package/build/dex/uniswap-v4/hooks/arena/arena-hook.d.ts +14 -13
- package/build/dex/uniswap-v4/hooks/arena/arena-hook.js +35 -60
- package/build/dex/uniswap-v4/hooks/arena/arena-hook.js.map +1 -1
- package/build/dex/uniswap-v4/hooks/arena/config.d.ts +3 -0
- package/build/dex/uniswap-v4/hooks/arena/config.js +11 -0
- package/build/dex/uniswap-v4/hooks/arena/config.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/arena/types.d.ts +5 -0
- package/build/dex/uniswap-v4/hooks/arena/types.js +3 -0
- package/build/dex/uniswap-v4/hooks/arena/types.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/types.d.ts +11 -3
- package/build/dex/uniswap-v4/subgraph.d.ts +4 -4
- package/build/dex/uniswap-v4/subgraph.js +68 -41
- package/build/dex/uniswap-v4/subgraph.js.map +1 -1
- package/build/dex/uniswap-v4/types.d.ts +2 -0
- package/build/dex/uniswap-v4/uniswap-v4-pool-manager.d.ts +6 -1
- package/build/dex/uniswap-v4/uniswap-v4-pool-manager.js +21 -7
- package/build/dex/uniswap-v4/uniswap-v4-pool-manager.js.map +1 -1
- package/build/dex/uniswap-v4/uniswap-v4-pool.d.ts +3 -1
- package/build/dex/uniswap-v4/uniswap-v4-pool.js +3 -1
- package/build/dex/uniswap-v4/uniswap-v4-pool.js.map +1 -1
- package/build/dex/uniswap-v4/uniswap-v4.d.ts +3 -1
- package/build/dex/uniswap-v4/uniswap-v4.js +12 -5
- package/build/dex/uniswap-v4/uniswap-v4.js.map +1 -1
- package/build/dex/uniswap-v4/utils.d.ts +2 -1
- package/build/dex/uniswap-v4/utils.js +11 -0
- package/build/dex/uniswap-v4/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,267 +1,4 @@
|
|
|
1
1
|
[
|
|
2
|
-
{
|
|
3
|
-
"inputs": [
|
|
4
|
-
{ "internalType": "address", "name": "_owner", "type": "address" },
|
|
5
|
-
{
|
|
6
|
-
"internalType": "address",
|
|
7
|
-
"name": "_referralRegistry",
|
|
8
|
-
"type": "address"
|
|
9
|
-
},
|
|
10
|
-
{ "internalType": "uint16", "name": "_protocolFeePpm", "type": "uint16" },
|
|
11
|
-
{
|
|
12
|
-
"internalType": "address",
|
|
13
|
-
"name": "_protocolFeeRecipient",
|
|
14
|
-
"type": "address"
|
|
15
|
-
},
|
|
16
|
-
{ "internalType": "uint16", "name": "_referralFeePpm", "type": "uint16" }
|
|
17
|
-
],
|
|
18
|
-
"stateMutability": "nonpayable",
|
|
19
|
-
"type": "constructor"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"inputs": [],
|
|
23
|
-
"name": "FeeArrayLengthExceedsMaxFeeArrayLength",
|
|
24
|
-
"type": "error"
|
|
25
|
-
},
|
|
26
|
-
{ "inputs": [], "name": "FeeRecipientNotFound", "type": "error" },
|
|
27
|
-
{ "inputs": [], "name": "FeeSetterOnly", "type": "error" },
|
|
28
|
-
{ "inputs": [], "name": "FeesAlreadyInitialized", "type": "error" },
|
|
29
|
-
{
|
|
30
|
-
"inputs": [
|
|
31
|
-
{ "internalType": "address", "name": "owner", "type": "address" }
|
|
32
|
-
],
|
|
33
|
-
"name": "OwnableInvalidOwner",
|
|
34
|
-
"type": "error"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"inputs": [
|
|
38
|
-
{ "internalType": "address", "name": "account", "type": "address" }
|
|
39
|
-
],
|
|
40
|
-
"name": "OwnableUnauthorizedAccount",
|
|
41
|
-
"type": "error"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"inputs": [],
|
|
45
|
-
"name": "ProtocolFeePpmMustBeGreaterThanReferralFeePpm",
|
|
46
|
-
"type": "error"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"inputs": [],
|
|
50
|
-
"name": "ProtocolFeePpmMustBeGreaterThanZero",
|
|
51
|
-
"type": "error"
|
|
52
|
-
},
|
|
53
|
-
{ "inputs": [], "name": "RecipientCantBeZeroAddress", "type": "error" },
|
|
54
|
-
{
|
|
55
|
-
"inputs": [],
|
|
56
|
-
"name": "RecipientIndexDoesNotMatchRecipient",
|
|
57
|
-
"type": "error"
|
|
58
|
-
},
|
|
59
|
-
{ "inputs": [], "name": "RecipientIndexOutOfBounds", "type": "error" },
|
|
60
|
-
{ "inputs": [], "name": "TotalFeePpmBelowMinFeePpm", "type": "error" },
|
|
61
|
-
{ "inputs": [], "name": "TotalFeePpmExceedsMaxFeePpm", "type": "error" },
|
|
62
|
-
{
|
|
63
|
-
"anonymous": false,
|
|
64
|
-
"inputs": [
|
|
65
|
-
{
|
|
66
|
-
"indexed": true,
|
|
67
|
-
"internalType": "PoolId",
|
|
68
|
-
"name": "poolId",
|
|
69
|
-
"type": "bytes32"
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
"components": [
|
|
73
|
-
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
74
|
-
{ "internalType": "uint16", "name": "feePpm", "type": "uint16" }
|
|
75
|
-
],
|
|
76
|
-
"indexed": false,
|
|
77
|
-
"internalType": "struct IArenaFeeHelperMinimal.Fee[]",
|
|
78
|
-
"name": "fees",
|
|
79
|
-
"type": "tuple[]"
|
|
80
|
-
}
|
|
81
|
-
],
|
|
82
|
-
"name": "FeeArraySet",
|
|
83
|
-
"type": "event"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"anonymous": false,
|
|
87
|
-
"inputs": [
|
|
88
|
-
{
|
|
89
|
-
"indexed": true,
|
|
90
|
-
"internalType": "address",
|
|
91
|
-
"name": "feeSetter",
|
|
92
|
-
"type": "address"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"indexed": false,
|
|
96
|
-
"internalType": "bool",
|
|
97
|
-
"name": "isFeeSetter",
|
|
98
|
-
"type": "bool"
|
|
99
|
-
}
|
|
100
|
-
],
|
|
101
|
-
"name": "FeeSetterSet",
|
|
102
|
-
"type": "event"
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"anonymous": false,
|
|
106
|
-
"inputs": [
|
|
107
|
-
{
|
|
108
|
-
"indexed": true,
|
|
109
|
-
"internalType": "address",
|
|
110
|
-
"name": "previousOwner",
|
|
111
|
-
"type": "address"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"indexed": true,
|
|
115
|
-
"internalType": "address",
|
|
116
|
-
"name": "newOwner",
|
|
117
|
-
"type": "address"
|
|
118
|
-
}
|
|
119
|
-
],
|
|
120
|
-
"name": "OwnershipTransferStarted",
|
|
121
|
-
"type": "event"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"anonymous": false,
|
|
125
|
-
"inputs": [
|
|
126
|
-
{
|
|
127
|
-
"indexed": true,
|
|
128
|
-
"internalType": "address",
|
|
129
|
-
"name": "previousOwner",
|
|
130
|
-
"type": "address"
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
"indexed": true,
|
|
134
|
-
"internalType": "address",
|
|
135
|
-
"name": "newOwner",
|
|
136
|
-
"type": "address"
|
|
137
|
-
}
|
|
138
|
-
],
|
|
139
|
-
"name": "OwnershipTransferred",
|
|
140
|
-
"type": "event"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"anonymous": false,
|
|
144
|
-
"inputs": [
|
|
145
|
-
{
|
|
146
|
-
"components": [
|
|
147
|
-
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
148
|
-
{
|
|
149
|
-
"internalType": "uint16",
|
|
150
|
-
"name": "protocolFeePpm",
|
|
151
|
-
"type": "uint16"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"internalType": "uint16",
|
|
155
|
-
"name": "referralFeePpm",
|
|
156
|
-
"type": "uint16"
|
|
157
|
-
}
|
|
158
|
-
],
|
|
159
|
-
"indexed": false,
|
|
160
|
-
"internalType": "struct ArenaFeeHelper.ProtocolFeeSettings",
|
|
161
|
-
"name": "settings",
|
|
162
|
-
"type": "tuple"
|
|
163
|
-
}
|
|
164
|
-
],
|
|
165
|
-
"name": "ProtocolFeeSettingsSet",
|
|
166
|
-
"type": "event"
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
"anonymous": false,
|
|
170
|
-
"inputs": [
|
|
171
|
-
{
|
|
172
|
-
"indexed": false,
|
|
173
|
-
"internalType": "address",
|
|
174
|
-
"name": "referralRegistry",
|
|
175
|
-
"type": "address"
|
|
176
|
-
}
|
|
177
|
-
],
|
|
178
|
-
"name": "ReferralRegistrySet",
|
|
179
|
-
"type": "event"
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
"inputs": [],
|
|
183
|
-
"name": "MAX_FEE_ARRAY_LENGTH",
|
|
184
|
-
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
185
|
-
"stateMutability": "view",
|
|
186
|
-
"type": "function"
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
"inputs": [],
|
|
190
|
-
"name": "MAX_POOL_FEE_PPM",
|
|
191
|
-
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
192
|
-
"stateMutability": "view",
|
|
193
|
-
"type": "function"
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
"inputs": [],
|
|
197
|
-
"name": "MAX_PROTOCOL_FEE_PPM",
|
|
198
|
-
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
199
|
-
"stateMutability": "view",
|
|
200
|
-
"type": "function"
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
"inputs": [],
|
|
204
|
-
"name": "acceptOwnership",
|
|
205
|
-
"outputs": [],
|
|
206
|
-
"stateMutability": "nonpayable",
|
|
207
|
-
"type": "function"
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
"inputs": [
|
|
211
|
-
{ "internalType": "PoolId", "name": "poolId", "type": "bytes32" },
|
|
212
|
-
{ "internalType": "address", "name": "_recipient", "type": "address" },
|
|
213
|
-
{ "internalType": "uint16", "name": "_feePpm", "type": "uint16" }
|
|
214
|
-
],
|
|
215
|
-
"name": "addFeeRecipient",
|
|
216
|
-
"outputs": [],
|
|
217
|
-
"stateMutability": "nonpayable",
|
|
218
|
-
"type": "function"
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
"inputs": [
|
|
222
|
-
{ "internalType": "PoolId", "name": "poolId", "type": "bytes32" }
|
|
223
|
-
],
|
|
224
|
-
"name": "getFeesForPool",
|
|
225
|
-
"outputs": [
|
|
226
|
-
{
|
|
227
|
-
"components": [
|
|
228
|
-
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
229
|
-
{ "internalType": "uint16", "name": "feePpm", "type": "uint16" }
|
|
230
|
-
],
|
|
231
|
-
"internalType": "struct IArenaFeeHelperMinimal.Fee[]",
|
|
232
|
-
"name": "feeRecipients",
|
|
233
|
-
"type": "tuple[]"
|
|
234
|
-
}
|
|
235
|
-
],
|
|
236
|
-
"stateMutability": "view",
|
|
237
|
-
"type": "function"
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
"inputs": [],
|
|
241
|
-
"name": "getProtocolFeeSettings",
|
|
242
|
-
"outputs": [
|
|
243
|
-
{
|
|
244
|
-
"components": [
|
|
245
|
-
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
246
|
-
{
|
|
247
|
-
"internalType": "uint16",
|
|
248
|
-
"name": "protocolFeePpm",
|
|
249
|
-
"type": "uint16"
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
"internalType": "uint16",
|
|
253
|
-
"name": "referralFeePpm",
|
|
254
|
-
"type": "uint16"
|
|
255
|
-
}
|
|
256
|
-
],
|
|
257
|
-
"internalType": "struct ArenaFeeHelper.ProtocolFeeSettings",
|
|
258
|
-
"name": "",
|
|
259
|
-
"type": "tuple"
|
|
260
|
-
}
|
|
261
|
-
],
|
|
262
|
-
"stateMutability": "view",
|
|
263
|
-
"type": "function"
|
|
264
|
-
},
|
|
265
2
|
{
|
|
266
3
|
"inputs": [
|
|
267
4
|
{ "internalType": "PoolId", "name": "poolId", "type": "bytes32" }
|
|
@@ -270,207 +7,5 @@
|
|
|
270
7
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
271
8
|
"stateMutability": "view",
|
|
272
9
|
"type": "function"
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
"inputs": [
|
|
276
|
-
{ "internalType": "PoolId", "name": "poolId", "type": "bytes32" },
|
|
277
|
-
{
|
|
278
|
-
"components": [
|
|
279
|
-
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
280
|
-
{ "internalType": "uint16", "name": "feePpm", "type": "uint16" }
|
|
281
|
-
],
|
|
282
|
-
"internalType": "struct IArenaFeeHelperMinimal.Fee[]",
|
|
283
|
-
"name": "_fees",
|
|
284
|
-
"type": "tuple[]"
|
|
285
|
-
}
|
|
286
|
-
],
|
|
287
|
-
"name": "initializeFeesForPool",
|
|
288
|
-
"outputs": [],
|
|
289
|
-
"stateMutability": "nonpayable",
|
|
290
|
-
"type": "function"
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
294
|
-
"name": "isFeeSetter",
|
|
295
|
-
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
296
|
-
"stateMutability": "view",
|
|
297
|
-
"type": "function"
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
"inputs": [],
|
|
301
|
-
"name": "owner",
|
|
302
|
-
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
303
|
-
"stateMutability": "view",
|
|
304
|
-
"type": "function"
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
"inputs": [],
|
|
308
|
-
"name": "pendingOwner",
|
|
309
|
-
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
310
|
-
"stateMutability": "view",
|
|
311
|
-
"type": "function"
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
"inputs": [
|
|
315
|
-
{ "internalType": "PoolId", "name": "", "type": "bytes32" },
|
|
316
|
-
{ "internalType": "uint256", "name": "", "type": "uint256" }
|
|
317
|
-
],
|
|
318
|
-
"name": "poolIdToFees",
|
|
319
|
-
"outputs": [
|
|
320
|
-
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
321
|
-
{ "internalType": "uint16", "name": "feePpm", "type": "uint16" }
|
|
322
|
-
],
|
|
323
|
-
"stateMutability": "view",
|
|
324
|
-
"type": "function"
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
"inputs": [{ "internalType": "PoolId", "name": "", "type": "bytes32" }],
|
|
328
|
-
"name": "poolIdToTotalFeePpm",
|
|
329
|
-
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
330
|
-
"stateMutability": "view",
|
|
331
|
-
"type": "function"
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
"inputs": [],
|
|
335
|
-
"name": "protocolFeeSettings",
|
|
336
|
-
"outputs": [
|
|
337
|
-
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
338
|
-
{ "internalType": "uint16", "name": "protocolFeePpm", "type": "uint16" },
|
|
339
|
-
{ "internalType": "uint16", "name": "referralFeePpm", "type": "uint16" }
|
|
340
|
-
],
|
|
341
|
-
"stateMutability": "view",
|
|
342
|
-
"type": "function"
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
"inputs": [],
|
|
346
|
-
"name": "referralRegistry",
|
|
347
|
-
"outputs": [
|
|
348
|
-
{
|
|
349
|
-
"internalType": "contract IArenaReferralRegistry",
|
|
350
|
-
"name": "",
|
|
351
|
-
"type": "address"
|
|
352
|
-
}
|
|
353
|
-
],
|
|
354
|
-
"stateMutability": "view",
|
|
355
|
-
"type": "function"
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
"inputs": [
|
|
359
|
-
{ "internalType": "PoolId", "name": "poolId", "type": "bytes32" },
|
|
360
|
-
{ "internalType": "address", "name": "_recipient", "type": "address" },
|
|
361
|
-
{
|
|
362
|
-
"internalType": "uint256",
|
|
363
|
-
"name": "_recipientIndex",
|
|
364
|
-
"type": "uint256"
|
|
365
|
-
}
|
|
366
|
-
],
|
|
367
|
-
"name": "removeFeeRecipient",
|
|
368
|
-
"outputs": [],
|
|
369
|
-
"stateMutability": "nonpayable",
|
|
370
|
-
"type": "function"
|
|
371
|
-
},
|
|
372
|
-
{
|
|
373
|
-
"inputs": [],
|
|
374
|
-
"name": "renounceOwnership",
|
|
375
|
-
"outputs": [],
|
|
376
|
-
"stateMutability": "nonpayable",
|
|
377
|
-
"type": "function"
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
"inputs": [
|
|
381
|
-
{ "internalType": "address", "name": "_feeSetter", "type": "address" },
|
|
382
|
-
{ "internalType": "bool", "name": "_isFeeSetter", "type": "bool" }
|
|
383
|
-
],
|
|
384
|
-
"name": "setFeeSetter",
|
|
385
|
-
"outputs": [],
|
|
386
|
-
"stateMutability": "nonpayable",
|
|
387
|
-
"type": "function"
|
|
388
|
-
},
|
|
389
|
-
{
|
|
390
|
-
"inputs": [
|
|
391
|
-
{ "internalType": "address", "name": "_recipient", "type": "address" },
|
|
392
|
-
{ "internalType": "uint16", "name": "_protocolFeePpm", "type": "uint16" },
|
|
393
|
-
{ "internalType": "uint16", "name": "_referralFeePpm", "type": "uint16" }
|
|
394
|
-
],
|
|
395
|
-
"name": "setProtocolFeeSettings",
|
|
396
|
-
"outputs": [],
|
|
397
|
-
"stateMutability": "nonpayable",
|
|
398
|
-
"type": "function"
|
|
399
|
-
},
|
|
400
|
-
{
|
|
401
|
-
"inputs": [
|
|
402
|
-
{
|
|
403
|
-
"internalType": "address",
|
|
404
|
-
"name": "_referralRegistry",
|
|
405
|
-
"type": "address"
|
|
406
|
-
}
|
|
407
|
-
],
|
|
408
|
-
"name": "setReferralRegistry",
|
|
409
|
-
"outputs": [],
|
|
410
|
-
"stateMutability": "nonpayable",
|
|
411
|
-
"type": "function"
|
|
412
|
-
},
|
|
413
|
-
{
|
|
414
|
-
"inputs": [
|
|
415
|
-
{ "internalType": "address", "name": "newOwner", "type": "address" }
|
|
416
|
-
],
|
|
417
|
-
"name": "transferOwnership",
|
|
418
|
-
"outputs": [],
|
|
419
|
-
"stateMutability": "nonpayable",
|
|
420
|
-
"type": "function"
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
"inputs": [
|
|
424
|
-
{ "internalType": "PoolId", "name": "poolId", "type": "bytes32" },
|
|
425
|
-
{
|
|
426
|
-
"components": [
|
|
427
|
-
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
428
|
-
{ "internalType": "uint16", "name": "feePpm", "type": "uint16" }
|
|
429
|
-
],
|
|
430
|
-
"internalType": "struct IArenaFeeHelperMinimal.Fee[]",
|
|
431
|
-
"name": "_fees",
|
|
432
|
-
"type": "tuple[]"
|
|
433
|
-
}
|
|
434
|
-
],
|
|
435
|
-
"name": "updateFeesForPool",
|
|
436
|
-
"outputs": [],
|
|
437
|
-
"stateMutability": "nonpayable",
|
|
438
|
-
"type": "function"
|
|
439
|
-
},
|
|
440
|
-
{
|
|
441
|
-
"inputs": [
|
|
442
|
-
{ "internalType": "PoolId", "name": "poolId", "type": "bytes32" },
|
|
443
|
-
{
|
|
444
|
-
"internalType": "address",
|
|
445
|
-
"name": "_recipientToReplace",
|
|
446
|
-
"type": "address"
|
|
447
|
-
},
|
|
448
|
-
{ "internalType": "address", "name": "_newRecipient", "type": "address" },
|
|
449
|
-
{
|
|
450
|
-
"internalType": "uint256",
|
|
451
|
-
"name": "_recipientIndex",
|
|
452
|
-
"type": "uint256"
|
|
453
|
-
}
|
|
454
|
-
],
|
|
455
|
-
"name": "updateRecipientAddress",
|
|
456
|
-
"outputs": [],
|
|
457
|
-
"stateMutability": "nonpayable",
|
|
458
|
-
"type": "function"
|
|
459
|
-
},
|
|
460
|
-
{
|
|
461
|
-
"inputs": [
|
|
462
|
-
{ "internalType": "PoolId", "name": "poolId", "type": "bytes32" },
|
|
463
|
-
{ "internalType": "address", "name": "_recipient", "type": "address" },
|
|
464
|
-
{ "internalType": "uint16", "name": "_feePpm", "type": "uint16" },
|
|
465
|
-
{
|
|
466
|
-
"internalType": "uint256",
|
|
467
|
-
"name": "_recipientIndex",
|
|
468
|
-
"type": "uint256"
|
|
469
|
-
}
|
|
470
|
-
],
|
|
471
|
-
"name": "updateRecipientFeePpm",
|
|
472
|
-
"outputs": [],
|
|
473
|
-
"stateMutability": "nonpayable",
|
|
474
|
-
"type": "function"
|
|
475
10
|
}
|
|
476
11
|
]
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UniswapV4PoolsList = exports.UniswapV4Config = void 0;
|
|
4
4
|
const constants_1 = require("../../constants");
|
|
5
|
+
const arena_hook_1 = require("./hooks/arena/arena-hook");
|
|
5
6
|
exports.UniswapV4Config = {
|
|
6
7
|
UniswapV4: {
|
|
7
8
|
[constants_1.Network.MAINNET]: {
|
|
@@ -53,6 +54,7 @@ exports.UniswapV4Config = {
|
|
|
53
54
|
router: '0x94b75331ae8d42c1b61065089b7d48fe14aa73b7',
|
|
54
55
|
stateView: '0xc3c9e198c735a4b97e3e683f391ccbdd60b69286',
|
|
55
56
|
stateMulticall: '0xf03feb5d6b26a68a773f1a77d7880fc5bdcc0581',
|
|
57
|
+
supportedHooks: [arena_hook_1.ArenaHook],
|
|
56
58
|
},
|
|
57
59
|
[constants_1.Network.BSC]: {
|
|
58
60
|
poolManager: '0x28e2ea090877bf75740558f6bfb36a5ffee9e9df',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/uniswap-v4/config.ts"],"names":[],"mappings":";;;AACA,+CAA0C;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/uniswap-v4/config.ts"],"names":[],"mappings":";;;AACA,+CAA0C;AAE1C,yDAAqD;AAExC,QAAA,eAAe,GAA4B;IACtD,SAAS,EAAE;QACT,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB,WAAW,EAAE,4CAA4C;YACzD,WAAW,EAAE,8CAA8C;YAC3D,MAAM,EAAE,4CAA4C;YACpD,MAAM,EAAE,4CAA4C;YACpD,SAAS,EAAE,4CAA4C;YACvD,cAAc,EAAE,4CAA4C;SAC7D;QACD,CAAC,mBAAO,CAAC,IAAI,CAAC,EAAE;YACd,WAAW,EAAE,4CAA4C;YACzD,+DAA+D;YAC/D,WAAW,EAAE,8CAA8C;YAC3D,MAAM,EAAE,4CAA4C;YACpD,MAAM,EAAE,4CAA4C;YACpD,SAAS,EAAE,4CAA4C;YACvD,+BAA+B,EAAE,IAAI;YACrC,cAAc,EAAE,4CAA4C;SAC7D;QACD,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE;YAClB,WAAW,EAAE,4CAA4C;YACzD,WAAW,EAAE,8CAA8C;YAC3D,MAAM,EAAE,4CAA4C;YACpD,MAAM,EAAE,4CAA4C;YACpD,SAAS,EAAE,4CAA4C;YACvD,cAAc,EAAE,4CAA4C;SAC7D;QACD,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE;YAClB,WAAW,EAAE,4CAA4C;YACzD,WAAW,EAAE,8CAA8C;YAC3D,MAAM,EAAE,4CAA4C;YACpD,MAAM,EAAE,4CAA4C;YACpD,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iFAAiF;QACjF,OAAO;QACP,KAAK;KACN;CACF,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { PoolState, ModifyLiquidityParams, Pool } from '../types';
|
|
|
2
2
|
import { DeepReadonly } from 'ts-essentials';
|
|
3
3
|
import { SwapSide } from '@paraswap/core';
|
|
4
4
|
import { Logger } from 'log4js';
|
|
5
|
+
import { IBaseHook } from '../hooks/types';
|
|
5
6
|
type SwapParams = {
|
|
6
7
|
amountSpecified: bigint;
|
|
7
8
|
tickSpacing: bigint;
|
|
@@ -10,7 +11,7 @@ type SwapParams = {
|
|
|
10
11
|
lpFeeOverride: bigint;
|
|
11
12
|
};
|
|
12
13
|
declare class UniswapV4PoolMath {
|
|
13
|
-
queryOutputs(pool: Pool, poolState: DeepReadonly<PoolState>, amounts: bigint[], zeroForOne: boolean, side: SwapSide): bigint[]
|
|
14
|
+
queryOutputs(pool: Pool, poolState: DeepReadonly<PoolState>, amounts: bigint[], zeroForOne: boolean, side: SwapSide, hook?: IBaseHook): Promise<bigint[]>;
|
|
14
15
|
_swap(poolState: PoolState, params: SwapParams): [bigint, bigint];
|
|
15
16
|
tickSpacingToMaxLiquidityPerTick(tickSpacing: bigint): bigint;
|
|
16
17
|
checkPoolInitialized(poolState: PoolState): void;
|
|
@@ -15,52 +15,71 @@ const BalanceDelta_1 = require("./BalanceDelta");
|
|
|
15
15
|
const core_1 = require("@paraswap/core");
|
|
16
16
|
const constants_1 = require("../constants");
|
|
17
17
|
const LPFeeLibrary_1 = require("./LPFeeLibrary");
|
|
18
|
+
const constants_2 = require("../../../constants");
|
|
18
19
|
class UniswapV4PoolMath {
|
|
19
|
-
queryOutputs(pool, poolState, amounts, zeroForOne, side) {
|
|
20
|
+
async queryOutputs(pool, poolState, amounts, zeroForOne, side, hook) {
|
|
20
21
|
const isSell = side === core_1.SwapSide.SELL;
|
|
21
22
|
if (isSell) {
|
|
22
|
-
return amounts.map(amount => {
|
|
23
|
+
return Promise.all(amounts.map(async (amount) => {
|
|
23
24
|
if (amount === 0n) {
|
|
24
25
|
return 0n;
|
|
25
26
|
}
|
|
27
|
+
const sqrtPriceLimitX96 = zeroForOne
|
|
28
|
+
? TickMath_1.TickMath.MIN_SQRT_PRICE + 1n
|
|
29
|
+
: TickMath_1.TickMath.MAX_SQRT_PRICE - 1n;
|
|
26
30
|
const amountSpecified = -amount;
|
|
27
31
|
const [amount0, amount1] = this._swap(poolState, {
|
|
28
32
|
zeroForOne,
|
|
29
33
|
amountSpecified,
|
|
30
34
|
tickSpacing: BigInt(pool.key.tickSpacing),
|
|
31
|
-
sqrtPriceLimitX96
|
|
32
|
-
? TickMath_1.TickMath.MIN_SQRT_PRICE + 1n
|
|
33
|
-
: TickMath_1.TickMath.MAX_SQRT_PRICE - 1n,
|
|
35
|
+
sqrtPriceLimitX96,
|
|
34
36
|
lpFeeOverride: 0n,
|
|
35
37
|
});
|
|
36
38
|
const amountSpecifiedActual = zeroForOne === amountSpecified < 0n ? amount0 : amount1;
|
|
37
39
|
if (amountSpecifiedActual !== amountSpecified) {
|
|
38
40
|
return 0n;
|
|
39
41
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
let output = zeroForOne ? amount1 : amount0;
|
|
43
|
+
if (hook?.getHookPermissions().afterSwap) {
|
|
44
|
+
output = await hook.afterSwap(constants_2.NULL_ADDRESS, pool.key, {
|
|
45
|
+
zeroForOne,
|
|
46
|
+
amountSpecified: amountSpecified.toString(),
|
|
47
|
+
sqrtPriceLimitX96: sqrtPriceLimitX96.toString(),
|
|
48
|
+
}, { amount0, amount1 }, '0x');
|
|
49
|
+
}
|
|
50
|
+
return output;
|
|
51
|
+
}));
|
|
42
52
|
}
|
|
43
53
|
else {
|
|
44
|
-
return amounts.map(amount => {
|
|
54
|
+
return Promise.all(amounts.map(async (amount) => {
|
|
45
55
|
if (amount === 0n) {
|
|
46
56
|
return 0n;
|
|
47
57
|
}
|
|
58
|
+
const sqrtPriceLimitX96 = zeroForOne
|
|
59
|
+
? TickMath_1.TickMath.MIN_SQRT_PRICE + 1n
|
|
60
|
+
: TickMath_1.TickMath.MAX_SQRT_PRICE - 1n;
|
|
48
61
|
const amountSpecified = amount;
|
|
49
62
|
const [amount0, amount1] = this._swap(poolState, {
|
|
50
63
|
zeroForOne,
|
|
51
64
|
amountSpecified: amount,
|
|
52
65
|
tickSpacing: BigInt(pool.key.tickSpacing),
|
|
53
|
-
sqrtPriceLimitX96
|
|
54
|
-
? TickMath_1.TickMath.MIN_SQRT_PRICE + 1n
|
|
55
|
-
: TickMath_1.TickMath.MAX_SQRT_PRICE - 1n,
|
|
66
|
+
sqrtPriceLimitX96,
|
|
56
67
|
lpFeeOverride: 0n,
|
|
57
68
|
});
|
|
58
69
|
const amountSpecifiedActual = zeroForOne === amountSpecified < 0n ? amount0 : amount1;
|
|
59
70
|
if (amountSpecifiedActual !== amountSpecified) {
|
|
60
71
|
return 0n;
|
|
61
72
|
}
|
|
62
|
-
|
|
63
|
-
|
|
73
|
+
let output = zeroForOne ? -amount0 : -amount1;
|
|
74
|
+
if (hook?.getHookPermissions().afterSwap) {
|
|
75
|
+
output = await hook.afterSwap(constants_2.NULL_ADDRESS, pool.key, {
|
|
76
|
+
zeroForOne,
|
|
77
|
+
amountSpecified: amountSpecified.toString(),
|
|
78
|
+
sqrtPriceLimitX96: sqrtPriceLimitX96.toString(),
|
|
79
|
+
}, { amount0, amount1 }, '0x');
|
|
80
|
+
}
|
|
81
|
+
return output;
|
|
82
|
+
}));
|
|
64
83
|
}
|
|
65
84
|
}
|
|
66
85
|
_swap(poolState, params) {
|