@paraswap/dex-lib 4.3.8 → 4.3.9-balancer-v3-reClamm.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/build/abi/PendleOracle.json +413 -0
  2. package/build/abi/balancer-v3/vault-extension.json +4 -4
  3. package/build/dex/aave-v3-pt-roll-over/aave-v3-pt-roll-over.d.ts +60 -0
  4. package/build/dex/aave-v3-pt-roll-over/aave-v3-pt-roll-over.js +481 -0
  5. package/build/dex/aave-v3-pt-roll-over/aave-v3-pt-roll-over.js.map +1 -0
  6. package/build/dex/aave-v3-pt-roll-over/config.d.ts +3 -0
  7. package/build/dex/aave-v3-pt-roll-over/config.js +39 -0
  8. package/build/dex/aave-v3-pt-roll-over/config.js.map +1 -0
  9. package/build/dex/aave-v3-pt-roll-over/types.d.ts +74 -0
  10. package/build/dex/aave-v3-pt-roll-over/types.js +3 -0
  11. package/build/dex/aave-v3-pt-roll-over/types.js.map +1 -0
  12. package/build/dex/balancer-v3/balancer-v3-pool.d.ts +1 -1
  13. package/build/dex/balancer-v3/balancer-v3-pool.js +33 -2
  14. package/build/dex/balancer-v3/balancer-v3-pool.js.map +1 -1
  15. package/build/dex/balancer-v3/balancer-v3.js +1 -1
  16. package/build/dex/balancer-v3/balancer-v3.js.map +1 -1
  17. package/build/dex/balancer-v3/config.d.ts +2 -1
  18. package/build/dex/balancer-v3/config.js +1 -0
  19. package/build/dex/balancer-v3/config.js.map +1 -1
  20. package/build/dex/balancer-v3/getGasCost.js +3 -0
  21. package/build/dex/balancer-v3/getGasCost.js.map +1 -1
  22. package/build/dex/balancer-v3/getOnChainState.js +27 -0
  23. package/build/dex/balancer-v3/getOnChainState.js.map +1 -1
  24. package/build/dex/balancer-v3/getPoolsApi.js +21 -5
  25. package/build/dex/balancer-v3/getPoolsApi.js.map +1 -1
  26. package/build/dex/balancer-v3/getTopPoolsApi.d.ts +1 -0
  27. package/build/dex/balancer-v3/getTopPoolsApi.js +3 -0
  28. package/build/dex/balancer-v3/getTopPoolsApi.js.map +1 -1
  29. package/build/dex/balancer-v3/reClammPool.d.ts +23 -0
  30. package/build/dex/balancer-v3/reClammPool.js +82 -0
  31. package/build/dex/balancer-v3/reClammPool.js.map +1 -0
  32. package/build/dex/balancer-v3/types.d.ts +3 -3
  33. package/build/dex/balancer-v3/utils.js +6 -1
  34. package/build/dex/balancer-v3/utils.js.map +1 -1
  35. package/package.json +2 -2
@@ -0,0 +1,413 @@
1
+ [
2
+ {
3
+ "inputs": [],
4
+ "stateMutability": "nonpayable",
5
+ "type": "constructor"
6
+ },
7
+ {
8
+ "inputs": [
9
+ {
10
+ "internalType": "uint256",
11
+ "name": "blockCycleNumerator",
12
+ "type": "uint256"
13
+ }
14
+ ],
15
+ "name": "InvalidBlockRate",
16
+ "type": "error"
17
+ },
18
+ {
19
+ "inputs": [
20
+ {
21
+ "internalType": "int256",
22
+ "name": "exchangeRate",
23
+ "type": "int256"
24
+ }
25
+ ],
26
+ "name": "MarketExchangeRateBelowOne",
27
+ "type": "error"
28
+ },
29
+ {
30
+ "inputs": [],
31
+ "name": "MarketExpired",
32
+ "type": "error"
33
+ },
34
+ {
35
+ "inputs": [],
36
+ "name": "MarketProportionMustNotEqualOne",
37
+ "type": "error"
38
+ },
39
+ {
40
+ "inputs": [
41
+ {
42
+ "internalType": "int256",
43
+ "name": "rateScalar",
44
+ "type": "int256"
45
+ }
46
+ ],
47
+ "name": "MarketRateScalarBelowZero",
48
+ "type": "error"
49
+ },
50
+ {
51
+ "inputs": [
52
+ {
53
+ "internalType": "int256",
54
+ "name": "totalPt",
55
+ "type": "int256"
56
+ },
57
+ {
58
+ "internalType": "int256",
59
+ "name": "totalAsset",
60
+ "type": "int256"
61
+ }
62
+ ],
63
+ "name": "MarketZeroTotalPtOrTotalAsset",
64
+ "type": "error"
65
+ },
66
+ {
67
+ "inputs": [
68
+ {
69
+ "internalType": "uint32",
70
+ "name": "duration",
71
+ "type": "uint32"
72
+ },
73
+ {
74
+ "internalType": "uint32",
75
+ "name": "cardinalityRequired",
76
+ "type": "uint32"
77
+ }
78
+ ],
79
+ "name": "TwapDurationTooLarge",
80
+ "type": "error"
81
+ },
82
+ {
83
+ "anonymous": false,
84
+ "inputs": [
85
+ {
86
+ "indexed": false,
87
+ "internalType": "uint8",
88
+ "name": "version",
89
+ "type": "uint8"
90
+ }
91
+ ],
92
+ "name": "Initialized",
93
+ "type": "event"
94
+ },
95
+ {
96
+ "anonymous": false,
97
+ "inputs": [
98
+ {
99
+ "indexed": true,
100
+ "internalType": "address",
101
+ "name": "previousOwner",
102
+ "type": "address"
103
+ },
104
+ {
105
+ "indexed": true,
106
+ "internalType": "address",
107
+ "name": "newOwner",
108
+ "type": "address"
109
+ }
110
+ ],
111
+ "name": "OwnershipTransferred",
112
+ "type": "event"
113
+ },
114
+ {
115
+ "anonymous": false,
116
+ "inputs": [
117
+ {
118
+ "indexed": false,
119
+ "internalType": "uint16",
120
+ "name": "newBlockCycleNumerator",
121
+ "type": "uint16"
122
+ }
123
+ ],
124
+ "name": "SetBlockCycleNumerator",
125
+ "type": "event"
126
+ },
127
+ {
128
+ "inputs": [],
129
+ "name": "BLOCK_CYCLE_DENOMINATOR",
130
+ "outputs": [
131
+ {
132
+ "internalType": "uint16",
133
+ "name": "",
134
+ "type": "uint16"
135
+ }
136
+ ],
137
+ "stateMutability": "view",
138
+ "type": "function"
139
+ },
140
+ {
141
+ "inputs": [],
142
+ "name": "blockCycleNumerator",
143
+ "outputs": [
144
+ {
145
+ "internalType": "uint16",
146
+ "name": "",
147
+ "type": "uint16"
148
+ }
149
+ ],
150
+ "stateMutability": "view",
151
+ "type": "function"
152
+ },
153
+ {
154
+ "inputs": [],
155
+ "name": "claimOwnership",
156
+ "outputs": [],
157
+ "stateMutability": "nonpayable",
158
+ "type": "function"
159
+ },
160
+ {
161
+ "inputs": [
162
+ {
163
+ "internalType": "address",
164
+ "name": "market",
165
+ "type": "address"
166
+ },
167
+ {
168
+ "internalType": "uint32",
169
+ "name": "duration",
170
+ "type": "uint32"
171
+ }
172
+ ],
173
+ "name": "getLpToAssetRate",
174
+ "outputs": [
175
+ {
176
+ "internalType": "uint256",
177
+ "name": "",
178
+ "type": "uint256"
179
+ }
180
+ ],
181
+ "stateMutability": "view",
182
+ "type": "function"
183
+ },
184
+ {
185
+ "inputs": [
186
+ {
187
+ "internalType": "address",
188
+ "name": "market",
189
+ "type": "address"
190
+ },
191
+ {
192
+ "internalType": "uint32",
193
+ "name": "duration",
194
+ "type": "uint32"
195
+ }
196
+ ],
197
+ "name": "getLpToSyRate",
198
+ "outputs": [
199
+ {
200
+ "internalType": "uint256",
201
+ "name": "",
202
+ "type": "uint256"
203
+ }
204
+ ],
205
+ "stateMutability": "view",
206
+ "type": "function"
207
+ },
208
+ {
209
+ "inputs": [
210
+ {
211
+ "internalType": "address",
212
+ "name": "market",
213
+ "type": "address"
214
+ },
215
+ {
216
+ "internalType": "uint32",
217
+ "name": "duration",
218
+ "type": "uint32"
219
+ }
220
+ ],
221
+ "name": "getOracleState",
222
+ "outputs": [
223
+ {
224
+ "internalType": "bool",
225
+ "name": "increaseCardinalityRequired",
226
+ "type": "bool"
227
+ },
228
+ {
229
+ "internalType": "uint16",
230
+ "name": "cardinalityRequired",
231
+ "type": "uint16"
232
+ },
233
+ {
234
+ "internalType": "bool",
235
+ "name": "oldestObservationSatisfied",
236
+ "type": "bool"
237
+ }
238
+ ],
239
+ "stateMutability": "view",
240
+ "type": "function"
241
+ },
242
+ {
243
+ "inputs": [
244
+ {
245
+ "internalType": "address",
246
+ "name": "market",
247
+ "type": "address"
248
+ },
249
+ {
250
+ "internalType": "uint32",
251
+ "name": "duration",
252
+ "type": "uint32"
253
+ }
254
+ ],
255
+ "name": "getPtToAssetRate",
256
+ "outputs": [
257
+ {
258
+ "internalType": "uint256",
259
+ "name": "",
260
+ "type": "uint256"
261
+ }
262
+ ],
263
+ "stateMutability": "view",
264
+ "type": "function"
265
+ },
266
+ {
267
+ "inputs": [
268
+ {
269
+ "internalType": "address",
270
+ "name": "market",
271
+ "type": "address"
272
+ },
273
+ {
274
+ "internalType": "uint32",
275
+ "name": "duration",
276
+ "type": "uint32"
277
+ }
278
+ ],
279
+ "name": "getPtToSyRate",
280
+ "outputs": [
281
+ {
282
+ "internalType": "uint256",
283
+ "name": "",
284
+ "type": "uint256"
285
+ }
286
+ ],
287
+ "stateMutability": "view",
288
+ "type": "function"
289
+ },
290
+ {
291
+ "inputs": [
292
+ {
293
+ "internalType": "address",
294
+ "name": "market",
295
+ "type": "address"
296
+ },
297
+ {
298
+ "internalType": "uint32",
299
+ "name": "duration",
300
+ "type": "uint32"
301
+ }
302
+ ],
303
+ "name": "getYtToAssetRate",
304
+ "outputs": [
305
+ {
306
+ "internalType": "uint256",
307
+ "name": "",
308
+ "type": "uint256"
309
+ }
310
+ ],
311
+ "stateMutability": "view",
312
+ "type": "function"
313
+ },
314
+ {
315
+ "inputs": [
316
+ {
317
+ "internalType": "address",
318
+ "name": "market",
319
+ "type": "address"
320
+ },
321
+ {
322
+ "internalType": "uint32",
323
+ "name": "duration",
324
+ "type": "uint32"
325
+ }
326
+ ],
327
+ "name": "getYtToSyRate",
328
+ "outputs": [
329
+ {
330
+ "internalType": "uint256",
331
+ "name": "",
332
+ "type": "uint256"
333
+ }
334
+ ],
335
+ "stateMutability": "view",
336
+ "type": "function"
337
+ },
338
+ {
339
+ "inputs": [
340
+ {
341
+ "internalType": "uint16",
342
+ "name": "_blockCycleNumerator",
343
+ "type": "uint16"
344
+ }
345
+ ],
346
+ "name": "initialize",
347
+ "outputs": [],
348
+ "stateMutability": "nonpayable",
349
+ "type": "function"
350
+ },
351
+ {
352
+ "inputs": [],
353
+ "name": "owner",
354
+ "outputs": [
355
+ {
356
+ "internalType": "address",
357
+ "name": "",
358
+ "type": "address"
359
+ }
360
+ ],
361
+ "stateMutability": "view",
362
+ "type": "function"
363
+ },
364
+ {
365
+ "inputs": [],
366
+ "name": "pendingOwner",
367
+ "outputs": [
368
+ {
369
+ "internalType": "address",
370
+ "name": "",
371
+ "type": "address"
372
+ }
373
+ ],
374
+ "stateMutability": "view",
375
+ "type": "function"
376
+ },
377
+ {
378
+ "inputs": [
379
+ {
380
+ "internalType": "uint16",
381
+ "name": "newBlockCycleNumerator",
382
+ "type": "uint16"
383
+ }
384
+ ],
385
+ "name": "setBlockCycleNumerator",
386
+ "outputs": [],
387
+ "stateMutability": "nonpayable",
388
+ "type": "function"
389
+ },
390
+ {
391
+ "inputs": [
392
+ {
393
+ "internalType": "address",
394
+ "name": "newOwner",
395
+ "type": "address"
396
+ },
397
+ {
398
+ "internalType": "bool",
399
+ "name": "direct",
400
+ "type": "bool"
401
+ },
402
+ {
403
+ "internalType": "bool",
404
+ "name": "renounce",
405
+ "type": "bool"
406
+ }
407
+ ],
408
+ "name": "transferOwnership",
409
+ "outputs": [],
410
+ "stateMutability": "nonpayable",
411
+ "type": "function"
412
+ }
413
+ ]
@@ -1548,16 +1548,16 @@
1548
1548
  "anonymous": false,
1549
1549
  "inputs": [
1550
1550
  {
1551
- "indexed": false,
1551
+ "indexed": true,
1552
1552
  "internalType": "address",
1553
1553
  "name": "pool",
1554
1554
  "type": "address"
1555
1555
  },
1556
1556
  {
1557
- "indexed": false,
1558
- "internalType": "string",
1557
+ "indexed": true,
1558
+ "internalType": "bytes32",
1559
1559
  "name": "eventKey",
1560
- "type": "string"
1560
+ "type": "bytes32"
1561
1561
  },
1562
1562
  {
1563
1563
  "indexed": false,
@@ -0,0 +1,60 @@
1
+ import { Token, Address, ExchangePrices, AdapterExchangeParam, DexExchangeParam, PoolLiquidity, Logger, NumberAsString } from '../../types';
2
+ import { SwapSide, Network } from '../../constants';
3
+ import { Context, IDex } from '../../dex/idex';
4
+ import { IDexHelper } from '../../dex-helper/idex-helper';
5
+ import { AaveV3PtRollOverData } from './types';
6
+ import { SimpleExchange } from '../simple-exchange';
7
+ export declare class AaveV3PtRollOver extends SimpleExchange implements IDex<AaveV3PtRollOverData> {
8
+ readonly network: Network;
9
+ readonly dexKey: string;
10
+ readonly dexHelper: IDexHelper;
11
+ protected adapters: {};
12
+ readonly hasConstantPriceLargeAmounts = false;
13
+ readonly needWrapNative = false;
14
+ readonly isFeeOnTransferSupported = false;
15
+ private config;
16
+ private marketsCache;
17
+ private oracleInterface;
18
+ logger: Logger;
19
+ static dexKeysWithNetwork: {
20
+ key: string;
21
+ networks: Network[];
22
+ }[];
23
+ constructor(network: Network, dexKey: string, dexHelper: IDexHelper, adapters?: {});
24
+ getAdapters(): {
25
+ name: string;
26
+ index: number;
27
+ }[] | null;
28
+ initializePricing(blockNumber: number): Promise<void>;
29
+ /**
30
+ * Populate mock markets for testing when real API is unavailable
31
+ */
32
+ private populateMockMarketsForTesting;
33
+ /**
34
+ * Get market details for a given PT address
35
+ */
36
+ private getMarketForPt;
37
+ /**
38
+ * Get PT to asset rate from Pendle Oracle
39
+ */
40
+ private getPtToAssetRate;
41
+ /**
42
+ * Check oracle state before making pricing calls
43
+ */
44
+ private checkOracleState;
45
+ getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
46
+ getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<AaveV3PtRollOverData>>;
47
+ getCalldataGasCost(): number | number[];
48
+ getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: AaveV3PtRollOverData, side: SwapSide): AdapterExchangeParam;
49
+ getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
50
+ updatePoolState(): Promise<void>;
51
+ getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: AaveV3PtRollOverData, side: SwapSide, context: Context, executorAddress: Address): Promise<DexExchangeParam>;
52
+ /**
53
+ * Construct a real Pendle router transaction as fallback
54
+ */
55
+ private constructPendleRouterTransaction;
56
+ /**
57
+ * Call Pendle SDK API for transaction construction
58
+ */
59
+ private callPendleSdkApi;
60
+ }