@dhedge/v2-sdk 1.5.4 → 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 (38) hide show
  1. package/dist/config.d.ts +2 -1
  2. package/dist/entities/pool.d.ts +21 -1
  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/test/constants.d.ts +1 -0
  10. package/dist/types.d.ts +20 -1
  11. package/dist/v2-sdk.cjs.development.js +4202 -12
  12. package/dist/v2-sdk.cjs.development.js.map +1 -1
  13. package/dist/v2-sdk.cjs.production.min.js +1 -1
  14. package/dist/v2-sdk.cjs.production.min.js.map +1 -1
  15. package/dist/v2-sdk.esm.js +4200 -11
  16. package/dist/v2-sdk.esm.js.map +1 -1
  17. package/package.json +6 -2
  18. package/src/abi/IOptionMArketWrapper.json +1038 -0
  19. package/src/abi/IOptionMarket.json +1473 -0
  20. package/src/abi/IOptionToken.json +1671 -0
  21. package/src/config.ts +10 -5
  22. package/src/entities/pool.ts +61 -1
  23. package/src/entities/utils.ts +45 -2
  24. package/src/services/lyra/markets.ts +52 -0
  25. package/src/services/lyra/positions.ts +19 -0
  26. package/src/services/lyra/quote.ts +12 -0
  27. package/src/services/lyra/trade.ts +101 -0
  28. package/src/services/lyra/tradeOptionType.ts +19 -0
  29. package/src/test/constants.ts +1 -0
  30. package/src/test/lyra.test.ts +163 -0
  31. package/src/test/pool.test.ts +1 -1
  32. package/src/test/toros.test.ts +1 -1
  33. package/src/test/txOptions.ts +1 -1
  34. package/src/test/uniswap.test.ts +1 -1
  35. package/src/test/velodrome.test.ts +1 -1
  36. package/src/test/wallet.ts +8 -0
  37. package/src/types.ts +20 -1
  38. package/src/test/sushi.test.ts +0 -173
@@ -0,0 +1,1671 @@
1
+ {
2
+ "abi": [
3
+ {
4
+ "inputs": [
5
+ { "internalType": "string", "name": "name_", "type": "string" },
6
+ { "internalType": "string", "name": "symbol_", "type": "string" }
7
+ ],
8
+ "stateMutability": "nonpayable",
9
+ "type": "constructor"
10
+ },
11
+ {
12
+ "inputs": [
13
+ { "internalType": "address", "name": "thrower", "type": "address" },
14
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" },
15
+ { "internalType": "bool", "name": "invalidPositionId", "type": "bool" },
16
+ { "internalType": "bool", "name": "positionInactive", "type": "bool" },
17
+ { "internalType": "bool", "name": "isShort", "type": "bool" }
18
+ ],
19
+ "name": "AddingCollateralToInvalidPosition",
20
+ "type": "error"
21
+ },
22
+ {
23
+ "inputs": [
24
+ { "internalType": "address", "name": "thrower", "type": "address" },
25
+ {
26
+ "components": [
27
+ {
28
+ "internalType": "uint256",
29
+ "name": "positionId",
30
+ "type": "uint256"
31
+ },
32
+ {
33
+ "internalType": "uint256",
34
+ "name": "strikeId",
35
+ "type": "uint256"
36
+ },
37
+ {
38
+ "internalType": "enum OptionMarket.OptionType",
39
+ "name": "optionType",
40
+ "type": "uint8"
41
+ },
42
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
43
+ {
44
+ "internalType": "uint256",
45
+ "name": "collateral",
46
+ "type": "uint256"
47
+ },
48
+ {
49
+ "internalType": "enum OptionToken.PositionState",
50
+ "name": "state",
51
+ "type": "uint8"
52
+ }
53
+ ],
54
+ "internalType": "struct OptionToken.OptionPosition",
55
+ "name": "position",
56
+ "type": "tuple"
57
+ },
58
+ { "internalType": "uint256", "name": "spotPrice", "type": "uint256" }
59
+ ],
60
+ "name": "AdjustmentResultsInMinimumCollateralNotBeingMet",
61
+ "type": "error"
62
+ },
63
+ {
64
+ "inputs": [
65
+ { "internalType": "address", "name": "thrower", "type": "address" }
66
+ ],
67
+ "name": "AlreadyInitialised",
68
+ "type": "error"
69
+ },
70
+ {
71
+ "inputs": [
72
+ { "internalType": "address", "name": "thrower", "type": "address" },
73
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" },
74
+ { "internalType": "bool", "name": "invalidPositionId", "type": "bool" },
75
+ { "internalType": "bool", "name": "positionInactive", "type": "bool" },
76
+ { "internalType": "bool", "name": "strikeMismatch", "type": "bool" },
77
+ { "internalType": "bool", "name": "optionTypeMismatch", "type": "bool" }
78
+ ],
79
+ "name": "CannotAdjustInvalidPosition",
80
+ "type": "error"
81
+ },
82
+ {
83
+ "inputs": [
84
+ { "internalType": "address", "name": "thrower", "type": "address" }
85
+ ],
86
+ "name": "CannotClosePositionZero",
87
+ "type": "error"
88
+ },
89
+ {
90
+ "inputs": [
91
+ { "internalType": "address", "name": "thrower", "type": "address" }
92
+ ],
93
+ "name": "CannotOpenZeroAmount",
94
+ "type": "error"
95
+ },
96
+ {
97
+ "inputs": [
98
+ { "internalType": "address", "name": "thrower", "type": "address" },
99
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" },
100
+ {
101
+ "internalType": "uint256",
102
+ "name": "setCollateralTo",
103
+ "type": "uint256"
104
+ }
105
+ ],
106
+ "name": "FullyClosingWithNonZeroSetCollateral",
107
+ "type": "error"
108
+ },
109
+ {
110
+ "inputs": [
111
+ { "internalType": "address", "name": "thrower", "type": "address" },
112
+ {
113
+ "components": [
114
+ {
115
+ "internalType": "uint256",
116
+ "name": "penaltyRatio",
117
+ "type": "uint256"
118
+ },
119
+ {
120
+ "internalType": "uint256",
121
+ "name": "liquidatorFeeRatio",
122
+ "type": "uint256"
123
+ },
124
+ {
125
+ "internalType": "uint256",
126
+ "name": "smFeeRatio",
127
+ "type": "uint256"
128
+ },
129
+ {
130
+ "internalType": "uint256",
131
+ "name": "minLiquidationFee",
132
+ "type": "uint256"
133
+ }
134
+ ],
135
+ "internalType": "struct OptionToken.PartialCollateralParameters",
136
+ "name": "partialCollatParams",
137
+ "type": "tuple"
138
+ }
139
+ ],
140
+ "name": "InvalidPartialCollateralParameters",
141
+ "type": "error"
142
+ },
143
+ {
144
+ "inputs": [
145
+ { "internalType": "address", "name": "thrower", "type": "address" },
146
+ {
147
+ "internalType": "uint256",
148
+ "name": "originalPositionAmount",
149
+ "type": "uint256"
150
+ },
151
+ { "internalType": "uint256", "name": "splitAmount", "type": "uint256" }
152
+ ],
153
+ "name": "InvalidSplitAmount",
154
+ "type": "error"
155
+ },
156
+ {
157
+ "inputs": [
158
+ { "internalType": "address", "name": "thrower", "type": "address" },
159
+ { "internalType": "address", "name": "caller", "type": "address" },
160
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" }
161
+ ],
162
+ "name": "MergingUnapprovedPosition",
163
+ "type": "error"
164
+ },
165
+ {
166
+ "inputs": [
167
+ { "internalType": "address", "name": "thrower", "type": "address" }
168
+ ],
169
+ "name": "MustMergeTwoOrMorePositions",
170
+ "type": "error"
171
+ },
172
+ {
173
+ "inputs": [
174
+ { "internalType": "address", "name": "thrower", "type": "address" },
175
+ { "internalType": "address", "name": "caller", "type": "address" },
176
+ {
177
+ "internalType": "address",
178
+ "name": "nominatedOwner",
179
+ "type": "address"
180
+ }
181
+ ],
182
+ "name": "OnlyNominatedOwner",
183
+ "type": "error"
184
+ },
185
+ {
186
+ "inputs": [
187
+ { "internalType": "address", "name": "thrower", "type": "address" },
188
+ { "internalType": "address", "name": "caller", "type": "address" },
189
+ { "internalType": "address", "name": "optionMarket", "type": "address" }
190
+ ],
191
+ "name": "OnlyOptionMarket",
192
+ "type": "error"
193
+ },
194
+ {
195
+ "inputs": [
196
+ { "internalType": "address", "name": "thrower", "type": "address" },
197
+ { "internalType": "address", "name": "caller", "type": "address" },
198
+ { "internalType": "address", "name": "owner", "type": "address" }
199
+ ],
200
+ "name": "OnlyOwner",
201
+ "type": "error"
202
+ },
203
+ {
204
+ "inputs": [
205
+ { "internalType": "address", "name": "thrower", "type": "address" },
206
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" },
207
+ { "internalType": "address", "name": "trader", "type": "address" },
208
+ { "internalType": "address", "name": "owner", "type": "address" }
209
+ ],
210
+ "name": "OnlyOwnerCanAdjustPosition",
211
+ "type": "error"
212
+ },
213
+ {
214
+ "inputs": [
215
+ { "internalType": "address", "name": "thrower", "type": "address" },
216
+ { "internalType": "address", "name": "caller", "type": "address" },
217
+ {
218
+ "internalType": "address",
219
+ "name": "shortCollateral",
220
+ "type": "address"
221
+ }
222
+ ],
223
+ "name": "OnlyShortCollateral",
224
+ "type": "error"
225
+ },
226
+ {
227
+ "inputs": [
228
+ { "internalType": "address", "name": "thrower", "type": "address" },
229
+ {
230
+ "components": [
231
+ {
232
+ "internalType": "uint256",
233
+ "name": "positionId",
234
+ "type": "uint256"
235
+ },
236
+ {
237
+ "internalType": "uint256",
238
+ "name": "strikeId",
239
+ "type": "uint256"
240
+ },
241
+ {
242
+ "internalType": "enum OptionMarket.OptionType",
243
+ "name": "optionType",
244
+ "type": "uint8"
245
+ },
246
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
247
+ {
248
+ "internalType": "uint256",
249
+ "name": "collateral",
250
+ "type": "uint256"
251
+ },
252
+ {
253
+ "internalType": "enum OptionToken.PositionState",
254
+ "name": "state",
255
+ "type": "uint8"
256
+ }
257
+ ],
258
+ "internalType": "struct OptionToken.OptionPosition",
259
+ "name": "firstPosition",
260
+ "type": "tuple"
261
+ },
262
+ {
263
+ "components": [
264
+ {
265
+ "internalType": "uint256",
266
+ "name": "positionId",
267
+ "type": "uint256"
268
+ },
269
+ {
270
+ "internalType": "uint256",
271
+ "name": "strikeId",
272
+ "type": "uint256"
273
+ },
274
+ {
275
+ "internalType": "enum OptionMarket.OptionType",
276
+ "name": "optionType",
277
+ "type": "uint8"
278
+ },
279
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
280
+ {
281
+ "internalType": "uint256",
282
+ "name": "collateral",
283
+ "type": "uint256"
284
+ },
285
+ {
286
+ "internalType": "enum OptionToken.PositionState",
287
+ "name": "state",
288
+ "type": "uint8"
289
+ }
290
+ ],
291
+ "internalType": "struct OptionToken.OptionPosition",
292
+ "name": "nextPosition",
293
+ "type": "tuple"
294
+ },
295
+ { "internalType": "bool", "name": "ownerMismatch", "type": "bool" },
296
+ { "internalType": "bool", "name": "strikeMismatch", "type": "bool" },
297
+ {
298
+ "internalType": "bool",
299
+ "name": "optionTypeMismatch",
300
+ "type": "bool"
301
+ },
302
+ {
303
+ "internalType": "bool",
304
+ "name": "duplicatePositionId",
305
+ "type": "bool"
306
+ }
307
+ ],
308
+ "name": "PositionMismatchWhenMerging",
309
+ "type": "error"
310
+ },
311
+ {
312
+ "inputs": [
313
+ { "internalType": "address", "name": "thrower", "type": "address" },
314
+ {
315
+ "components": [
316
+ {
317
+ "internalType": "uint256",
318
+ "name": "positionId",
319
+ "type": "uint256"
320
+ },
321
+ {
322
+ "internalType": "uint256",
323
+ "name": "strikeId",
324
+ "type": "uint256"
325
+ },
326
+ {
327
+ "internalType": "enum OptionMarket.OptionType",
328
+ "name": "optionType",
329
+ "type": "uint8"
330
+ },
331
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
332
+ {
333
+ "internalType": "uint256",
334
+ "name": "collateral",
335
+ "type": "uint256"
336
+ },
337
+ {
338
+ "internalType": "enum OptionToken.PositionState",
339
+ "name": "state",
340
+ "type": "uint8"
341
+ }
342
+ ],
343
+ "internalType": "struct OptionToken.OptionPosition",
344
+ "name": "position",
345
+ "type": "tuple"
346
+ },
347
+ { "internalType": "uint256", "name": "spotPrice", "type": "uint256" }
348
+ ],
349
+ "name": "PositionNotLiquidatable",
350
+ "type": "error"
351
+ },
352
+ {
353
+ "inputs": [
354
+ { "internalType": "address", "name": "thrower", "type": "address" },
355
+ {
356
+ "components": [
357
+ {
358
+ "internalType": "uint256",
359
+ "name": "positionId",
360
+ "type": "uint256"
361
+ },
362
+ {
363
+ "internalType": "uint256",
364
+ "name": "strikeId",
365
+ "type": "uint256"
366
+ },
367
+ {
368
+ "internalType": "enum OptionMarket.OptionType",
369
+ "name": "optionType",
370
+ "type": "uint8"
371
+ },
372
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
373
+ {
374
+ "internalType": "uint256",
375
+ "name": "collateral",
376
+ "type": "uint256"
377
+ },
378
+ {
379
+ "internalType": "enum OptionToken.PositionState",
380
+ "name": "state",
381
+ "type": "uint8"
382
+ }
383
+ ],
384
+ "internalType": "struct OptionToken.OptionPosition",
385
+ "name": "position",
386
+ "type": "tuple"
387
+ },
388
+ { "internalType": "uint256", "name": "spotPrice", "type": "uint256" }
389
+ ],
390
+ "name": "ResultingNewPositionLiquidatable",
391
+ "type": "error"
392
+ },
393
+ {
394
+ "inputs": [
395
+ { "internalType": "address", "name": "thrower", "type": "address" },
396
+ {
397
+ "components": [
398
+ {
399
+ "internalType": "uint256",
400
+ "name": "positionId",
401
+ "type": "uint256"
402
+ },
403
+ {
404
+ "internalType": "uint256",
405
+ "name": "strikeId",
406
+ "type": "uint256"
407
+ },
408
+ {
409
+ "internalType": "enum OptionMarket.OptionType",
410
+ "name": "optionType",
411
+ "type": "uint8"
412
+ },
413
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
414
+ {
415
+ "internalType": "uint256",
416
+ "name": "collateral",
417
+ "type": "uint256"
418
+ },
419
+ {
420
+ "internalType": "enum OptionToken.PositionState",
421
+ "name": "state",
422
+ "type": "uint8"
423
+ }
424
+ ],
425
+ "internalType": "struct OptionToken.OptionPosition",
426
+ "name": "position",
427
+ "type": "tuple"
428
+ },
429
+ { "internalType": "uint256", "name": "spotPrice", "type": "uint256" }
430
+ ],
431
+ "name": "ResultingOriginalPositionLiquidatable",
432
+ "type": "error"
433
+ },
434
+ {
435
+ "inputs": [
436
+ { "internalType": "address", "name": "thrower", "type": "address" },
437
+ { "internalType": "address", "name": "caller", "type": "address" },
438
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" }
439
+ ],
440
+ "name": "SplittingUnapprovedPosition",
441
+ "type": "error"
442
+ },
443
+ {
444
+ "inputs": [
445
+ { "internalType": "address", "name": "thrower", "type": "address" },
446
+ { "internalType": "uint256", "name": "strikeId", "type": "uint256" }
447
+ ],
448
+ "name": "StrikeIsSettled",
449
+ "type": "error"
450
+ },
451
+ {
452
+ "anonymous": false,
453
+ "inputs": [
454
+ {
455
+ "indexed": true,
456
+ "internalType": "address",
457
+ "name": "owner",
458
+ "type": "address"
459
+ },
460
+ {
461
+ "indexed": true,
462
+ "internalType": "address",
463
+ "name": "approved",
464
+ "type": "address"
465
+ },
466
+ {
467
+ "indexed": true,
468
+ "internalType": "uint256",
469
+ "name": "tokenId",
470
+ "type": "uint256"
471
+ }
472
+ ],
473
+ "name": "Approval",
474
+ "type": "event"
475
+ },
476
+ {
477
+ "anonymous": false,
478
+ "inputs": [
479
+ {
480
+ "indexed": true,
481
+ "internalType": "address",
482
+ "name": "owner",
483
+ "type": "address"
484
+ },
485
+ {
486
+ "indexed": true,
487
+ "internalType": "address",
488
+ "name": "operator",
489
+ "type": "address"
490
+ },
491
+ {
492
+ "indexed": false,
493
+ "internalType": "bool",
494
+ "name": "approved",
495
+ "type": "bool"
496
+ }
497
+ ],
498
+ "name": "ApprovalForAll",
499
+ "type": "event"
500
+ },
501
+ {
502
+ "anonymous": false,
503
+ "inputs": [
504
+ {
505
+ "indexed": false,
506
+ "internalType": "address",
507
+ "name": "oldOwner",
508
+ "type": "address"
509
+ },
510
+ {
511
+ "indexed": false,
512
+ "internalType": "address",
513
+ "name": "newOwner",
514
+ "type": "address"
515
+ }
516
+ ],
517
+ "name": "OwnerChanged",
518
+ "type": "event"
519
+ },
520
+ {
521
+ "anonymous": false,
522
+ "inputs": [
523
+ {
524
+ "indexed": false,
525
+ "internalType": "address",
526
+ "name": "newOwner",
527
+ "type": "address"
528
+ }
529
+ ],
530
+ "name": "OwnerNominated",
531
+ "type": "event"
532
+ },
533
+ {
534
+ "anonymous": false,
535
+ "inputs": [
536
+ {
537
+ "components": [
538
+ {
539
+ "internalType": "uint256",
540
+ "name": "penaltyRatio",
541
+ "type": "uint256"
542
+ },
543
+ {
544
+ "internalType": "uint256",
545
+ "name": "liquidatorFeeRatio",
546
+ "type": "uint256"
547
+ },
548
+ {
549
+ "internalType": "uint256",
550
+ "name": "smFeeRatio",
551
+ "type": "uint256"
552
+ },
553
+ {
554
+ "internalType": "uint256",
555
+ "name": "minLiquidationFee",
556
+ "type": "uint256"
557
+ }
558
+ ],
559
+ "indexed": false,
560
+ "internalType": "struct OptionToken.PartialCollateralParameters",
561
+ "name": "partialCollateralParams",
562
+ "type": "tuple"
563
+ }
564
+ ],
565
+ "name": "PartialCollateralParamsSet",
566
+ "type": "event"
567
+ },
568
+ {
569
+ "anonymous": false,
570
+ "inputs": [
571
+ {
572
+ "indexed": true,
573
+ "internalType": "uint256",
574
+ "name": "positionId",
575
+ "type": "uint256"
576
+ },
577
+ {
578
+ "indexed": true,
579
+ "internalType": "address",
580
+ "name": "owner",
581
+ "type": "address"
582
+ },
583
+ {
584
+ "indexed": true,
585
+ "internalType": "enum OptionToken.PositionUpdatedType",
586
+ "name": "updatedType",
587
+ "type": "uint8"
588
+ },
589
+ {
590
+ "components": [
591
+ {
592
+ "internalType": "uint256",
593
+ "name": "positionId",
594
+ "type": "uint256"
595
+ },
596
+ {
597
+ "internalType": "uint256",
598
+ "name": "strikeId",
599
+ "type": "uint256"
600
+ },
601
+ {
602
+ "internalType": "enum OptionMarket.OptionType",
603
+ "name": "optionType",
604
+ "type": "uint8"
605
+ },
606
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
607
+ {
608
+ "internalType": "uint256",
609
+ "name": "collateral",
610
+ "type": "uint256"
611
+ },
612
+ {
613
+ "internalType": "enum OptionToken.PositionState",
614
+ "name": "state",
615
+ "type": "uint8"
616
+ }
617
+ ],
618
+ "indexed": false,
619
+ "internalType": "struct OptionToken.OptionPosition",
620
+ "name": "position",
621
+ "type": "tuple"
622
+ },
623
+ {
624
+ "indexed": false,
625
+ "internalType": "uint256",
626
+ "name": "timestamp",
627
+ "type": "uint256"
628
+ }
629
+ ],
630
+ "name": "PositionUpdated",
631
+ "type": "event"
632
+ },
633
+ {
634
+ "anonymous": false,
635
+ "inputs": [
636
+ {
637
+ "indexed": true,
638
+ "internalType": "address",
639
+ "name": "from",
640
+ "type": "address"
641
+ },
642
+ {
643
+ "indexed": true,
644
+ "internalType": "address",
645
+ "name": "to",
646
+ "type": "address"
647
+ },
648
+ {
649
+ "indexed": true,
650
+ "internalType": "uint256",
651
+ "name": "tokenId",
652
+ "type": "uint256"
653
+ }
654
+ ],
655
+ "name": "Transfer",
656
+ "type": "event"
657
+ },
658
+ {
659
+ "anonymous": false,
660
+ "inputs": [
661
+ {
662
+ "indexed": false,
663
+ "internalType": "string",
664
+ "name": "URI",
665
+ "type": "string"
666
+ }
667
+ ],
668
+ "name": "URISet",
669
+ "type": "event"
670
+ },
671
+ {
672
+ "inputs": [],
673
+ "name": "acceptOwnership",
674
+ "outputs": [],
675
+ "stateMutability": "nonpayable",
676
+ "type": "function"
677
+ },
678
+ {
679
+ "inputs": [
680
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" },
681
+ {
682
+ "internalType": "uint256",
683
+ "name": "amountCollateral",
684
+ "type": "uint256"
685
+ }
686
+ ],
687
+ "name": "addCollateral",
688
+ "outputs": [
689
+ {
690
+ "internalType": "enum OptionMarket.OptionType",
691
+ "name": "optionType",
692
+ "type": "uint8"
693
+ }
694
+ ],
695
+ "stateMutability": "nonpayable",
696
+ "type": "function"
697
+ },
698
+ {
699
+ "inputs": [
700
+ {
701
+ "components": [
702
+ { "internalType": "bool", "name": "isBuy", "type": "bool" },
703
+ { "internalType": "bool", "name": "isForceClose", "type": "bool" },
704
+ {
705
+ "internalType": "enum OptionMarket.TradeDirection",
706
+ "name": "tradeDirection",
707
+ "type": "uint8"
708
+ },
709
+ {
710
+ "internalType": "enum OptionMarket.OptionType",
711
+ "name": "optionType",
712
+ "type": "uint8"
713
+ },
714
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
715
+ { "internalType": "uint256", "name": "expiry", "type": "uint256" },
716
+ {
717
+ "internalType": "uint256",
718
+ "name": "strikePrice",
719
+ "type": "uint256"
720
+ },
721
+ {
722
+ "components": [
723
+ {
724
+ "internalType": "uint256",
725
+ "name": "freeLiquidity",
726
+ "type": "uint256"
727
+ },
728
+ {
729
+ "internalType": "uint256",
730
+ "name": "burnableLiquidity",
731
+ "type": "uint256"
732
+ },
733
+ {
734
+ "internalType": "uint256",
735
+ "name": "usedCollatLiquidity",
736
+ "type": "uint256"
737
+ },
738
+ {
739
+ "internalType": "uint256",
740
+ "name": "pendingDeltaLiquidity",
741
+ "type": "uint256"
742
+ },
743
+ {
744
+ "internalType": "uint256",
745
+ "name": "usedDeltaLiquidity",
746
+ "type": "uint256"
747
+ },
748
+ { "internalType": "uint256", "name": "NAV", "type": "uint256" }
749
+ ],
750
+ "internalType": "struct LiquidityPool.Liquidity",
751
+ "name": "liquidity",
752
+ "type": "tuple"
753
+ },
754
+ {
755
+ "components": [
756
+ {
757
+ "internalType": "uint256",
758
+ "name": "spotPrice",
759
+ "type": "uint256"
760
+ },
761
+ {
762
+ "internalType": "bytes32",
763
+ "name": "quoteKey",
764
+ "type": "bytes32"
765
+ },
766
+ {
767
+ "internalType": "bytes32",
768
+ "name": "baseKey",
769
+ "type": "bytes32"
770
+ },
771
+ {
772
+ "internalType": "uint256",
773
+ "name": "quoteBaseFeeRate",
774
+ "type": "uint256"
775
+ },
776
+ {
777
+ "internalType": "uint256",
778
+ "name": "baseQuoteFeeRate",
779
+ "type": "uint256"
780
+ }
781
+ ],
782
+ "internalType": "struct SynthetixAdapter.ExchangeParams",
783
+ "name": "exchangeParams",
784
+ "type": "tuple"
785
+ }
786
+ ],
787
+ "internalType": "struct OptionMarket.TradeParameters",
788
+ "name": "trade",
789
+ "type": "tuple"
790
+ },
791
+ { "internalType": "uint256", "name": "strikeId", "type": "uint256" },
792
+ { "internalType": "address", "name": "trader", "type": "address" },
793
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" },
794
+ { "internalType": "uint256", "name": "optionCost", "type": "uint256" },
795
+ {
796
+ "internalType": "uint256",
797
+ "name": "setCollateralTo",
798
+ "type": "uint256"
799
+ },
800
+ { "internalType": "bool", "name": "isOpen", "type": "bool" }
801
+ ],
802
+ "name": "adjustPosition",
803
+ "outputs": [
804
+ { "internalType": "uint256", "name": "", "type": "uint256" },
805
+ {
806
+ "internalType": "int256",
807
+ "name": "pendingCollateral",
808
+ "type": "int256"
809
+ }
810
+ ],
811
+ "stateMutability": "nonpayable",
812
+ "type": "function"
813
+ },
814
+ {
815
+ "inputs": [
816
+ { "internalType": "address", "name": "to", "type": "address" },
817
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
818
+ ],
819
+ "name": "approve",
820
+ "outputs": [],
821
+ "stateMutability": "nonpayable",
822
+ "type": "function"
823
+ },
824
+ {
825
+ "inputs": [
826
+ { "internalType": "address", "name": "owner", "type": "address" }
827
+ ],
828
+ "name": "balanceOf",
829
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
830
+ "stateMutability": "view",
831
+ "type": "function"
832
+ },
833
+ {
834
+ "inputs": [],
835
+ "name": "baseURI",
836
+ "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
837
+ "stateMutability": "view",
838
+ "type": "function"
839
+ },
840
+ {
841
+ "inputs": [
842
+ {
843
+ "components": [
844
+ {
845
+ "internalType": "uint256",
846
+ "name": "positionId",
847
+ "type": "uint256"
848
+ },
849
+ {
850
+ "internalType": "uint256",
851
+ "name": "strikeId",
852
+ "type": "uint256"
853
+ },
854
+ {
855
+ "internalType": "enum OptionMarket.OptionType",
856
+ "name": "optionType",
857
+ "type": "uint8"
858
+ },
859
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
860
+ {
861
+ "internalType": "uint256",
862
+ "name": "collateral",
863
+ "type": "uint256"
864
+ },
865
+ {
866
+ "internalType": "enum OptionToken.PositionState",
867
+ "name": "state",
868
+ "type": "uint8"
869
+ }
870
+ ],
871
+ "internalType": "struct OptionToken.OptionPosition",
872
+ "name": "position",
873
+ "type": "tuple"
874
+ },
875
+ { "internalType": "uint256", "name": "expiry", "type": "uint256" },
876
+ { "internalType": "uint256", "name": "strikePrice", "type": "uint256" },
877
+ { "internalType": "uint256", "name": "spotPrice", "type": "uint256" }
878
+ ],
879
+ "name": "canLiquidate",
880
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
881
+ "stateMutability": "view",
882
+ "type": "function"
883
+ },
884
+ {
885
+ "inputs": [
886
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
887
+ ],
888
+ "name": "getApproved",
889
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
890
+ "stateMutability": "view",
891
+ "type": "function"
892
+ },
893
+ {
894
+ "inputs": [
895
+ { "internalType": "uint256", "name": "gwavPremium", "type": "uint256" },
896
+ {
897
+ "internalType": "uint256",
898
+ "name": "userPositionCollateral",
899
+ "type": "uint256"
900
+ },
901
+ {
902
+ "internalType": "uint256",
903
+ "name": "convertedMinLiquidationFee",
904
+ "type": "uint256"
905
+ },
906
+ {
907
+ "internalType": "uint256",
908
+ "name": "insolvencyMultiplier",
909
+ "type": "uint256"
910
+ }
911
+ ],
912
+ "name": "getLiquidationFees",
913
+ "outputs": [
914
+ {
915
+ "components": [
916
+ {
917
+ "internalType": "uint256",
918
+ "name": "returnCollateral",
919
+ "type": "uint256"
920
+ },
921
+ {
922
+ "internalType": "uint256",
923
+ "name": "lpPremiums",
924
+ "type": "uint256"
925
+ },
926
+ { "internalType": "uint256", "name": "lpFee", "type": "uint256" },
927
+ {
928
+ "internalType": "uint256",
929
+ "name": "liquidatorFee",
930
+ "type": "uint256"
931
+ },
932
+ { "internalType": "uint256", "name": "smFee", "type": "uint256" },
933
+ {
934
+ "internalType": "uint256",
935
+ "name": "insolventAmount",
936
+ "type": "uint256"
937
+ }
938
+ ],
939
+ "internalType": "struct OptionToken.LiquidationFees",
940
+ "name": "liquidationFees",
941
+ "type": "tuple"
942
+ }
943
+ ],
944
+ "stateMutability": "view",
945
+ "type": "function"
946
+ },
947
+ {
948
+ "inputs": [
949
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" }
950
+ ],
951
+ "name": "getOptionPosition",
952
+ "outputs": [
953
+ {
954
+ "components": [
955
+ {
956
+ "internalType": "uint256",
957
+ "name": "positionId",
958
+ "type": "uint256"
959
+ },
960
+ {
961
+ "internalType": "uint256",
962
+ "name": "strikeId",
963
+ "type": "uint256"
964
+ },
965
+ {
966
+ "internalType": "enum OptionMarket.OptionType",
967
+ "name": "optionType",
968
+ "type": "uint8"
969
+ },
970
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
971
+ {
972
+ "internalType": "uint256",
973
+ "name": "collateral",
974
+ "type": "uint256"
975
+ },
976
+ {
977
+ "internalType": "enum OptionToken.PositionState",
978
+ "name": "state",
979
+ "type": "uint8"
980
+ }
981
+ ],
982
+ "internalType": "struct OptionToken.OptionPosition",
983
+ "name": "",
984
+ "type": "tuple"
985
+ }
986
+ ],
987
+ "stateMutability": "view",
988
+ "type": "function"
989
+ },
990
+ {
991
+ "inputs": [
992
+ {
993
+ "internalType": "uint256[]",
994
+ "name": "positionIds",
995
+ "type": "uint256[]"
996
+ }
997
+ ],
998
+ "name": "getOptionPositions",
999
+ "outputs": [
1000
+ {
1001
+ "components": [
1002
+ {
1003
+ "internalType": "uint256",
1004
+ "name": "positionId",
1005
+ "type": "uint256"
1006
+ },
1007
+ {
1008
+ "internalType": "uint256",
1009
+ "name": "strikeId",
1010
+ "type": "uint256"
1011
+ },
1012
+ {
1013
+ "internalType": "enum OptionMarket.OptionType",
1014
+ "name": "optionType",
1015
+ "type": "uint8"
1016
+ },
1017
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
1018
+ {
1019
+ "internalType": "uint256",
1020
+ "name": "collateral",
1021
+ "type": "uint256"
1022
+ },
1023
+ {
1024
+ "internalType": "enum OptionToken.PositionState",
1025
+ "name": "state",
1026
+ "type": "uint8"
1027
+ }
1028
+ ],
1029
+ "internalType": "struct OptionToken.OptionPosition[]",
1030
+ "name": "",
1031
+ "type": "tuple[]"
1032
+ }
1033
+ ],
1034
+ "stateMutability": "view",
1035
+ "type": "function"
1036
+ },
1037
+ {
1038
+ "inputs": [
1039
+ { "internalType": "address", "name": "target", "type": "address" }
1040
+ ],
1041
+ "name": "getOwnerPositions",
1042
+ "outputs": [
1043
+ {
1044
+ "components": [
1045
+ {
1046
+ "internalType": "uint256",
1047
+ "name": "positionId",
1048
+ "type": "uint256"
1049
+ },
1050
+ {
1051
+ "internalType": "uint256",
1052
+ "name": "strikeId",
1053
+ "type": "uint256"
1054
+ },
1055
+ {
1056
+ "internalType": "enum OptionMarket.OptionType",
1057
+ "name": "optionType",
1058
+ "type": "uint8"
1059
+ },
1060
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
1061
+ {
1062
+ "internalType": "uint256",
1063
+ "name": "collateral",
1064
+ "type": "uint256"
1065
+ },
1066
+ {
1067
+ "internalType": "enum OptionToken.PositionState",
1068
+ "name": "state",
1069
+ "type": "uint8"
1070
+ }
1071
+ ],
1072
+ "internalType": "struct OptionToken.OptionPosition[]",
1073
+ "name": "",
1074
+ "type": "tuple[]"
1075
+ }
1076
+ ],
1077
+ "stateMutability": "view",
1078
+ "type": "function"
1079
+ },
1080
+ {
1081
+ "inputs": [],
1082
+ "name": "getPartialCollatParams",
1083
+ "outputs": [
1084
+ {
1085
+ "components": [
1086
+ {
1087
+ "internalType": "uint256",
1088
+ "name": "penaltyRatio",
1089
+ "type": "uint256"
1090
+ },
1091
+ {
1092
+ "internalType": "uint256",
1093
+ "name": "liquidatorFeeRatio",
1094
+ "type": "uint256"
1095
+ },
1096
+ {
1097
+ "internalType": "uint256",
1098
+ "name": "smFeeRatio",
1099
+ "type": "uint256"
1100
+ },
1101
+ {
1102
+ "internalType": "uint256",
1103
+ "name": "minLiquidationFee",
1104
+ "type": "uint256"
1105
+ }
1106
+ ],
1107
+ "internalType": "struct OptionToken.PartialCollateralParameters",
1108
+ "name": "",
1109
+ "type": "tuple"
1110
+ }
1111
+ ],
1112
+ "stateMutability": "view",
1113
+ "type": "function"
1114
+ },
1115
+ {
1116
+ "inputs": [
1117
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" }
1118
+ ],
1119
+ "name": "getPositionState",
1120
+ "outputs": [
1121
+ {
1122
+ "internalType": "enum OptionToken.PositionState",
1123
+ "name": "",
1124
+ "type": "uint8"
1125
+ }
1126
+ ],
1127
+ "stateMutability": "view",
1128
+ "type": "function"
1129
+ },
1130
+ {
1131
+ "inputs": [
1132
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" }
1133
+ ],
1134
+ "name": "getPositionWithOwner",
1135
+ "outputs": [
1136
+ {
1137
+ "components": [
1138
+ {
1139
+ "internalType": "uint256",
1140
+ "name": "positionId",
1141
+ "type": "uint256"
1142
+ },
1143
+ {
1144
+ "internalType": "uint256",
1145
+ "name": "strikeId",
1146
+ "type": "uint256"
1147
+ },
1148
+ {
1149
+ "internalType": "enum OptionMarket.OptionType",
1150
+ "name": "optionType",
1151
+ "type": "uint8"
1152
+ },
1153
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
1154
+ {
1155
+ "internalType": "uint256",
1156
+ "name": "collateral",
1157
+ "type": "uint256"
1158
+ },
1159
+ {
1160
+ "internalType": "enum OptionToken.PositionState",
1161
+ "name": "state",
1162
+ "type": "uint8"
1163
+ },
1164
+ { "internalType": "address", "name": "owner", "type": "address" }
1165
+ ],
1166
+ "internalType": "struct OptionToken.PositionWithOwner",
1167
+ "name": "",
1168
+ "type": "tuple"
1169
+ }
1170
+ ],
1171
+ "stateMutability": "view",
1172
+ "type": "function"
1173
+ },
1174
+ {
1175
+ "inputs": [
1176
+ {
1177
+ "internalType": "uint256[]",
1178
+ "name": "positionIds",
1179
+ "type": "uint256[]"
1180
+ }
1181
+ ],
1182
+ "name": "getPositionsWithOwner",
1183
+ "outputs": [
1184
+ {
1185
+ "components": [
1186
+ {
1187
+ "internalType": "uint256",
1188
+ "name": "positionId",
1189
+ "type": "uint256"
1190
+ },
1191
+ {
1192
+ "internalType": "uint256",
1193
+ "name": "strikeId",
1194
+ "type": "uint256"
1195
+ },
1196
+ {
1197
+ "internalType": "enum OptionMarket.OptionType",
1198
+ "name": "optionType",
1199
+ "type": "uint8"
1200
+ },
1201
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
1202
+ {
1203
+ "internalType": "uint256",
1204
+ "name": "collateral",
1205
+ "type": "uint256"
1206
+ },
1207
+ {
1208
+ "internalType": "enum OptionToken.PositionState",
1209
+ "name": "state",
1210
+ "type": "uint8"
1211
+ },
1212
+ { "internalType": "address", "name": "owner", "type": "address" }
1213
+ ],
1214
+ "internalType": "struct OptionToken.PositionWithOwner[]",
1215
+ "name": "",
1216
+ "type": "tuple[]"
1217
+ }
1218
+ ],
1219
+ "stateMutability": "view",
1220
+ "type": "function"
1221
+ },
1222
+ {
1223
+ "inputs": [
1224
+ {
1225
+ "internalType": "contract OptionMarket",
1226
+ "name": "_optionMarket",
1227
+ "type": "address"
1228
+ },
1229
+ {
1230
+ "internalType": "contract OptionGreekCache",
1231
+ "name": "_greekCache",
1232
+ "type": "address"
1233
+ },
1234
+ {
1235
+ "internalType": "address",
1236
+ "name": "_shortCollateral",
1237
+ "type": "address"
1238
+ },
1239
+ {
1240
+ "internalType": "contract SynthetixAdapter",
1241
+ "name": "_synthetixAdapter",
1242
+ "type": "address"
1243
+ }
1244
+ ],
1245
+ "name": "init",
1246
+ "outputs": [],
1247
+ "stateMutability": "nonpayable",
1248
+ "type": "function"
1249
+ },
1250
+ {
1251
+ "inputs": [
1252
+ { "internalType": "address", "name": "owner", "type": "address" },
1253
+ { "internalType": "address", "name": "operator", "type": "address" }
1254
+ ],
1255
+ "name": "isApprovedForAll",
1256
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
1257
+ "stateMutability": "view",
1258
+ "type": "function"
1259
+ },
1260
+ {
1261
+ "inputs": [
1262
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" },
1263
+ {
1264
+ "components": [
1265
+ { "internalType": "bool", "name": "isBuy", "type": "bool" },
1266
+ { "internalType": "bool", "name": "isForceClose", "type": "bool" },
1267
+ {
1268
+ "internalType": "enum OptionMarket.TradeDirection",
1269
+ "name": "tradeDirection",
1270
+ "type": "uint8"
1271
+ },
1272
+ {
1273
+ "internalType": "enum OptionMarket.OptionType",
1274
+ "name": "optionType",
1275
+ "type": "uint8"
1276
+ },
1277
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
1278
+ { "internalType": "uint256", "name": "expiry", "type": "uint256" },
1279
+ {
1280
+ "internalType": "uint256",
1281
+ "name": "strikePrice",
1282
+ "type": "uint256"
1283
+ },
1284
+ {
1285
+ "components": [
1286
+ {
1287
+ "internalType": "uint256",
1288
+ "name": "freeLiquidity",
1289
+ "type": "uint256"
1290
+ },
1291
+ {
1292
+ "internalType": "uint256",
1293
+ "name": "burnableLiquidity",
1294
+ "type": "uint256"
1295
+ },
1296
+ {
1297
+ "internalType": "uint256",
1298
+ "name": "usedCollatLiquidity",
1299
+ "type": "uint256"
1300
+ },
1301
+ {
1302
+ "internalType": "uint256",
1303
+ "name": "pendingDeltaLiquidity",
1304
+ "type": "uint256"
1305
+ },
1306
+ {
1307
+ "internalType": "uint256",
1308
+ "name": "usedDeltaLiquidity",
1309
+ "type": "uint256"
1310
+ },
1311
+ { "internalType": "uint256", "name": "NAV", "type": "uint256" }
1312
+ ],
1313
+ "internalType": "struct LiquidityPool.Liquidity",
1314
+ "name": "liquidity",
1315
+ "type": "tuple"
1316
+ },
1317
+ {
1318
+ "components": [
1319
+ {
1320
+ "internalType": "uint256",
1321
+ "name": "spotPrice",
1322
+ "type": "uint256"
1323
+ },
1324
+ {
1325
+ "internalType": "bytes32",
1326
+ "name": "quoteKey",
1327
+ "type": "bytes32"
1328
+ },
1329
+ {
1330
+ "internalType": "bytes32",
1331
+ "name": "baseKey",
1332
+ "type": "bytes32"
1333
+ },
1334
+ {
1335
+ "internalType": "uint256",
1336
+ "name": "quoteBaseFeeRate",
1337
+ "type": "uint256"
1338
+ },
1339
+ {
1340
+ "internalType": "uint256",
1341
+ "name": "baseQuoteFeeRate",
1342
+ "type": "uint256"
1343
+ }
1344
+ ],
1345
+ "internalType": "struct SynthetixAdapter.ExchangeParams",
1346
+ "name": "exchangeParams",
1347
+ "type": "tuple"
1348
+ }
1349
+ ],
1350
+ "internalType": "struct OptionMarket.TradeParameters",
1351
+ "name": "trade",
1352
+ "type": "tuple"
1353
+ },
1354
+ { "internalType": "uint256", "name": "totalCost", "type": "uint256" }
1355
+ ],
1356
+ "name": "liquidate",
1357
+ "outputs": [
1358
+ {
1359
+ "components": [
1360
+ {
1361
+ "internalType": "uint256",
1362
+ "name": "returnCollateral",
1363
+ "type": "uint256"
1364
+ },
1365
+ {
1366
+ "internalType": "uint256",
1367
+ "name": "lpPremiums",
1368
+ "type": "uint256"
1369
+ },
1370
+ { "internalType": "uint256", "name": "lpFee", "type": "uint256" },
1371
+ {
1372
+ "internalType": "uint256",
1373
+ "name": "liquidatorFee",
1374
+ "type": "uint256"
1375
+ },
1376
+ { "internalType": "uint256", "name": "smFee", "type": "uint256" },
1377
+ {
1378
+ "internalType": "uint256",
1379
+ "name": "insolventAmount",
1380
+ "type": "uint256"
1381
+ }
1382
+ ],
1383
+ "internalType": "struct OptionToken.LiquidationFees",
1384
+ "name": "liquidationFees",
1385
+ "type": "tuple"
1386
+ }
1387
+ ],
1388
+ "stateMutability": "nonpayable",
1389
+ "type": "function"
1390
+ },
1391
+ {
1392
+ "inputs": [
1393
+ {
1394
+ "internalType": "uint256[]",
1395
+ "name": "positionIds",
1396
+ "type": "uint256[]"
1397
+ }
1398
+ ],
1399
+ "name": "merge",
1400
+ "outputs": [],
1401
+ "stateMutability": "nonpayable",
1402
+ "type": "function"
1403
+ },
1404
+ {
1405
+ "inputs": [],
1406
+ "name": "name",
1407
+ "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
1408
+ "stateMutability": "view",
1409
+ "type": "function"
1410
+ },
1411
+ {
1412
+ "inputs": [],
1413
+ "name": "nextId",
1414
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
1415
+ "stateMutability": "view",
1416
+ "type": "function"
1417
+ },
1418
+ {
1419
+ "inputs": [
1420
+ { "internalType": "address", "name": "_owner", "type": "address" }
1421
+ ],
1422
+ "name": "nominateNewOwner",
1423
+ "outputs": [],
1424
+ "stateMutability": "nonpayable",
1425
+ "type": "function"
1426
+ },
1427
+ {
1428
+ "inputs": [],
1429
+ "name": "nominatedOwner",
1430
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
1431
+ "stateMutability": "view",
1432
+ "type": "function"
1433
+ },
1434
+ {
1435
+ "inputs": [],
1436
+ "name": "owner",
1437
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
1438
+ "stateMutability": "view",
1439
+ "type": "function"
1440
+ },
1441
+ {
1442
+ "inputs": [
1443
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
1444
+ ],
1445
+ "name": "ownerOf",
1446
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
1447
+ "stateMutability": "view",
1448
+ "type": "function"
1449
+ },
1450
+ {
1451
+ "inputs": [],
1452
+ "name": "partialCollatParams",
1453
+ "outputs": [
1454
+ {
1455
+ "internalType": "uint256",
1456
+ "name": "penaltyRatio",
1457
+ "type": "uint256"
1458
+ },
1459
+ {
1460
+ "internalType": "uint256",
1461
+ "name": "liquidatorFeeRatio",
1462
+ "type": "uint256"
1463
+ },
1464
+ { "internalType": "uint256", "name": "smFeeRatio", "type": "uint256" },
1465
+ {
1466
+ "internalType": "uint256",
1467
+ "name": "minLiquidationFee",
1468
+ "type": "uint256"
1469
+ }
1470
+ ],
1471
+ "stateMutability": "view",
1472
+ "type": "function"
1473
+ },
1474
+ {
1475
+ "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
1476
+ "name": "positions",
1477
+ "outputs": [
1478
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" },
1479
+ { "internalType": "uint256", "name": "strikeId", "type": "uint256" },
1480
+ {
1481
+ "internalType": "enum OptionMarket.OptionType",
1482
+ "name": "optionType",
1483
+ "type": "uint8"
1484
+ },
1485
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
1486
+ { "internalType": "uint256", "name": "collateral", "type": "uint256" },
1487
+ {
1488
+ "internalType": "enum OptionToken.PositionState",
1489
+ "name": "state",
1490
+ "type": "uint8"
1491
+ }
1492
+ ],
1493
+ "stateMutability": "view",
1494
+ "type": "function"
1495
+ },
1496
+ {
1497
+ "inputs": [
1498
+ { "internalType": "address", "name": "from", "type": "address" },
1499
+ { "internalType": "address", "name": "to", "type": "address" },
1500
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
1501
+ ],
1502
+ "name": "safeTransferFrom",
1503
+ "outputs": [],
1504
+ "stateMutability": "nonpayable",
1505
+ "type": "function"
1506
+ },
1507
+ {
1508
+ "inputs": [
1509
+ { "internalType": "address", "name": "from", "type": "address" },
1510
+ { "internalType": "address", "name": "to", "type": "address" },
1511
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
1512
+ { "internalType": "bytes", "name": "_data", "type": "bytes" }
1513
+ ],
1514
+ "name": "safeTransferFrom",
1515
+ "outputs": [],
1516
+ "stateMutability": "nonpayable",
1517
+ "type": "function"
1518
+ },
1519
+ {
1520
+ "inputs": [
1521
+ { "internalType": "address", "name": "operator", "type": "address" },
1522
+ { "internalType": "bool", "name": "approved", "type": "bool" }
1523
+ ],
1524
+ "name": "setApprovalForAll",
1525
+ "outputs": [],
1526
+ "stateMutability": "nonpayable",
1527
+ "type": "function"
1528
+ },
1529
+ {
1530
+ "inputs": [
1531
+ {
1532
+ "components": [
1533
+ {
1534
+ "internalType": "uint256",
1535
+ "name": "penaltyRatio",
1536
+ "type": "uint256"
1537
+ },
1538
+ {
1539
+ "internalType": "uint256",
1540
+ "name": "liquidatorFeeRatio",
1541
+ "type": "uint256"
1542
+ },
1543
+ {
1544
+ "internalType": "uint256",
1545
+ "name": "smFeeRatio",
1546
+ "type": "uint256"
1547
+ },
1548
+ {
1549
+ "internalType": "uint256",
1550
+ "name": "minLiquidationFee",
1551
+ "type": "uint256"
1552
+ }
1553
+ ],
1554
+ "internalType": "struct OptionToken.PartialCollateralParameters",
1555
+ "name": "_partialCollatParams",
1556
+ "type": "tuple"
1557
+ }
1558
+ ],
1559
+ "name": "setPartialCollateralParams",
1560
+ "outputs": [],
1561
+ "stateMutability": "nonpayable",
1562
+ "type": "function"
1563
+ },
1564
+ {
1565
+ "inputs": [
1566
+ { "internalType": "string", "name": "newURI", "type": "string" }
1567
+ ],
1568
+ "name": "setURI",
1569
+ "outputs": [],
1570
+ "stateMutability": "nonpayable",
1571
+ "type": "function"
1572
+ },
1573
+ {
1574
+ "inputs": [
1575
+ {
1576
+ "internalType": "uint256[]",
1577
+ "name": "positionIds",
1578
+ "type": "uint256[]"
1579
+ }
1580
+ ],
1581
+ "name": "settlePositions",
1582
+ "outputs": [],
1583
+ "stateMutability": "nonpayable",
1584
+ "type": "function"
1585
+ },
1586
+ {
1587
+ "inputs": [
1588
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" },
1589
+ { "internalType": "uint256", "name": "newAmount", "type": "uint256" },
1590
+ {
1591
+ "internalType": "uint256",
1592
+ "name": "newCollateral",
1593
+ "type": "uint256"
1594
+ },
1595
+ { "internalType": "address", "name": "recipient", "type": "address" }
1596
+ ],
1597
+ "name": "split",
1598
+ "outputs": [
1599
+ {
1600
+ "internalType": "uint256",
1601
+ "name": "newPositionId",
1602
+ "type": "uint256"
1603
+ }
1604
+ ],
1605
+ "stateMutability": "nonpayable",
1606
+ "type": "function"
1607
+ },
1608
+ {
1609
+ "inputs": [
1610
+ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }
1611
+ ],
1612
+ "name": "supportsInterface",
1613
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
1614
+ "stateMutability": "view",
1615
+ "type": "function"
1616
+ },
1617
+ {
1618
+ "inputs": [],
1619
+ "name": "symbol",
1620
+ "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
1621
+ "stateMutability": "view",
1622
+ "type": "function"
1623
+ },
1624
+ {
1625
+ "inputs": [
1626
+ { "internalType": "uint256", "name": "index", "type": "uint256" }
1627
+ ],
1628
+ "name": "tokenByIndex",
1629
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
1630
+ "stateMutability": "view",
1631
+ "type": "function"
1632
+ },
1633
+ {
1634
+ "inputs": [
1635
+ { "internalType": "address", "name": "owner", "type": "address" },
1636
+ { "internalType": "uint256", "name": "index", "type": "uint256" }
1637
+ ],
1638
+ "name": "tokenOfOwnerByIndex",
1639
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
1640
+ "stateMutability": "view",
1641
+ "type": "function"
1642
+ },
1643
+ {
1644
+ "inputs": [
1645
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
1646
+ ],
1647
+ "name": "tokenURI",
1648
+ "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
1649
+ "stateMutability": "view",
1650
+ "type": "function"
1651
+ },
1652
+ {
1653
+ "inputs": [],
1654
+ "name": "totalSupply",
1655
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
1656
+ "stateMutability": "view",
1657
+ "type": "function"
1658
+ },
1659
+ {
1660
+ "inputs": [
1661
+ { "internalType": "address", "name": "from", "type": "address" },
1662
+ { "internalType": "address", "name": "to", "type": "address" },
1663
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
1664
+ ],
1665
+ "name": "transferFrom",
1666
+ "outputs": [],
1667
+ "stateMutability": "nonpayable",
1668
+ "type": "function"
1669
+ }
1670
+ ]
1671
+ }