@dhedge/v2-sdk 1.5.3 → 1.7.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 (44) hide show
  1. package/dist/config.d.ts +2 -1
  2. package/dist/entities/pool.d.ts +44 -2
  3. package/dist/entities/utils.d.ts +7 -2
  4. package/dist/services/lyra/markets.d.ts +6 -0
  5. package/dist/services/lyra/positions.d.ts +2 -0
  6. package/dist/services/lyra/quote.d.ts +4 -0
  7. package/dist/services/lyra/trade.d.ts +4 -0
  8. package/dist/services/lyra/tradeOptionType.d.ts +3 -0
  9. package/dist/services/velodrome/liquidity.d.ts +4 -0
  10. package/dist/services/velodrome/staking.d.ts +4 -0
  11. package/dist/test/constants.d.ts +3 -0
  12. package/dist/types.d.ts +21 -1
  13. package/dist/v2-sdk.cjs.development.js +6701 -291
  14. package/dist/v2-sdk.cjs.development.js.map +1 -1
  15. package/dist/v2-sdk.cjs.production.min.js +1 -1
  16. package/dist/v2-sdk.cjs.production.min.js.map +1 -1
  17. package/dist/v2-sdk.esm.js +6699 -290
  18. package/dist/v2-sdk.esm.js.map +1 -1
  19. package/package.json +6 -2
  20. package/src/abi/IOptionMArketWrapper.json +1038 -0
  21. package/src/abi/IOptionMarket.json +1473 -0
  22. package/src/abi/IOptionToken.json +1671 -0
  23. package/src/abi/IVeldodromeRouter.json +438 -0
  24. package/src/abi/IVelodromeGauge.json +559 -0
  25. package/src/config.ts +11 -5
  26. package/src/entities/pool.ts +167 -20
  27. package/src/entities/utils.ts +45 -2
  28. package/src/services/lyra/markets.ts +52 -0
  29. package/src/services/lyra/positions.ts +19 -0
  30. package/src/services/lyra/quote.ts +12 -0
  31. package/src/services/lyra/trade.ts +101 -0
  32. package/src/services/lyra/tradeOptionType.ts +19 -0
  33. package/src/services/velodrome/liquidity.ts +48 -0
  34. package/src/services/velodrome/staking.ts +31 -0
  35. package/src/test/constants.ts +3 -0
  36. package/src/test/lyra.test.ts +163 -0
  37. package/src/test/pool.test.ts +1 -1
  38. package/src/test/toros.test.ts +1 -1
  39. package/src/test/txOptions.ts +1 -1
  40. package/src/test/uniswap.test.ts +1 -1
  41. package/src/test/velodrome.test.ts +141 -0
  42. package/src/test/wallet.ts +8 -0
  43. package/src/types.ts +21 -1
  44. package/src/test/sushi.test.ts +0 -173
@@ -0,0 +1,1038 @@
1
+ {
2
+ "abi": [
3
+ {
4
+ "inputs": [
5
+ { "internalType": "address", "name": "thrower", "type": "address" },
6
+ {
7
+ "internalType": "contract ERC20",
8
+ "name": "asset",
9
+ "type": "address"
10
+ },
11
+ { "internalType": "address", "name": "approving", "type": "address" },
12
+ {
13
+ "internalType": "uint256",
14
+ "name": "approvalAmount",
15
+ "type": "uint256"
16
+ }
17
+ ],
18
+ "name": "ApprovalFailure",
19
+ "type": "error"
20
+ },
21
+ {
22
+ "inputs": [
23
+ { "internalType": "address", "name": "thrower", "type": "address" },
24
+ {
25
+ "internalType": "contract ERC20",
26
+ "name": "asset",
27
+ "type": "address"
28
+ },
29
+ { "internalType": "address", "name": "sender", "type": "address" },
30
+ { "internalType": "address", "name": "receiver", "type": "address" },
31
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
32
+ ],
33
+ "name": "AssetTransferFailed",
34
+ "type": "error"
35
+ },
36
+ {
37
+ "inputs": [
38
+ { "internalType": "address", "name": "thrower", "type": "address" },
39
+ { "internalType": "uint8", "name": "id", "type": "uint8" },
40
+ { "internalType": "address", "name": "addr", "type": "address" }
41
+ ],
42
+ "name": "DuplicateEntry",
43
+ "type": "error"
44
+ },
45
+ {
46
+ "inputs": [
47
+ { "internalType": "address", "name": "thrower", "type": "address" },
48
+ { "internalType": "address", "name": "caller", "type": "address" },
49
+ {
50
+ "internalType": "address",
51
+ "name": "nominatedOwner",
52
+ "type": "address"
53
+ }
54
+ ],
55
+ "name": "OnlyNominatedOwner",
56
+ "type": "error"
57
+ },
58
+ {
59
+ "inputs": [
60
+ { "internalType": "address", "name": "thrower", "type": "address" },
61
+ { "internalType": "address", "name": "caller", "type": "address" },
62
+ { "internalType": "address", "name": "owner", "type": "address" }
63
+ ],
64
+ "name": "OnlyOwner",
65
+ "type": "error"
66
+ },
67
+ {
68
+ "inputs": [
69
+ { "internalType": "address", "name": "thrower", "type": "address" },
70
+ {
71
+ "internalType": "enum OptionMarket.OptionType",
72
+ "name": "optionType",
73
+ "type": "uint8"
74
+ }
75
+ ],
76
+ "name": "OnlyShorts",
77
+ "type": "error"
78
+ },
79
+ {
80
+ "inputs": [
81
+ { "internalType": "address", "name": "thrower", "type": "address" },
82
+ { "internalType": "uint8", "name": "id", "type": "uint8" }
83
+ ],
84
+ "name": "RemovingInvalidId",
85
+ "type": "error"
86
+ },
87
+ {
88
+ "inputs": [
89
+ { "internalType": "address", "name": "asset", "type": "address" }
90
+ ],
91
+ "name": "UnsupportedToken",
92
+ "type": "error"
93
+ },
94
+ {
95
+ "anonymous": false,
96
+ "inputs": [
97
+ {
98
+ "indexed": false,
99
+ "internalType": "address",
100
+ "name": "oldOwner",
101
+ "type": "address"
102
+ },
103
+ {
104
+ "indexed": false,
105
+ "internalType": "address",
106
+ "name": "newOwner",
107
+ "type": "address"
108
+ }
109
+ ],
110
+ "name": "OwnerChanged",
111
+ "type": "event"
112
+ },
113
+ {
114
+ "anonymous": false,
115
+ "inputs": [
116
+ {
117
+ "indexed": false,
118
+ "internalType": "address",
119
+ "name": "newOwner",
120
+ "type": "address"
121
+ }
122
+ ],
123
+ "name": "OwnerNominated",
124
+ "type": "event"
125
+ },
126
+ {
127
+ "anonymous": false,
128
+ "inputs": [
129
+ {
130
+ "indexed": false,
131
+ "internalType": "bool",
132
+ "name": "isOpen",
133
+ "type": "bool"
134
+ },
135
+ {
136
+ "indexed": false,
137
+ "internalType": "bool",
138
+ "name": "isLong",
139
+ "type": "bool"
140
+ },
141
+ {
142
+ "indexed": true,
143
+ "internalType": "address",
144
+ "name": "market",
145
+ "type": "address"
146
+ },
147
+ {
148
+ "indexed": true,
149
+ "internalType": "uint256",
150
+ "name": "positionId",
151
+ "type": "uint256"
152
+ },
153
+ {
154
+ "indexed": true,
155
+ "internalType": "address",
156
+ "name": "owner",
157
+ "type": "address"
158
+ },
159
+ {
160
+ "indexed": false,
161
+ "internalType": "uint256",
162
+ "name": "amount",
163
+ "type": "uint256"
164
+ },
165
+ {
166
+ "indexed": false,
167
+ "internalType": "uint256",
168
+ "name": "totalCost",
169
+ "type": "uint256"
170
+ },
171
+ {
172
+ "indexed": false,
173
+ "internalType": "uint256",
174
+ "name": "totalFee",
175
+ "type": "uint256"
176
+ },
177
+ {
178
+ "indexed": false,
179
+ "internalType": "int256",
180
+ "name": "swapFee",
181
+ "type": "int256"
182
+ },
183
+ {
184
+ "indexed": false,
185
+ "internalType": "address",
186
+ "name": "token",
187
+ "type": "address"
188
+ }
189
+ ],
190
+ "name": "PositionTraded",
191
+ "type": "event"
192
+ },
193
+ {
194
+ "anonymous": false,
195
+ "inputs": [
196
+ {
197
+ "indexed": false,
198
+ "internalType": "uint256",
199
+ "name": "newCollateral",
200
+ "type": "uint256"
201
+ }
202
+ ],
203
+ "name": "SetCollateralTo",
204
+ "type": "event"
205
+ },
206
+ {
207
+ "anonymous": false,
208
+ "inputs": [
209
+ {
210
+ "indexed": false,
211
+ "internalType": "contract ICurve",
212
+ "name": "curveSwap",
213
+ "type": "address"
214
+ },
215
+ {
216
+ "indexed": false,
217
+ "internalType": "contract SynthetixAdapter",
218
+ "name": "synthetixAdapter",
219
+ "type": "address"
220
+ },
221
+ {
222
+ "indexed": false,
223
+ "internalType": "contract IFeeCounter",
224
+ "name": "tradingRewards",
225
+ "type": "address"
226
+ },
227
+ {
228
+ "indexed": false,
229
+ "internalType": "uint256",
230
+ "name": "minReturnPercent",
231
+ "type": "uint256"
232
+ }
233
+ ],
234
+ "name": "WrapperParamsUpdated",
235
+ "type": "event"
236
+ },
237
+ {
238
+ "inputs": [],
239
+ "name": "acceptOwnership",
240
+ "outputs": [],
241
+ "stateMutability": "nonpayable",
242
+ "type": "function"
243
+ },
244
+ {
245
+ "inputs": [
246
+ {
247
+ "internalType": "contract ERC20",
248
+ "name": "token",
249
+ "type": "address"
250
+ },
251
+ { "internalType": "uint8", "name": "id", "type": "uint8" }
252
+ ],
253
+ "name": "addCurveStable",
254
+ "outputs": [],
255
+ "stateMutability": "nonpayable",
256
+ "type": "function"
257
+ },
258
+ {
259
+ "inputs": [
260
+ { "internalType": "uint256", "name": "params", "type": "uint256" }
261
+ ],
262
+ "name": "addLong",
263
+ "outputs": [
264
+ { "internalType": "uint256", "name": "totalCost", "type": "uint256" }
265
+ ],
266
+ "stateMutability": "nonpayable",
267
+ "type": "function"
268
+ },
269
+ {
270
+ "inputs": [
271
+ {
272
+ "internalType": "contract OptionMarket",
273
+ "name": "optionMarket",
274
+ "type": "address"
275
+ },
276
+ { "internalType": "uint8", "name": "id", "type": "uint8" },
277
+ {
278
+ "components": [
279
+ {
280
+ "internalType": "contract ERC20",
281
+ "name": "quoteAsset",
282
+ "type": "address"
283
+ },
284
+ {
285
+ "internalType": "contract ERC20",
286
+ "name": "baseAsset",
287
+ "type": "address"
288
+ },
289
+ {
290
+ "internalType": "contract OptionToken",
291
+ "name": "optionToken",
292
+ "type": "address"
293
+ },
294
+ {
295
+ "internalType": "contract LiquidityPool",
296
+ "name": "liquidityPool",
297
+ "type": "address"
298
+ },
299
+ {
300
+ "internalType": "contract LiquidityToken",
301
+ "name": "liquidityToken",
302
+ "type": "address"
303
+ }
304
+ ],
305
+ "internalType": "struct OptionMarketWrapperWithSwaps.OptionMarketContracts",
306
+ "name": "_marketContracts",
307
+ "type": "tuple"
308
+ }
309
+ ],
310
+ "name": "addMarket",
311
+ "outputs": [],
312
+ "stateMutability": "nonpayable",
313
+ "type": "function"
314
+ },
315
+ {
316
+ "inputs": [
317
+ { "internalType": "uint256", "name": "params", "type": "uint256" }
318
+ ],
319
+ "name": "addShort",
320
+ "outputs": [
321
+ {
322
+ "internalType": "uint256",
323
+ "name": "totalReceived",
324
+ "type": "uint256"
325
+ }
326
+ ],
327
+ "stateMutability": "nonpayable",
328
+ "type": "function"
329
+ },
330
+ {
331
+ "inputs": [
332
+ { "internalType": "uint256", "name": "params", "type": "uint256" }
333
+ ],
334
+ "name": "closeLong",
335
+ "outputs": [
336
+ {
337
+ "internalType": "uint256",
338
+ "name": "totalReceived",
339
+ "type": "uint256"
340
+ }
341
+ ],
342
+ "stateMutability": "nonpayable",
343
+ "type": "function"
344
+ },
345
+ {
346
+ "inputs": [
347
+ {
348
+ "components": [
349
+ {
350
+ "internalType": "contract OptionMarket",
351
+ "name": "optionMarket",
352
+ "type": "address"
353
+ },
354
+ {
355
+ "internalType": "uint256",
356
+ "name": "strikeId",
357
+ "type": "uint256"
358
+ },
359
+ {
360
+ "internalType": "uint256",
361
+ "name": "positionId",
362
+ "type": "uint256"
363
+ },
364
+ {
365
+ "internalType": "uint256",
366
+ "name": "iterations",
367
+ "type": "uint256"
368
+ },
369
+ {
370
+ "internalType": "uint256",
371
+ "name": "setCollateralTo",
372
+ "type": "uint256"
373
+ },
374
+ {
375
+ "internalType": "uint256",
376
+ "name": "currentCollateral",
377
+ "type": "uint256"
378
+ },
379
+ {
380
+ "internalType": "enum OptionMarket.OptionType",
381
+ "name": "optionType",
382
+ "type": "uint8"
383
+ },
384
+ {
385
+ "internalType": "uint256",
386
+ "name": "amount",
387
+ "type": "uint256"
388
+ },
389
+ {
390
+ "internalType": "uint256",
391
+ "name": "minCost",
392
+ "type": "uint256"
393
+ },
394
+ {
395
+ "internalType": "uint256",
396
+ "name": "maxCost",
397
+ "type": "uint256"
398
+ },
399
+ {
400
+ "internalType": "uint256",
401
+ "name": "inputAmount",
402
+ "type": "uint256"
403
+ },
404
+ {
405
+ "internalType": "contract ERC20",
406
+ "name": "inputAsset",
407
+ "type": "address"
408
+ }
409
+ ],
410
+ "internalType": "struct OptionMarketWrapperWithSwaps.OptionPositionParams",
411
+ "name": "params",
412
+ "type": "tuple"
413
+ }
414
+ ],
415
+ "name": "closePosition",
416
+ "outputs": [
417
+ {
418
+ "components": [
419
+ {
420
+ "internalType": "address",
421
+ "name": "market",
422
+ "type": "address"
423
+ },
424
+ {
425
+ "internalType": "uint256",
426
+ "name": "positionId",
427
+ "type": "uint256"
428
+ },
429
+ { "internalType": "address", "name": "owner", "type": "address" },
430
+ {
431
+ "internalType": "uint256",
432
+ "name": "amount",
433
+ "type": "uint256"
434
+ },
435
+ {
436
+ "internalType": "uint256",
437
+ "name": "totalCost",
438
+ "type": "uint256"
439
+ },
440
+ {
441
+ "internalType": "uint256",
442
+ "name": "totalFee",
443
+ "type": "uint256"
444
+ },
445
+ { "internalType": "int256", "name": "swapFee", "type": "int256" },
446
+ { "internalType": "address", "name": "token", "type": "address" }
447
+ ],
448
+ "internalType": "struct OptionMarketWrapperWithSwaps.ReturnDetails",
449
+ "name": "returnDetails",
450
+ "type": "tuple"
451
+ }
452
+ ],
453
+ "stateMutability": "nonpayable",
454
+ "type": "function"
455
+ },
456
+ {
457
+ "inputs": [
458
+ { "internalType": "uint256", "name": "params", "type": "uint256" }
459
+ ],
460
+ "name": "closeShort",
461
+ "outputs": [
462
+ { "internalType": "uint256", "name": "totalCost", "type": "uint256" }
463
+ ],
464
+ "stateMutability": "nonpayable",
465
+ "type": "function"
466
+ },
467
+ {
468
+ "inputs": [],
469
+ "name": "curveSwap",
470
+ "outputs": [
471
+ { "internalType": "contract ICurve", "name": "", "type": "address" }
472
+ ],
473
+ "stateMutability": "view",
474
+ "type": "function"
475
+ },
476
+ {
477
+ "inputs": [
478
+ { "internalType": "uint256", "name": "", "type": "uint256" }
479
+ ],
480
+ "name": "ercIds",
481
+ "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
482
+ "stateMutability": "view",
483
+ "type": "function"
484
+ },
485
+ {
486
+ "inputs": [
487
+ {
488
+ "components": [
489
+ {
490
+ "internalType": "contract OptionMarket",
491
+ "name": "optionMarket",
492
+ "type": "address"
493
+ },
494
+ {
495
+ "internalType": "uint256",
496
+ "name": "strikeId",
497
+ "type": "uint256"
498
+ },
499
+ {
500
+ "internalType": "uint256",
501
+ "name": "positionId",
502
+ "type": "uint256"
503
+ },
504
+ {
505
+ "internalType": "uint256",
506
+ "name": "iterations",
507
+ "type": "uint256"
508
+ },
509
+ {
510
+ "internalType": "uint256",
511
+ "name": "setCollateralTo",
512
+ "type": "uint256"
513
+ },
514
+ {
515
+ "internalType": "uint256",
516
+ "name": "currentCollateral",
517
+ "type": "uint256"
518
+ },
519
+ {
520
+ "internalType": "enum OptionMarket.OptionType",
521
+ "name": "optionType",
522
+ "type": "uint8"
523
+ },
524
+ {
525
+ "internalType": "uint256",
526
+ "name": "amount",
527
+ "type": "uint256"
528
+ },
529
+ {
530
+ "internalType": "uint256",
531
+ "name": "minCost",
532
+ "type": "uint256"
533
+ },
534
+ {
535
+ "internalType": "uint256",
536
+ "name": "maxCost",
537
+ "type": "uint256"
538
+ },
539
+ {
540
+ "internalType": "uint256",
541
+ "name": "inputAmount",
542
+ "type": "uint256"
543
+ },
544
+ {
545
+ "internalType": "contract ERC20",
546
+ "name": "inputAsset",
547
+ "type": "address"
548
+ }
549
+ ],
550
+ "internalType": "struct OptionMarketWrapperWithSwaps.OptionPositionParams",
551
+ "name": "params",
552
+ "type": "tuple"
553
+ }
554
+ ],
555
+ "name": "forceClosePosition",
556
+ "outputs": [
557
+ {
558
+ "components": [
559
+ {
560
+ "internalType": "address",
561
+ "name": "market",
562
+ "type": "address"
563
+ },
564
+ {
565
+ "internalType": "uint256",
566
+ "name": "positionId",
567
+ "type": "uint256"
568
+ },
569
+ { "internalType": "address", "name": "owner", "type": "address" },
570
+ {
571
+ "internalType": "uint256",
572
+ "name": "amount",
573
+ "type": "uint256"
574
+ },
575
+ {
576
+ "internalType": "uint256",
577
+ "name": "totalCost",
578
+ "type": "uint256"
579
+ },
580
+ {
581
+ "internalType": "uint256",
582
+ "name": "totalFee",
583
+ "type": "uint256"
584
+ },
585
+ { "internalType": "int256", "name": "swapFee", "type": "int256" },
586
+ { "internalType": "address", "name": "token", "type": "address" }
587
+ ],
588
+ "internalType": "struct OptionMarketWrapperWithSwaps.ReturnDetails",
589
+ "name": "returnDetails",
590
+ "type": "tuple"
591
+ }
592
+ ],
593
+ "stateMutability": "nonpayable",
594
+ "type": "function"
595
+ },
596
+ {
597
+ "inputs": [
598
+ { "internalType": "address", "name": "owner", "type": "address" }
599
+ ],
600
+ "name": "getBalancesAndAllowances",
601
+ "outputs": [
602
+ {
603
+ "components": [
604
+ { "internalType": "uint8", "name": "id", "type": "uint8" },
605
+ { "internalType": "address", "name": "token", "type": "address" },
606
+ { "internalType": "uint8", "name": "decimals", "type": "uint8" },
607
+ { "internalType": "string", "name": "symbol", "type": "string" },
608
+ {
609
+ "internalType": "uint256",
610
+ "name": "balance",
611
+ "type": "uint256"
612
+ },
613
+ {
614
+ "internalType": "uint256",
615
+ "name": "allowance",
616
+ "type": "uint256"
617
+ }
618
+ ],
619
+ "internalType": "struct OptionMarketWrapperWithSwaps.StableAssetView[]",
620
+ "name": "",
621
+ "type": "tuple[]"
622
+ },
623
+ {
624
+ "components": [
625
+ { "internalType": "uint8", "name": "id", "type": "uint8" },
626
+ {
627
+ "internalType": "contract OptionMarket",
628
+ "name": "market",
629
+ "type": "address"
630
+ },
631
+ { "internalType": "address", "name": "token", "type": "address" },
632
+ { "internalType": "uint8", "name": "decimals", "type": "uint8" },
633
+ { "internalType": "string", "name": "symbol", "type": "string" },
634
+ {
635
+ "internalType": "uint256",
636
+ "name": "balance",
637
+ "type": "uint256"
638
+ },
639
+ {
640
+ "internalType": "uint256",
641
+ "name": "allowance",
642
+ "type": "uint256"
643
+ },
644
+ {
645
+ "internalType": "bool",
646
+ "name": "isApprovedForAll",
647
+ "type": "bool"
648
+ }
649
+ ],
650
+ "internalType": "struct OptionMarketWrapperWithSwaps.MarketAssetView[]",
651
+ "name": "",
652
+ "type": "tuple[]"
653
+ },
654
+ {
655
+ "components": [
656
+ { "internalType": "address", "name": "token", "type": "address" },
657
+ {
658
+ "internalType": "uint256",
659
+ "name": "balance",
660
+ "type": "uint256"
661
+ },
662
+ {
663
+ "internalType": "uint256",
664
+ "name": "allowance",
665
+ "type": "uint256"
666
+ }
667
+ ],
668
+ "internalType": "struct OptionMarketWrapperWithSwaps.LiquidityBalanceAndAllowance[]",
669
+ "name": "",
670
+ "type": "tuple[]"
671
+ }
672
+ ],
673
+ "stateMutability": "view",
674
+ "type": "function"
675
+ },
676
+ {
677
+ "inputs": [],
678
+ "name": "getMarketAndErcIds",
679
+ "outputs": [
680
+ { "internalType": "uint8[]", "name": "", "type": "uint8[]" },
681
+ { "internalType": "uint8[]", "name": "", "type": "uint8[]" }
682
+ ],
683
+ "stateMutability": "view",
684
+ "type": "function"
685
+ },
686
+ {
687
+ "inputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
688
+ "name": "idToERC",
689
+ "outputs": [
690
+ { "internalType": "contract ERC20", "name": "", "type": "address" }
691
+ ],
692
+ "stateMutability": "view",
693
+ "type": "function"
694
+ },
695
+ {
696
+ "inputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
697
+ "name": "idToMarket",
698
+ "outputs": [
699
+ {
700
+ "internalType": "contract OptionMarket",
701
+ "name": "",
702
+ "type": "address"
703
+ }
704
+ ],
705
+ "stateMutability": "view",
706
+ "type": "function"
707
+ },
708
+ {
709
+ "inputs": [
710
+ {
711
+ "internalType": "contract OptionMarket",
712
+ "name": "",
713
+ "type": "address"
714
+ }
715
+ ],
716
+ "name": "marketContracts",
717
+ "outputs": [
718
+ {
719
+ "internalType": "contract ERC20",
720
+ "name": "quoteAsset",
721
+ "type": "address"
722
+ },
723
+ {
724
+ "internalType": "contract ERC20",
725
+ "name": "baseAsset",
726
+ "type": "address"
727
+ },
728
+ {
729
+ "internalType": "contract OptionToken",
730
+ "name": "optionToken",
731
+ "type": "address"
732
+ },
733
+ {
734
+ "internalType": "contract LiquidityPool",
735
+ "name": "liquidityPool",
736
+ "type": "address"
737
+ },
738
+ {
739
+ "internalType": "contract LiquidityToken",
740
+ "name": "liquidityToken",
741
+ "type": "address"
742
+ }
743
+ ],
744
+ "stateMutability": "view",
745
+ "type": "function"
746
+ },
747
+ {
748
+ "inputs": [
749
+ { "internalType": "uint256", "name": "", "type": "uint256" }
750
+ ],
751
+ "name": "marketIds",
752
+ "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
753
+ "stateMutability": "view",
754
+ "type": "function"
755
+ },
756
+ {
757
+ "inputs": [],
758
+ "name": "minReturnPercent",
759
+ "outputs": [
760
+ { "internalType": "uint256", "name": "", "type": "uint256" }
761
+ ],
762
+ "stateMutability": "view",
763
+ "type": "function"
764
+ },
765
+ {
766
+ "inputs": [
767
+ { "internalType": "address", "name": "_owner", "type": "address" }
768
+ ],
769
+ "name": "nominateNewOwner",
770
+ "outputs": [],
771
+ "stateMutability": "nonpayable",
772
+ "type": "function"
773
+ },
774
+ {
775
+ "inputs": [],
776
+ "name": "nominatedOwner",
777
+ "outputs": [
778
+ { "internalType": "address", "name": "", "type": "address" }
779
+ ],
780
+ "stateMutability": "view",
781
+ "type": "function"
782
+ },
783
+ {
784
+ "inputs": [
785
+ { "internalType": "uint256", "name": "params", "type": "uint256" }
786
+ ],
787
+ "name": "openLong",
788
+ "outputs": [
789
+ { "internalType": "uint256", "name": "totalCost", "type": "uint256" }
790
+ ],
791
+ "stateMutability": "nonpayable",
792
+ "type": "function"
793
+ },
794
+ {
795
+ "inputs": [
796
+ {
797
+ "components": [
798
+ {
799
+ "internalType": "contract OptionMarket",
800
+ "name": "optionMarket",
801
+ "type": "address"
802
+ },
803
+ {
804
+ "internalType": "uint256",
805
+ "name": "strikeId",
806
+ "type": "uint256"
807
+ },
808
+ {
809
+ "internalType": "uint256",
810
+ "name": "positionId",
811
+ "type": "uint256"
812
+ },
813
+ {
814
+ "internalType": "uint256",
815
+ "name": "iterations",
816
+ "type": "uint256"
817
+ },
818
+ {
819
+ "internalType": "uint256",
820
+ "name": "setCollateralTo",
821
+ "type": "uint256"
822
+ },
823
+ {
824
+ "internalType": "uint256",
825
+ "name": "currentCollateral",
826
+ "type": "uint256"
827
+ },
828
+ {
829
+ "internalType": "enum OptionMarket.OptionType",
830
+ "name": "optionType",
831
+ "type": "uint8"
832
+ },
833
+ {
834
+ "internalType": "uint256",
835
+ "name": "amount",
836
+ "type": "uint256"
837
+ },
838
+ {
839
+ "internalType": "uint256",
840
+ "name": "minCost",
841
+ "type": "uint256"
842
+ },
843
+ {
844
+ "internalType": "uint256",
845
+ "name": "maxCost",
846
+ "type": "uint256"
847
+ },
848
+ {
849
+ "internalType": "uint256",
850
+ "name": "inputAmount",
851
+ "type": "uint256"
852
+ },
853
+ {
854
+ "internalType": "contract ERC20",
855
+ "name": "inputAsset",
856
+ "type": "address"
857
+ }
858
+ ],
859
+ "internalType": "struct OptionMarketWrapperWithSwaps.OptionPositionParams",
860
+ "name": "params",
861
+ "type": "tuple"
862
+ }
863
+ ],
864
+ "name": "openPosition",
865
+ "outputs": [
866
+ {
867
+ "components": [
868
+ {
869
+ "internalType": "address",
870
+ "name": "market",
871
+ "type": "address"
872
+ },
873
+ {
874
+ "internalType": "uint256",
875
+ "name": "positionId",
876
+ "type": "uint256"
877
+ },
878
+ { "internalType": "address", "name": "owner", "type": "address" },
879
+ {
880
+ "internalType": "uint256",
881
+ "name": "amount",
882
+ "type": "uint256"
883
+ },
884
+ {
885
+ "internalType": "uint256",
886
+ "name": "totalCost",
887
+ "type": "uint256"
888
+ },
889
+ {
890
+ "internalType": "uint256",
891
+ "name": "totalFee",
892
+ "type": "uint256"
893
+ },
894
+ { "internalType": "int256", "name": "swapFee", "type": "int256" },
895
+ { "internalType": "address", "name": "token", "type": "address" }
896
+ ],
897
+ "internalType": "struct OptionMarketWrapperWithSwaps.ReturnDetails",
898
+ "name": "returnDetails",
899
+ "type": "tuple"
900
+ }
901
+ ],
902
+ "stateMutability": "nonpayable",
903
+ "type": "function"
904
+ },
905
+ {
906
+ "inputs": [
907
+ { "internalType": "uint256", "name": "params", "type": "uint256" }
908
+ ],
909
+ "name": "openShort",
910
+ "outputs": [
911
+ {
912
+ "internalType": "uint256",
913
+ "name": "totalReceived",
914
+ "type": "uint256"
915
+ }
916
+ ],
917
+ "stateMutability": "nonpayable",
918
+ "type": "function"
919
+ },
920
+ {
921
+ "inputs": [],
922
+ "name": "owner",
923
+ "outputs": [
924
+ { "internalType": "address", "name": "", "type": "address" }
925
+ ],
926
+ "stateMutability": "view",
927
+ "type": "function"
928
+ },
929
+ {
930
+ "inputs": [
931
+ { "internalType": "address", "name": "fromToken", "type": "address" },
932
+ { "internalType": "address", "name": "toToken", "type": "address" },
933
+ { "internalType": "uint256", "name": "amountIn", "type": "uint256" }
934
+ ],
935
+ "name": "quoteCurveSwap",
936
+ "outputs": [
937
+ { "internalType": "address", "name": "pool", "type": "address" },
938
+ { "internalType": "uint256", "name": "amountOut", "type": "uint256" }
939
+ ],
940
+ "stateMutability": "view",
941
+ "type": "function"
942
+ },
943
+ {
944
+ "inputs": [
945
+ { "internalType": "uint256", "name": "params", "type": "uint256" }
946
+ ],
947
+ "name": "reduceLong",
948
+ "outputs": [
949
+ {
950
+ "internalType": "uint256",
951
+ "name": "totalReceived",
952
+ "type": "uint256"
953
+ }
954
+ ],
955
+ "stateMutability": "nonpayable",
956
+ "type": "function"
957
+ },
958
+ {
959
+ "inputs": [
960
+ { "internalType": "uint256", "name": "params", "type": "uint256" }
961
+ ],
962
+ "name": "reduceShort",
963
+ "outputs": [
964
+ { "internalType": "uint256", "name": "totalCost", "type": "uint256" }
965
+ ],
966
+ "stateMutability": "nonpayable",
967
+ "type": "function"
968
+ },
969
+ {
970
+ "inputs": [{ "internalType": "uint8", "name": "id", "type": "uint8" }],
971
+ "name": "removeCurveStable",
972
+ "outputs": [],
973
+ "stateMutability": "nonpayable",
974
+ "type": "function"
975
+ },
976
+ {
977
+ "inputs": [{ "internalType": "uint8", "name": "id", "type": "uint8" }],
978
+ "name": "removeMarket",
979
+ "outputs": [],
980
+ "stateMutability": "nonpayable",
981
+ "type": "function"
982
+ },
983
+ {
984
+ "inputs": [],
985
+ "name": "synthetixAdapter",
986
+ "outputs": [
987
+ {
988
+ "internalType": "contract SynthetixAdapter",
989
+ "name": "",
990
+ "type": "address"
991
+ }
992
+ ],
993
+ "stateMutability": "view",
994
+ "type": "function"
995
+ },
996
+ {
997
+ "inputs": [],
998
+ "name": "tradingRewards",
999
+ "outputs": [
1000
+ {
1001
+ "internalType": "contract IFeeCounter",
1002
+ "name": "",
1003
+ "type": "address"
1004
+ }
1005
+ ],
1006
+ "stateMutability": "view",
1007
+ "type": "function"
1008
+ },
1009
+ {
1010
+ "inputs": [
1011
+ {
1012
+ "internalType": "contract ICurve",
1013
+ "name": "_curveSwap",
1014
+ "type": "address"
1015
+ },
1016
+ {
1017
+ "internalType": "contract SynthetixAdapter",
1018
+ "name": "_synthetixAdapter",
1019
+ "type": "address"
1020
+ },
1021
+ {
1022
+ "internalType": "contract IFeeCounter",
1023
+ "name": "_tradingRewards",
1024
+ "type": "address"
1025
+ },
1026
+ {
1027
+ "internalType": "uint256",
1028
+ "name": "_minReturnPercent",
1029
+ "type": "uint256"
1030
+ }
1031
+ ],
1032
+ "name": "updateContractParams",
1033
+ "outputs": [],
1034
+ "stateMutability": "nonpayable",
1035
+ "type": "function"
1036
+ }
1037
+ ]
1038
+ }