@pendle/core-v2 2.17.1-tradingbot → 2.17.2-tradingbot

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/artifacts/contracts/core/TradingBot/BotActionCallback.sol/BotActionCallback.dbg.json +1 -1
  2. package/build/artifacts/contracts/core/TradingBot/BotActionCallback.sol/BotActionCallback.json +15 -8
  3. package/build/artifacts/contracts/core/TradingBot/BotActionHelper.sol/BotActionHelper.dbg.json +1 -1
  4. package/build/artifacts/contracts/core/TradingBot/BotActionHelper.sol/BotActionHelper.json +15 -8
  5. package/build/artifacts/contracts/core/TradingBot/BotDecisionLib.sol/BotDecisionLib.dbg.json +1 -1
  6. package/build/artifacts/contracts/core/TradingBot/BotDecisionLib.sol/BotDecisionLib.json +560 -3
  7. package/build/artifacts/contracts/core/TradingBot/LongYieldTradingBot.sol/LongYieldTradingBot.dbg.json +1 -1
  8. package/build/artifacts/contracts/core/TradingBot/LongYieldTradingBot.sol/LongYieldTradingBot.json +72 -78
  9. package/build/artifacts/contracts/core/TradingBot/TradingBotBase.sol/TradingBotBase.dbg.json +1 -1
  10. package/build/artifacts/contracts/core/TradingBot/TradingBotBase.sol/TradingBotBase.json +15 -8
  11. package/build/artifacts/contracts/core/TradingBot/TradingBotOffchain.sol/TradingBotOffchain.dbg.json +1 -1
  12. package/build/artifacts/contracts/core/TradingBot/TradingBotOffchain.sol/TradingBotOffchain.json +30 -48
  13. package/build/artifacts/contracts/interfaces/TradingBot/ILongYieldTradingBot.sol/ILongYieldTradingBot.dbg.json +1 -1
  14. package/build/artifacts/contracts/interfaces/TradingBot/ILongYieldTradingBot.sol/ILongYieldTradingBot.json +10 -0
  15. package/build/artifacts/contracts/interfaces/TradingBot/ITradingBotBase.sol/ITradingBotBase.dbg.json +1 -1
  16. package/build/artifacts/contracts/interfaces/TradingBot/ITradingBotBase.sol/ITradingBotBase.json +0 -18
  17. package/package.json +1 -1
  18. package/typechain-types/BotActionCallback.ts +16 -12
  19. package/typechain-types/BotActionHelper.ts +16 -12
  20. package/typechain-types/BotDecisionLib.ts +330 -0
  21. package/typechain-types/ILongYieldTradingBot.ts +10 -2
  22. package/typechain-types/ITradingBotBase.ts +0 -36
  23. package/typechain-types/LongYieldTradingBot.ts +74 -36
  24. package/typechain-types/TradingBotBase.ts +16 -12
  25. package/typechain-types/TradingBotOffchain.ts +19 -0
  26. package/typechain-types/factories/BotActionCallback__factory.ts +15 -8
  27. package/typechain-types/factories/BotActionHelper__factory.ts +15 -8
  28. package/typechain-types/factories/BotDecisionLib__factory.ts +620 -0
  29. package/typechain-types/factories/ILongYieldTradingBot__factory.ts +10 -0
  30. package/typechain-types/factories/ITradingBotBase__factory.ts +0 -18
  31. package/typechain-types/factories/LongYieldTradingBot__factory.ts +75 -82
  32. package/typechain-types/factories/TradingBotBase__factory.ts +15 -8
  33. package/typechain-types/factories/TradingBotOffchain__factory.ts +36 -49
  34. package/typechain-types/hardhat.d.ts +9 -0
  35. package/typechain-types/index.ts +2 -0
@@ -0,0 +1,620 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers";
5
+ import { Provider, TransactionRequest } from "@ethersproject/providers";
6
+ import type {
7
+ BotDecisionLib,
8
+ BotDecisionLibInterface,
9
+ } from "../BotDecisionLib";
10
+
11
+ const _abi = [
12
+ {
13
+ inputs: [],
14
+ name: "ApproxFail",
15
+ type: "error",
16
+ },
17
+ {
18
+ inputs: [
19
+ {
20
+ internalType: "uint256",
21
+ name: "guessMin",
22
+ type: "uint256",
23
+ },
24
+ {
25
+ internalType: "uint256",
26
+ name: "guessMax",
27
+ type: "uint256",
28
+ },
29
+ {
30
+ internalType: "uint256",
31
+ name: "eps",
32
+ type: "uint256",
33
+ },
34
+ ],
35
+ name: "ApproxParamsInvalid",
36
+ type: "error",
37
+ },
38
+ {
39
+ inputs: [],
40
+ name: "BotBinarySearchFail",
41
+ type: "error",
42
+ },
43
+ {
44
+ inputs: [
45
+ {
46
+ internalType: "uint256",
47
+ name: "action",
48
+ type: "uint256",
49
+ },
50
+ {
51
+ internalType: "uint256",
52
+ name: "guessMin",
53
+ type: "uint256",
54
+ },
55
+ ],
56
+ name: "BotBinarySearchGuessMinInvalid",
57
+ type: "error",
58
+ },
59
+ {
60
+ inputs: [
61
+ {
62
+ internalType: "uint256",
63
+ name: "action",
64
+ type: "uint256",
65
+ },
66
+ {
67
+ internalType: "uint256",
68
+ name: "guessMin",
69
+ type: "uint256",
70
+ },
71
+ {
72
+ internalType: "uint256",
73
+ name: "guessMax",
74
+ type: "uint256",
75
+ },
76
+ ],
77
+ name: "BotBinarySearchInvalidRange",
78
+ type: "error",
79
+ },
80
+ {
81
+ inputs: [
82
+ {
83
+ internalType: "int256",
84
+ name: "exchangeRate",
85
+ type: "int256",
86
+ },
87
+ ],
88
+ name: "MarketExchangeRateBelowOne",
89
+ type: "error",
90
+ },
91
+ {
92
+ inputs: [],
93
+ name: "MarketExpired",
94
+ type: "error",
95
+ },
96
+ {
97
+ inputs: [
98
+ {
99
+ internalType: "int256",
100
+ name: "currentAmount",
101
+ type: "int256",
102
+ },
103
+ {
104
+ internalType: "int256",
105
+ name: "requiredAmount",
106
+ type: "int256",
107
+ },
108
+ ],
109
+ name: "MarketInsufficientPtForTrade",
110
+ type: "error",
111
+ },
112
+ {
113
+ inputs: [],
114
+ name: "MarketProportionMustNotEqualOne",
115
+ type: "error",
116
+ },
117
+ {
118
+ inputs: [
119
+ {
120
+ internalType: "int256",
121
+ name: "proportion",
122
+ type: "int256",
123
+ },
124
+ {
125
+ internalType: "int256",
126
+ name: "maxProportion",
127
+ type: "int256",
128
+ },
129
+ ],
130
+ name: "MarketProportionTooHigh",
131
+ type: "error",
132
+ },
133
+ {
134
+ inputs: [
135
+ {
136
+ internalType: "int256",
137
+ name: "rateScalar",
138
+ type: "int256",
139
+ },
140
+ ],
141
+ name: "MarketRateScalarBelowZero",
142
+ type: "error",
143
+ },
144
+ {
145
+ inputs: [],
146
+ name: "MarketZeroAmountsInput",
147
+ type: "error",
148
+ },
149
+ {
150
+ inputs: [],
151
+ name: "MarketZeroAmountsOutput",
152
+ type: "error",
153
+ },
154
+ {
155
+ inputs: [],
156
+ name: "MarketZeroLnImpliedRate",
157
+ type: "error",
158
+ },
159
+ {
160
+ inputs: [
161
+ {
162
+ internalType: "int256",
163
+ name: "totalPt",
164
+ type: "int256",
165
+ },
166
+ {
167
+ internalType: "int256",
168
+ name: "totalAsset",
169
+ type: "int256",
170
+ },
171
+ ],
172
+ name: "MarketZeroTotalPtOrTotalAsset",
173
+ type: "error",
174
+ },
175
+ {
176
+ inputs: [
177
+ {
178
+ components: [
179
+ {
180
+ internalType: "enum StrategyFlag",
181
+ name: "iyFlag",
182
+ type: "uint8",
183
+ },
184
+ {
185
+ internalType: "enum StrategyFlag",
186
+ name: "syRatioFlag",
187
+ type: "uint8",
188
+ },
189
+ ],
190
+ internalType: "struct StrategyState",
191
+ name: "currentState",
192
+ type: "tuple",
193
+ },
194
+ ],
195
+ name: "actionToTake",
196
+ outputs: [
197
+ {
198
+ internalType: "enum ActionType",
199
+ name: "",
200
+ type: "uint8",
201
+ },
202
+ ],
203
+ stateMutability: "pure",
204
+ type: "function",
205
+ },
206
+ {
207
+ inputs: [
208
+ {
209
+ components: [
210
+ {
211
+ internalType: "uint256",
212
+ name: "lpBalance",
213
+ type: "uint256",
214
+ },
215
+ {
216
+ internalType: "uint256",
217
+ name: "ytBalance",
218
+ type: "uint256",
219
+ },
220
+ {
221
+ internalType: "uint256",
222
+ name: "syBalance",
223
+ type: "uint256",
224
+ },
225
+ ],
226
+ internalType: "struct BotState",
227
+ name: "bot",
228
+ type: "tuple",
229
+ },
230
+ {
231
+ components: [
232
+ {
233
+ components: [
234
+ {
235
+ internalType: "int256",
236
+ name: "totalPt",
237
+ type: "int256",
238
+ },
239
+ {
240
+ internalType: "int256",
241
+ name: "totalSy",
242
+ type: "int256",
243
+ },
244
+ {
245
+ internalType: "int256",
246
+ name: "totalLp",
247
+ type: "int256",
248
+ },
249
+ {
250
+ internalType: "address",
251
+ name: "treasury",
252
+ type: "address",
253
+ },
254
+ {
255
+ internalType: "int256",
256
+ name: "scalarRoot",
257
+ type: "int256",
258
+ },
259
+ {
260
+ internalType: "uint256",
261
+ name: "expiry",
262
+ type: "uint256",
263
+ },
264
+ {
265
+ internalType: "uint256",
266
+ name: "lnFeeRateRoot",
267
+ type: "uint256",
268
+ },
269
+ {
270
+ internalType: "uint256",
271
+ name: "reserveFeePercent",
272
+ type: "uint256",
273
+ },
274
+ {
275
+ internalType: "uint256",
276
+ name: "lastLnImpliedRate",
277
+ type: "uint256",
278
+ },
279
+ ],
280
+ internalType: "struct MarketState",
281
+ name: "state",
282
+ type: "tuple",
283
+ },
284
+ {
285
+ internalType: "PYIndex",
286
+ name: "index",
287
+ type: "uint256",
288
+ },
289
+ {
290
+ internalType: "uint256",
291
+ name: "blockTime",
292
+ type: "uint256",
293
+ },
294
+ ],
295
+ internalType: "struct MarketExtState",
296
+ name: "marketExt",
297
+ type: "tuple",
298
+ },
299
+ {
300
+ components: [
301
+ {
302
+ internalType: "uint256",
303
+ name: "lowerIyLimit",
304
+ type: "uint256",
305
+ },
306
+ {
307
+ internalType: "uint256",
308
+ name: "upperIyLimit",
309
+ type: "uint256",
310
+ },
311
+ {
312
+ internalType: "uint256",
313
+ name: "floatingSyRatioLimit",
314
+ type: "uint256",
315
+ },
316
+ {
317
+ internalType: "uint256",
318
+ name: "ytPtRatioLimit",
319
+ type: "uint256",
320
+ },
321
+ ],
322
+ internalType: "struct LongTradingSpecs",
323
+ name: "specs",
324
+ type: "tuple",
325
+ },
326
+ {
327
+ internalType: "enum ActionType",
328
+ name: "action",
329
+ type: "uint8",
330
+ },
331
+ {
332
+ components: [
333
+ {
334
+ internalType: "enum StrategyFlag",
335
+ name: "iyFlag",
336
+ type: "uint8",
337
+ },
338
+ {
339
+ internalType: "enum StrategyFlag",
340
+ name: "syRatioFlag",
341
+ type: "uint8",
342
+ },
343
+ ],
344
+ internalType: "struct StrategyState",
345
+ name: "oldState",
346
+ type: "tuple",
347
+ },
348
+ {
349
+ components: [
350
+ {
351
+ internalType: "uint256",
352
+ name: "guessMin",
353
+ type: "uint256",
354
+ },
355
+ {
356
+ internalType: "uint256",
357
+ name: "guessMax",
358
+ type: "uint256",
359
+ },
360
+ {
361
+ internalType: "uint256",
362
+ name: "guessOffchain",
363
+ type: "uint256",
364
+ },
365
+ {
366
+ internalType: "uint256",
367
+ name: "maxIteration",
368
+ type: "uint256",
369
+ },
370
+ {
371
+ internalType: "uint256",
372
+ name: "eps",
373
+ type: "uint256",
374
+ },
375
+ ],
376
+ internalType: "struct ApproxParams",
377
+ name: "botParams",
378
+ type: "tuple",
379
+ },
380
+ {
381
+ components: [
382
+ {
383
+ internalType: "uint256",
384
+ name: "guessMin",
385
+ type: "uint256",
386
+ },
387
+ {
388
+ internalType: "uint256",
389
+ name: "guessMax",
390
+ type: "uint256",
391
+ },
392
+ {
393
+ internalType: "uint256",
394
+ name: "guessOffchain",
395
+ type: "uint256",
396
+ },
397
+ {
398
+ internalType: "uint256",
399
+ name: "maxIteration",
400
+ type: "uint256",
401
+ },
402
+ {
403
+ internalType: "uint256",
404
+ name: "eps",
405
+ type: "uint256",
406
+ },
407
+ ],
408
+ internalType: "struct ApproxParams",
409
+ name: "intParams",
410
+ type: "tuple",
411
+ },
412
+ ],
413
+ name: "binarySearchUntilSwitchState",
414
+ outputs: [
415
+ {
416
+ internalType: "uint256",
417
+ name: "",
418
+ type: "uint256",
419
+ },
420
+ ],
421
+ stateMutability: "pure",
422
+ type: "function",
423
+ },
424
+ {
425
+ inputs: [
426
+ {
427
+ components: [
428
+ {
429
+ internalType: "uint256",
430
+ name: "lpBalance",
431
+ type: "uint256",
432
+ },
433
+ {
434
+ internalType: "uint256",
435
+ name: "ytBalance",
436
+ type: "uint256",
437
+ },
438
+ {
439
+ internalType: "uint256",
440
+ name: "syBalance",
441
+ type: "uint256",
442
+ },
443
+ ],
444
+ internalType: "struct BotState",
445
+ name: "bot",
446
+ type: "tuple",
447
+ },
448
+ {
449
+ components: [
450
+ {
451
+ components: [
452
+ {
453
+ internalType: "int256",
454
+ name: "totalPt",
455
+ type: "int256",
456
+ },
457
+ {
458
+ internalType: "int256",
459
+ name: "totalSy",
460
+ type: "int256",
461
+ },
462
+ {
463
+ internalType: "int256",
464
+ name: "totalLp",
465
+ type: "int256",
466
+ },
467
+ {
468
+ internalType: "address",
469
+ name: "treasury",
470
+ type: "address",
471
+ },
472
+ {
473
+ internalType: "int256",
474
+ name: "scalarRoot",
475
+ type: "int256",
476
+ },
477
+ {
478
+ internalType: "uint256",
479
+ name: "expiry",
480
+ type: "uint256",
481
+ },
482
+ {
483
+ internalType: "uint256",
484
+ name: "lnFeeRateRoot",
485
+ type: "uint256",
486
+ },
487
+ {
488
+ internalType: "uint256",
489
+ name: "reserveFeePercent",
490
+ type: "uint256",
491
+ },
492
+ {
493
+ internalType: "uint256",
494
+ name: "lastLnImpliedRate",
495
+ type: "uint256",
496
+ },
497
+ ],
498
+ internalType: "struct MarketState",
499
+ name: "state",
500
+ type: "tuple",
501
+ },
502
+ {
503
+ internalType: "PYIndex",
504
+ name: "index",
505
+ type: "uint256",
506
+ },
507
+ {
508
+ internalType: "uint256",
509
+ name: "blockTime",
510
+ type: "uint256",
511
+ },
512
+ ],
513
+ internalType: "struct MarketExtState",
514
+ name: "marketExt",
515
+ type: "tuple",
516
+ },
517
+ {
518
+ components: [
519
+ {
520
+ internalType: "uint256",
521
+ name: "lowerIyLimit",
522
+ type: "uint256",
523
+ },
524
+ {
525
+ internalType: "uint256",
526
+ name: "upperIyLimit",
527
+ type: "uint256",
528
+ },
529
+ {
530
+ internalType: "uint256",
531
+ name: "floatingSyRatioLimit",
532
+ type: "uint256",
533
+ },
534
+ {
535
+ internalType: "uint256",
536
+ name: "ytPtRatioLimit",
537
+ type: "uint256",
538
+ },
539
+ ],
540
+ internalType: "struct LongTradingSpecs",
541
+ name: "specs",
542
+ type: "tuple",
543
+ },
544
+ ],
545
+ name: "strategyState",
546
+ outputs: [
547
+ {
548
+ components: [
549
+ {
550
+ internalType: "enum StrategyFlag",
551
+ name: "iyFlag",
552
+ type: "uint8",
553
+ },
554
+ {
555
+ internalType: "enum StrategyFlag",
556
+ name: "syRatioFlag",
557
+ type: "uint8",
558
+ },
559
+ ],
560
+ internalType: "struct StrategyState",
561
+ name: "currentState",
562
+ type: "tuple",
563
+ },
564
+ ],
565
+ stateMutability: "pure",
566
+ type: "function",
567
+ },
568
+ ];
569
+
570
+ const _bytecode =
571
+ "0x608060405234801561001057600080fd5b50613378806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063218494d414610046578063a546c1d11461006f578063f829d9e414610090575b600080fd5b610059610054366004612e65565b6100b0565b6040516100669190612e97565b60405180910390f35b61008261007d3660046130a6565b610172565b604051908152602001610066565b6100a361009e36600461313e565b61046b565b604051610066919061319a565b60006001825160028111156100c7576100c7612e81565b036100f9576002826020015160028111156100e4576100e4612e81565b036100f157506000919050565b506004919050565b60008251600281111561010e5761010e612e81565b036101405760028260200151600281111561012b5761012b612e81565b0361013857506001919050565b506005919050565b60028260200151600281111561015857610158612e81565b0361016557506002919050565b506003919050565b919050565b6000806040518060a001604052808a81526020018981526020018881526020018760058111156101a4576101a4612e81565b81526020018690526040850151909150156102415760006101e18560800151670de0b6b3a76400006101d691906131dc565b604087015190610550565b905060026101f483876040015187610575565b600281111561020557610205612e81565b14801561022d5750600161021a838387610575565b600281111561022b5761022b612e81565b145b1561023f575050506040820151610460565b505b600061024e8a8a896105c5565b9050808560200151111561026457602085018190525b6020850151855111156102af5786600581111561028357610283612e81565b8551602087015160405163f25ccea360e01b81526102a6939291906004016131ef565b60405180910390fd5b60016102c083876020015187610575565b60028111156102d1576102d1612e81565b036102e3575050506020820151610460565b5060006102f582866000015186610575565b9050600081600281111561030b5761030b612e81565b0361033f5786600581111561032257610322612e81565b8551604051630cf4fb5360e31b81526102a6929190600401613205565b600281600281111561035357610353612e81565b0361036357505082519050610460565b5060005b846060015181101561044657600060028660000151876020015161038b91906131dc565b6103959190613229565b86516103a1919061323d565b905060016103b0848388610575565b60028111156103c1576103c1612e81565b036103ce578086526103d6565b602086018190525b6103ed866000015187602001518860800151610680565b1561043557600061040384886020015188610575565b600281111561041457610414612e81565b03610426575050835191506104609050565b85602001519350505050610460565b5061043f81613250565b9050610367565b5060405163fef33c9d60e01b815260040160405180910390fd5b979650505050505050565b610473612cf1565b600061047e846106b4565b8551909150600090610491908690610701565b9150506000816000146104b25760208701516104ad9083610774565b6104b6565b6000195b85519091508310156104e1578360015b908160028111156104d9576104d9612e81565b905250610509565b8285602001511080156104f75750846060015181115b15610504578360026104c6565b600084525b6000610523610518898961079a565b60408a015190610774565b9050856040015181111561053d5760026020860152610545565b600060208601525b505050509392505050565b60008061055d8385613269565b9050670de0b6b3a7640000815b049150505b92915050565b6000806000610585868686610876565b9150915081610599576000925050506105be565b6105a78660800151826109a4565b156105b7576001925050506105be565b6002925050505b9392505050565b6000808260058111156105da576105da612e81565b036105ef576105e883610a09565b90506105be565b600182600581111561060357610603612e81565b03610613575060408301516105be565b600282600581111561062757610627612e81565b03610635576105e883610a44565b600382600581111561064957610649612e81565b03610657576105e883610a44565b600482600581111561066b5761066b612e81565b03610678575082516105be565b5060006105be565b60008284111580156106ac57506106a8836106a384670de0b6b3a76400006131dc565b610550565b8410155b949350505050565b6000670de0b6b3a76400006106f76106e88460400151856000015160a001516106dd91906131dc565b6301e1338090610774565b6106f185610a6a565b90610ab7565b61056f91906131dc565b600080610715846000015160400151610c6a565b84516020015161072490610c6a565b61072e9085613269565b6107389190613229565b915061074b846000015160400151610c6a565b84515161075790610c6a565b6107619085613269565b61076b9190613229565b90509250929050565b600080610789670de0b6b3a764000085613269565b905082818161056a5761056a613213565b60008060006107b685600001518561070190919063ffffffff16565b9150915060008286604001516107cc919061323d565b905085602001518211610822576107e38583610c7d565b6107ed908261323d565b905061081182876020015161080291906131dc565b61080b87610c8f565b90610ccd565b61081b908261323d565b905061086d565b6020860151610832908690610c7d565b61083c908261323d565b905061086086602001518361085191906131dc565b61085a87610c8f565b90610d28565b61086a908261323d565b90505b95945050505050565b6000610880612cf1565b600061088f8660000151610d4c565b905060006108a08760200151610c8f565b90506000876060015160058111156108ba576108ba612e81565b036108d1576108ca828288610d94565b9350610982565b6001876060015160058111156108e9576108e9612e81565b036108f9576108ca828288610df0565b60028760600151600581111561091157610911612e81565b03610921576108ca828288610e63565b60038760600151600581111561093957610939612e81565b03610949576108ca828288610eb2565b60048760600151600581111561096157610961612e81565b0361097d576108ca818761097488610eed565b85929190610f61565b600093505b831561099a576109978282896040015161046b565b92505b5050935093915050565b805160009060028111156109ba576109ba612e81565b835160028111156109cd576109cd612e81565b1480156105be5750816020015160028111156109eb576109eb612e81565b83602001516002811115610a0157610a01612e81565b149392505050565b805160208201516040830151600092600a92610a2f92610a2a918391610f96565b611090565b610a3a906009613269565b61056f9190613229565b60208101516040820151825160009261056f92610a62929190610f96565b835151611114565b6020810151604082015182516000928392610a86929190610f96565b90506000610aac84600001516000015183602001518460000151856040015160006111a8565b90506106ac81610c6a565b600081600003610ad05750670de0b6b3a764000061056f565b82600003610ae05750600061056f565b600160ff1b8310610b255760405162461bcd60e51b815260206004820152600f60248201526e78206f7574206f6620626f756e647360881b60448201526064016102a6565b82770bce5086492111aea88f4bb1ca6bcf584181ea8059f765328310610b7f5760405162461bcd60e51b815260206004820152600f60248201526e79206f7574206f6620626f756e647360881b60448201526064016102a6565b826000670c7d713b49da000083138015610ba05750670f43fc2c04ee000083125b15610bd7576000610bb084611259565b9050670de0b6b3a764000080820784020583670de0b6b3a764000083050201915050610be5565b81610be184611378565b0290505b670de0b6b3a76400009005680238fd42c5cf03ffff198112801590610c13575068070c1cc73b00c800008113155b610c575760405162461bcd60e51b815260206004820152601560248201527470726f64756374206f7574206f6620626f756e647360581b60448201526064016102a6565b610c608161171b565b9695505050505050565b600080821215610c7957600080fd5b5090565b60208201516000906105be9083611b30565b610c97612d08565b6040518060600160405280610caf8460000151611b3c565b81526020018360200151815260200183604001518152509050919050565b6020820151604083015183516000928392610ceb9291908690611bb9565b505090506000610d08828660200151611c1290919063ffffffff16565b90506000610d1682866131dc565b6020870151909150610c609082611b30565b602082015160408301518351600092610d42928590611c1f565b5090949350505050565b610d7060405180606001604052806000815260200160008152602001600081525090565b50604080516060810182528251815260208084015190820152918101519082015290565b600080610da18484611c45565b90508460400151811115610db95760009150506105be565b8085604001818151610dcb91906131dc565b905250602085018051849190610de290839061323d565b905250600195945050505050565b60008360400151821115610e06575060006105be565b600080610e138585611c8c565b915091508386604001818151610e2991906131dc565b905250855182908790610e3d90839061323d565b905250602086018051829190610e5490839061323d565b90525060019695505050505050565b60008080610e718585611d26565b915091508560400151811115610e8c576000925050506105be565b8086604001818151610e9e91906131dc565b905250855182908790610e5490839061323d565b60008080610ec08585611dba565b915091508560200151811115610edb576000925050506105be565b8086602001818151610e9e91906131dc565b610f1f6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b6040518060a001604052808360000151815260200183602001518152602001836040015181526020018360600151815260200183608001518152509050919050565b8351600090831115610f75575060006106ac565b6000610f82858585611ece565b90508386600001818151610e3d91906131dc565b610fc16040518060800160405280600081526020016000815260200160008152602001600081525090565b60a08401518210610fe55760405163b2094b5960e01b815260040160405180910390fd5b6000828560a00151610ff791906131dc565b90506110038582611f6f565b82526020850151611015908590611fd0565b60208301528451158061102a57506020820151155b15611051578451602083015160405163b1c4aefb60e01b81526102a6929190600401613205565b61106f85600001518661010001518460200151856000015185612007565b604083015260c08501516110839082612088565b6060830152509392505050565b600080600090506000600184602001516110aa91906131dc565b90505b80821461110c57600060026110c2838561323d565b6110cd90600161323d565b6110d79190613229565b905060006110ea868860000151846120bc565b1215611102576110fb6001826131dc565b9150611106565b8092505b506110ad565b509392505050565b60008061114161113c8560000151866040015187606001516111369190613280565b906121ae565b61171b565b9050600061116161115a670de0b6b3a7640000846132a0565b83906121d1565b9050600061117f86602001518661117891906132a0565b83906121ae565b9050600061118d8287613280565b90506103e861119e826103e7613269565b6104609190613229565b6000806111b587846121f7565b905060006111c661115a888a6132a0565b9050670d529ae9e86000008113156111fd5780670d529ae9e8600000604051637e34684f60e11b81526004016102a6929190613205565b60006112088261223e565b90508561121582896121d1565b61121f91906132a0565b9350670de0b6b3a764000084121561124d5760405163329e322960e21b8152600481018590526024016102a6565b50505095945050505050565b670de0b6b3a7640000026000806a0c097ce7bc90715b34b9f160241b808401906ec097ce7bc90715b34b9f0fffffffff198501028161129a5761129a613213565b05905060006a0c097ce7bc90715b34b9f160241b82800205905081806a0c097ce7bc90715b34b9f160241b81840205915060038205016a0c097ce7bc90715b34b9f160241b82840205915060058205016a0c097ce7bc90715b34b9f160241b82840205915060078205016a0c097ce7bc90715b34b9f160241b82840205915060098205016a0c097ce7bc90715b34b9f160241b828402059150600b8205016a0c097ce7bc90715b34b9f160241b828402059150600d8205016a0c097ce7bc90715b34b9f160241b828402059150600f82050160020295945050505050565b6000670de0b6b3a76400008212156113b9576113b0826a0c097ce7bc90715b34b9f160241b816113aa576113aa613213565b05611378565b60000392915050565b6000775803bcc5cb9634ba4cfb2213f784019318ed4dcb6017880f60361b83126114045772195e54c5dd42177f53a27172fa9ec63026282760241b830592506806f05b59d3b2000000015b6f8bcc0026baae9e45e470190267a230cf60191b831261143b576b1425982cf597cd205cef7380830592506803782dace9d9000000015b606492830292026e01855144814a7ff805980ff00840008312611483576e01855144814a7ff805980ff008400068056bc75e2d63100000840205925068ad78ebc5ac62000000015b6b02df0ab5a80a22c61ab5a70083126114be576b02df0ab5a80a22c61ab5a70068056bc75e2d6310000084020592506856bc75e2d631000000015b693f1fce3da636ea5cf85083126114f557693f1fce3da636ea5cf85068056bc75e2d631000008402059250682b5e3af16b18800000015b690127fa27722cc06cc5e2831261152c57690127fa27722cc06cc5e268056bc75e2d6310000084020592506815af1d78b58c400000015b68280e60114edb805d0383126115615768280e60114edb805d0368056bc75e2d631000008402059250680ad78ebc5ac6200000015b680ebc5fb41746121110831261158c57680ebc5fb4174612111068056bc75e2d631000009384020592015b6808f00f760a4b2db55d83126115c1576808f00f760a4b2db55d68056bc75e2d6310000084020592506802b5e3af16b1880000015b6806f5f177578893793783126115f6576806f5f177578893793768056bc75e2d63100000840205925068015af1d78b58c40000015b6806248f33704b286603831261162a576806248f33704b28660368056bc75e2d63100000840205925067ad78ebc5ac620000015b6805c548670b9510e7ac831261165e576805c548670b9510e7ac68056bc75e2d6310000084020592506756bc75e2d6310000015b600068056bc75e2d63100000840168056bc75e2d63100000808603028161168757611687613213565b059050600068056bc75e2d63100000828002059050818068056bc75e2d63100000818402059150600382050168056bc75e2d63100000828402059150600582050168056bc75e2d63100000828402059150600782050168056bc75e2d63100000828402059150600982050168056bc75e2d63100000828402059150600b820501600202606485820105979650505050505050565b6000680238fd42c5cf03ffff198212158015611740575068070c1cc73b00c800008213155b61177f5760405162461bcd60e51b815260206004820152601060248201526f125b9d985b1a5908195e1c1bdb995b9d60821b60448201526064016102a6565b60008212156117b7576117948260000361171b565b6a0c097ce7bc90715b34b9f160241b816117b0576117b0613213565b0592915050565b60006806f05b59d3b200000083126117f557506806f05b59d3b1ffffff199091019072195e54c5dd42177f53a27172fa9ec63026282760241b61182b565b6803782dace9d9000000831261182757506803782dace9d8ffffff19909101906b1425982cf597cd205cef738061182b565b5060015b6064929092029168056bc75e2d6310000068ad78ebc5ac62000000841261187b5768ad78ebc5ac61ffffff199093019268056bc75e2d631000006e01855144814a7ff805980ff008400082020590505b6856bc75e2d63100000084126118b7576856bc75e2d630ffffff199093019268056bc75e2d631000006b02df0ab5a80a22c61ab5a70082020590505b682b5e3af16b1880000084126118f157682b5e3af16b187fffff199093019268056bc75e2d63100000693f1fce3da636ea5cf85082020590505b6815af1d78b58c400000841261192b576815af1d78b58c3fffff199093019268056bc75e2d63100000690127fa27722cc06cc5e282020590505b680ad78ebc5ac6200000841261196457680ad78ebc5ac61fffff199093019268056bc75e2d6310000068280e60114edb805d0382020590505b68056bc75e2d63100000841261199d5768056bc75e2d630fffff199093019268056bc75e2d63100000680ebc5fb4174612111082020590505b6802b5e3af16b188000084126119d6576802b5e3af16b187ffff199093019268056bc75e2d631000006808f00f760a4b2db55d82020590505b68015af1d78b58c400008412611a0f5768015af1d78b58c3ffff199093019268056bc75e2d631000006806f5f177578893793782020590505b68056bc75e2d631000008481019085906002908280020505918201919050600368056bc75e2d631000008783020505918201919050600468056bc75e2d631000008783020505918201919050600568056bc75e2d631000008783020505918201919050600668056bc75e2d631000008783020505918201919050600768056bc75e2d631000008783020505918201919050600868056bc75e2d631000008783020505918201919050600968056bc75e2d631000008783020505918201919050600a68056bc75e2d631000008783020505918201919050600b68056bc75e2d631000008783020505918201919050600c68056bc75e2d631000008783020505918201919050606468056bc75e2d63100000848402058502059695505050505050565b60006105be8383612291565b611b44612d2f565b60405180610120016040528083600001518152602001836020015181526020018360400151815260200183606001516001600160a01b03168152602001836080015181526020018360a0015181526020018360c0015181526020018360e0015181526020018361010001518152509050919050565b600080600080600080611bd68a8a611bd08b6122b0565b8a6122c6565b925092509250611bed611be884612359565b610c6a565b9550611bf882610c6a565b9450611c0381610c6a565b93505050509450945094915050565b6000826106ac8184612367565b600080600080600080611c368a8a611bd08b612393565b925092509250611bed83610c6a565b6020820151604083015183516000928392611c639291908690611c1f565b505090506000611c808486602001516123aa90919063ffffffff16565b905061086d81836123b6565b6000806000611cb0611ca5866000015160200151610c6a565b6020870151906123cd565b855151611cbc90610c6a565b611cc6919061323d565b855151611cd290610c6a565b611cdc9086613269565b611ce69190613229565b6020860151909150611cf890826123cd565b9150611d17611d0782866131dc565b60408701518751919085906123d9565b50909793965092945050505050565b6000806000611d4e85602001518587604001518860000151611bb9909392919063ffffffff16565b5050855151909150600090611d6290610c6a565b865160200151611d7190610c6a565b611d7b9087613269565b611d859190613229565b60408701518751919250611d9d9190839088906123d9565b50909550611daf91508290508361323d565b925050509250929050565b6000806000611de285602001518587604001518860000151611bb9909392919063ffffffff16565b505060208601519091506000611df88284613269565b611e0a670de0b6b3a764000088613269565b611e1491906131dc565b875151909150600090611e2690610c6a565b83611e388a6000015160200151610c6a565b611e429190613269565b611e4c9190613229565b611e5e90670de0b6b3a764000061323d565b90506000611e6c8284613229565b9050611e7881896131dc565b95506000611e93878b60200151611b3090919063ffffffff16565b90506000611ea187836131dc565b60408c01518c51919250611eb99190839086906123d9565b50909d999c50989a5050505050505050505050565b825160009081908190611ee19086612444565b915091506000611efe8388602001516123cd90919063ffffffff16565b90506000611f0c828461323d565b9050600080611f338a60200151848c60400151611f288c610eed565b8e5193929190612474565b5060208c015160408d01518d51939550919350611f5292918490611c1f565b5050508184611f61919061323d565b9a9950505050505050505050565b6000611f7a826122b0565b611f91611f8c6201518061016d613269565b6122b0565b8460800151611fa091906132c8565b611faa91906132f8565b90506000811361056f57604051630e520c3b60e11b8152600481018290526024016102a6565b60008060008312611fe2576001611fe6565b6000195b9050611ffd611f8c85611ff886612595565b6125ac565b6106ac90826132c8565b6000806120148684612088565b9050670de0b6b3a76400008112156120425760405163329e322960e21b8152600481018290526024016102a6565b6000612058612051878a6132a0565b89906121d1565b905060006120658261223e565b905061207181876121d1565b61207b9084613280565b9998505050505050505050565b60008061209a6201518061016d613269565b6120a48486613269565b6120ae9190613229565b90506106ac61113c826122b0565b6000808285602001516120cf9190613280565b905060006120dd85856132a0565b90506000821380156120ef5750600081135b6121305760405162461bcd60e51b81526020600482015260126024820152711a5b9d985b1a59081c1d151bd3585c9ad95d60721b60448201526064016102a6565b600061215e61213f84846132c8565b602089015161214e90896132a0565b61215890886132c8565b906121d1565b9050600061217461216f84866121d1565b6125c1565b885190915060009061218f90670de0b6b3a7640000906121d1565b905061219f816111368486613280565b896040015161207b9190613280565b6000806121bb83856132c8565b9050670de0b6b3a7640000815b05949350505050565b6000806121e6670de0b6b3a7640000856132c8565b90508281816121c8576121c8613213565b6000818312156122345760405162461bcd60e51b81526020600482015260086024820152676e6567617469766560c01b60448201526064016102a6565b6105be8284613280565b6000670de0b6b3a764000082036122685760405163a9c8b14d60e01b815260040160405180910390fd5b600061228661227f84670de0b6b3a7640000613280565b84906121d1565b90506105be816125c1565b6000826122a6670de0b6b3a764000084613269565b6105be9190613229565b60006001600160ff1b03821115610c7957600080fd5b60008060006122d98760a0015185101590565b156122f75760405163b2094b5960e01b815260040160405180910390fd5b8651851261231d578651604051632185509b60e21b81526102a691908790600401613205565b600061232a888887610f96565b90506123388882898961264d565b9195509350915061234e8882898988878b6127a1565b509450945094915050565b600061056f826000196132c8565b6000670de0b6b3a764000060018161237f8686613269565b612389919061323d565b6122a691906131dc565b600061239e826122b0565b61056f906000196132c8565b60006105be8383612833565b6000818310156123c75760006105be565b50900390565b60006105be83836125ac565b6000806000806000806000806124018c6123f28d6122b0565b6123fb8d6122b0565b8c61284b565b935093509350935061241284610c6a565b975061241d83610c6a565b965061242882610c6a565b955061243381610c6a565b945050505050945094509450949050565b60008060008061245c86612457876122b0565b6129f9565b9150915061246982610c6a565b9350611daf81610c6a565b6000808080612484898988610f96565b905084604001516000036124c657845161249e9088612ac5565b855260208501516124b8906124b38b84611090565b612adb565b60208601526124c685612aea565b60005b85606001518110156125705760006124e18783612b38565b90506000806124f28d868e86612ba4565b50909250905060006125048d846123cd565b9050600061251282866131dc565b90508c81116125495761252a818e8d60800151610680565b156125415750975091955090935061258a92505050565b848b5261255a565b6125546001866131dc565b60208c01525b50505050508061256990613250565b90506124c9565b50604051637d388ed960e11b815260040160405180910390fd5b955095509592505050565b6000808213610c79576125a782613326565b61056f565b6000670de0b6b3a76400006122a68484613269565b60008082136126025760405162461bcd60e51b815260206004820152600d60248201526c6f7574206f6620626f756e647360981b60448201526064016102a6565b670c7d713b49da0000821380156126205750670f43fc2c04ee000082125b1561264457670de0b6b3a764000061263783611259565b816117b0576117b0613213565b61056f82611378565b6000806000806126708860000151886020015189600001518a60400151896111a8565b9050600061268661268187846121d1565b612359565b606089015190915060008713156126f55760006126a384836121d1565b9050670de0b6b3a76400008112156126d15760405163329e322960e21b8152600481018290526024016102a6565b6126ed6126e683670de0b6b3a7640000613280565b84906121ae565b915050612722565b61271f8161270b81670de0b6b3a7640000613280565b61271590856132c8565b61268191906132f8565b90505b600060646127338c60e001516122b0565b61273d90846132c8565b61274791906132f8565b905060006127558385613280565b90506000811261276e576127698a82612bd5565b612778565b6127788a82612c02565b97506127848a84612bd5565b96506127908a83612bd5565b955050505050509450945094915050565b6000818860a001516127b391906131dc565b88519091506127c290866121f7565b88526127dc6127d184866132a0565b60208a0151906121f7565b602089018190528851612801916127f4908990611fd0565b895160408b015185612c2f565b610100890181905260000361282957604051635534d70f60e11b815260040160405180910390fd5b5050505050505050565b60008260018161237f670de0b6b3a764000086613269565b600080808086158061285b575085155b15612879576040516325daaec360e01b815260040160405180910390fd5b60a0880151851061289d5760405163b2094b5960e01b815260040160405180910390fd5b87604001516000036128e0576103e86128c4611f8c6128bf611be88a8c6132c8565b612c82565b6128ce9190613280565b92506103e89350869150859050612983565b87516040890151600091906128f590896132c8565b6128ff91906132f8565b9050600089602001518a604001518a61291891906132c8565b61292291906132f8565b905080821215612958578194508792508960400151858b6020015161294791906132c8565b61295191906132f8565b9350612980565b8094508893508960400151858b6000015161297391906132c8565b61297d91906132f8565b92505b50505b600083136129a457604051631997ea8d60e31b815260040160405180910390fd5b81886020018181516129b691906132a0565b9052508751819089906129ca9083906132a0565b9052506129d784846132a0565b886040018181516129e891906132a0565b905250929791965094509092509050565b60008082600003612a1d576040516325daaec360e01b815260040160405180910390fd5b60408401516020850151612a3190856132c8565b612a3b91906132f8565b6040850151855191935090612a5090856132c8565b612a5a91906132f8565b905081158015612a68575080155b15612a8657604051631997ea8d60e31b815260040160405180910390fd5b6040840151612a9590846121f7565b60408501528351612aa690826121f7565b84526020840151612ab790836121f7565b602090940193909352929050565b6000818311612ad457816105be565b5090919050565b6000818310612ad457816105be565b602081015181511180612b085750670de0b6b3a76400008160800151115b15612b3557805160208201516080830151604051632cc06bc160e21b81526102a6939291906004016131ef565b50565b600081158015612b4b5750604083015115155b15612b5b5750604082015161056f565b6020830151835111612b8b5760208301518351600291612b7a9161323d565b612b849190613229565b905061056f565b604051637d388ed960e11b815260040160405180910390fd5b60008080808080612bc28989612bb98a613326565b8d92919061264d565b919c909b50909950975050505050505050565b60008060008312612be7576001612beb565b6000195b9050611ffd611f8c85612bfd86612595565b612291565b60008060008312612c14576001612c18565b6000195b9050611ffd611f8c85612c2a86612595565b612833565b600080612c408787878760006111a8565b90506000612c50611be8836125c1565b905083612c626201518061016d613269565b612c6c9083613269565b612c769190613229565b98975050505050505050565b60006003821115612ce35750806000612c9c600283613229565b612ca790600161323d565b90505b81811015612cdd57905080600281612cc28186613229565b612ccc919061323d565b612cd69190613229565b9050612caa565b50919050565b811561016d57506001919050565b604080518082019091526000808252602082015290565b6040518060600160405280612d1b612d2f565b815260200160008152602001600081525090565b60405180610120016040528060008152602001600081526020016000815260200160006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081525090565b604051606081016001600160401b0381118282101715612db457634e487b7160e01b600052604160045260246000fd5b60405290565b60405161012081016001600160401b0381118282101715612db457634e487b7160e01b600052604160045260246000fd5b80356003811061016d57600080fd5b600060408284031215612e0c57600080fd5b604080519081016001600160401b0381118282101715612e3c57634e487b7160e01b600052604160045260246000fd5b604052905080612e4b83612deb565b8152612e5960208401612deb565b60208201525092915050565b600060408284031215612e7757600080fd5b6105be8383612dfa565b634e487b7160e01b600052602160045260246000fd5b6020810160068310612eab57612eab612e81565b91905290565b600060608284031215612ec357600080fd5b612ecb612d84565b905081358152602082013560208201526040820135604082015292915050565b80356001600160a01b038116811461016d57600080fd5b6000818303610160811215612f1657600080fd5b612f1e612d84565b915061012080821215612f3057600080fd5b612f38612dba565b9150833582526020840135602083015260408401356040830152612f5e60608501612eeb565b60608301526080840135608083015260a084013560a083015260c084013560c083015260e084013560e08301526101008085013581840152508183528084013560208401525050610140820135604082015292915050565b600060808284031215612fc857600080fd5b604051608081016001600160401b0381118282101715612ff857634e487b7160e01b600052604160045260246000fd5b8060405250809150823581526020830135602082015260408301356040820152606083013560608201525092915050565b600060a0828403121561303b57600080fd5b60405160a081016001600160401b038111828210171561306b57634e487b7160e01b600052604160045260246000fd5b806040525080915082358152602083013560208201526040830135604082015260608301356060820152608083013560808201525092915050565b60008060008060008060006103e0888a0312156130c257600080fd5b6130cc8989612eb1565b96506130db8960608a01612f02565b95506130eb896101c08a01612fb6565b94506102408801356006811061310057600080fd5b9350613110896102608a01612dfa565b9250613120896102a08a01613029565b9150613130896103408a01613029565b905092959891949750929550565b6000806000610240848603121561315457600080fd5b61315e8585612eb1565b925061316d8560608601612f02565b915061317d856101c08601612fb6565b90509250925092565b6003811061319657613196612e81565b9052565b60006040820190506131ad828451613186565b60208301516131bf6020840182613186565b5092915050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561056f5761056f6131c6565b9283526020830191909152604082015260600190565b918252602082015260400190565b634e487b7160e01b600052601260045260246000fd5b60008261323857613238613213565b500490565b8082018082111561056f5761056f6131c6565b600060018201613262576132626131c6565b5060010190565b808202811582820484141761056f5761056f6131c6565b81810360008312801583831316838312821617156131bf576131bf6131c6565b80820182811260008312801582168215821617156132c0576132c06131c6565b505092915050565b80820260008212600160ff1b841416156132e4576132e46131c6565b818105831482151761056f5761056f6131c6565b60008261330757613307613213565b600160ff1b821460001984141615613321576133216131c6565b500590565b6000600160ff1b820161333b5761333b6131c6565b506000039056fea2646970667358221220ef537f6e175c09cdca7d69acd75d1c237ae283b425d763722da0047623c8b04a64736f6c63430008110033";
572
+
573
+ type BotDecisionLibConstructorParams =
574
+ | [signer?: Signer]
575
+ | ConstructorParameters<typeof ContractFactory>;
576
+
577
+ const isSuperArgs = (
578
+ xs: BotDecisionLibConstructorParams
579
+ ): xs is ConstructorParameters<typeof ContractFactory> => xs.length > 1;
580
+
581
+ export class BotDecisionLib__factory extends ContractFactory {
582
+ constructor(...args: BotDecisionLibConstructorParams) {
583
+ if (isSuperArgs(args)) {
584
+ super(...args);
585
+ } else {
586
+ super(_abi, _bytecode, args[0]);
587
+ }
588
+ this.contractName = "BotDecisionLib";
589
+ }
590
+
591
+ deploy(
592
+ overrides?: Overrides & { from?: string | Promise<string> }
593
+ ): Promise<BotDecisionLib> {
594
+ return super.deploy(overrides || {}) as Promise<BotDecisionLib>;
595
+ }
596
+ getDeployTransaction(
597
+ overrides?: Overrides & { from?: string | Promise<string> }
598
+ ): TransactionRequest {
599
+ return super.getDeployTransaction(overrides || {});
600
+ }
601
+ attach(address: string): BotDecisionLib {
602
+ return super.attach(address) as BotDecisionLib;
603
+ }
604
+ connect(signer: Signer): BotDecisionLib__factory {
605
+ return super.connect(signer) as BotDecisionLib__factory;
606
+ }
607
+ static readonly contractName: "BotDecisionLib";
608
+ public readonly contractName: "BotDecisionLib";
609
+ static readonly bytecode = _bytecode;
610
+ static readonly abi = _abi;
611
+ static createInterface(): BotDecisionLibInterface {
612
+ return new utils.Interface(_abi) as BotDecisionLibInterface;
613
+ }
614
+ static connect(
615
+ address: string,
616
+ signerOrProvider: Signer | Provider
617
+ ): BotDecisionLib {
618
+ return new Contract(address, _abi, signerOrProvider) as BotDecisionLib;
619
+ }
620
+ }
@@ -460,6 +460,11 @@ const _abi = [
460
460
  ],
461
461
  name: "addLiqFromSy",
462
462
  outputs: [
463
+ {
464
+ internalType: "uint256",
465
+ name: "netPtFromSwap",
466
+ type: "uint256",
467
+ },
463
468
  {
464
469
  internalType: "uint256",
465
470
  name: "netLpOut",
@@ -538,6 +543,11 @@ const _abi = [
538
543
  ],
539
544
  name: "addLiqFromYt",
540
545
  outputs: [
546
+ {
547
+ internalType: "uint256",
548
+ name: "netPtFromSwap",
549
+ type: "uint256",
550
+ },
541
551
  {
542
552
  internalType: "uint256",
543
553
  name: "netLpOut",