@dhedge/v2-sdk 1.5.4 → 1.7.1

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 (39) 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 +3 -12
  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 +11 -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/arrakis.test.ts +65 -52
  30. package/src/test/constants.ts +17 -14
  31. package/src/test/lyra.test.ts +163 -0
  32. package/src/test/pool.test.ts +1 -1
  33. package/src/test/toros.test.ts +1 -1
  34. package/src/test/txOptions.ts +1 -1
  35. package/src/test/uniswap.test.ts +1 -1
  36. package/src/test/velodrome.test.ts +1 -1
  37. package/src/test/wallet.ts +8 -0
  38. package/src/types.ts +20 -1
  39. package/src/test/sushi.test.ts +0 -173
@@ -0,0 +1,1473 @@
1
+ {
2
+ "abi": [
3
+ { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" },
4
+ {
5
+ "inputs": [
6
+ { "internalType": "address", "name": "thrower", "type": "address" }
7
+ ],
8
+ "name": "AlreadyInitialised",
9
+ "type": "error"
10
+ },
11
+ {
12
+ "inputs": [
13
+ { "internalType": "address", "name": "thrower", "type": "address" },
14
+ { "internalType": "address", "name": "from", "type": "address" },
15
+ { "internalType": "address", "name": "to", "type": "address" },
16
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
17
+ ],
18
+ "name": "BaseTransferFailed",
19
+ "type": "error"
20
+ },
21
+ {
22
+ "inputs": [
23
+ { "internalType": "address", "name": "thrower", "type": "address" },
24
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" }
25
+ ],
26
+ "name": "BoardAlreadySettled",
27
+ "type": "error"
28
+ },
29
+ {
30
+ "inputs": [
31
+ { "internalType": "address", "name": "thrower", "type": "address" },
32
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" },
33
+ { "internalType": "uint256", "name": "boardExpiry", "type": "uint256" },
34
+ { "internalType": "uint256", "name": "currentTime", "type": "uint256" }
35
+ ],
36
+ "name": "BoardExpired",
37
+ "type": "error"
38
+ },
39
+ {
40
+ "inputs": [
41
+ { "internalType": "address", "name": "thrower", "type": "address" },
42
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" }
43
+ ],
44
+ "name": "BoardIsFrozen",
45
+ "type": "error"
46
+ },
47
+ {
48
+ "inputs": [
49
+ { "internalType": "address", "name": "thrower", "type": "address" },
50
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" }
51
+ ],
52
+ "name": "BoardNotExpired",
53
+ "type": "error"
54
+ },
55
+ {
56
+ "inputs": [
57
+ { "internalType": "address", "name": "thrower", "type": "address" },
58
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" }
59
+ ],
60
+ "name": "BoardNotFrozen",
61
+ "type": "error"
62
+ },
63
+ {
64
+ "inputs": [
65
+ { "internalType": "address", "name": "thrower", "type": "address" },
66
+ {
67
+ "internalType": "enum OptionMarket.NonZeroValues",
68
+ "name": "valueType",
69
+ "type": "uint8"
70
+ }
71
+ ],
72
+ "name": "ExpectedNonZeroValue",
73
+ "type": "error"
74
+ },
75
+ {
76
+ "inputs": [
77
+ { "internalType": "address", "name": "thrower", "type": "address" },
78
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" }
79
+ ],
80
+ "name": "InvalidBoardId",
81
+ "type": "error"
82
+ },
83
+ {
84
+ "inputs": [
85
+ { "internalType": "address", "name": "thrower", "type": "address" },
86
+ { "internalType": "uint256", "name": "currentTime", "type": "uint256" },
87
+ { "internalType": "uint256", "name": "expiry", "type": "uint256" },
88
+ {
89
+ "internalType": "uint256",
90
+ "name": "maxBoardExpiry",
91
+ "type": "uint256"
92
+ }
93
+ ],
94
+ "name": "InvalidExpiryTimestamp",
95
+ "type": "error"
96
+ },
97
+ {
98
+ "inputs": [
99
+ { "internalType": "address", "name": "thrower", "type": "address" },
100
+ {
101
+ "components": [
102
+ {
103
+ "internalType": "uint256",
104
+ "name": "maxBoardExpiry",
105
+ "type": "uint256"
106
+ },
107
+ {
108
+ "internalType": "address",
109
+ "name": "securityModule",
110
+ "type": "address"
111
+ },
112
+ {
113
+ "internalType": "uint256",
114
+ "name": "feePortionReserved",
115
+ "type": "uint256"
116
+ },
117
+ {
118
+ "internalType": "uint256",
119
+ "name": "staticBaseSettlementFee",
120
+ "type": "uint256"
121
+ }
122
+ ],
123
+ "internalType": "struct OptionMarket.OptionMarketParameters",
124
+ "name": "optionMarketParams",
125
+ "type": "tuple"
126
+ }
127
+ ],
128
+ "name": "InvalidOptionMarketParams",
129
+ "type": "error"
130
+ },
131
+ {
132
+ "inputs": [
133
+ { "internalType": "address", "name": "thrower", "type": "address" },
134
+ { "internalType": "uint256", "name": "strikeId", "type": "uint256" }
135
+ ],
136
+ "name": "InvalidStrikeId",
137
+ "type": "error"
138
+ },
139
+ {
140
+ "inputs": [
141
+ { "internalType": "address", "name": "thrower", "type": "address" },
142
+ { "internalType": "address", "name": "caller", "type": "address" },
143
+ {
144
+ "internalType": "address",
145
+ "name": "nominatedOwner",
146
+ "type": "address"
147
+ }
148
+ ],
149
+ "name": "OnlyNominatedOwner",
150
+ "type": "error"
151
+ },
152
+ {
153
+ "inputs": [
154
+ { "internalType": "address", "name": "thrower", "type": "address" },
155
+ { "internalType": "address", "name": "caller", "type": "address" },
156
+ { "internalType": "address", "name": "owner", "type": "address" }
157
+ ],
158
+ "name": "OnlyOwner",
159
+ "type": "error"
160
+ },
161
+ {
162
+ "inputs": [
163
+ { "internalType": "address", "name": "thrower", "type": "address" },
164
+ { "internalType": "address", "name": "caller", "type": "address" },
165
+ {
166
+ "internalType": "address",
167
+ "name": "securityModule",
168
+ "type": "address"
169
+ }
170
+ ],
171
+ "name": "OnlySecurityModule",
172
+ "type": "error"
173
+ },
174
+ {
175
+ "inputs": [
176
+ { "internalType": "address", "name": "thrower", "type": "address" },
177
+ { "internalType": "address", "name": "from", "type": "address" },
178
+ { "internalType": "address", "name": "to", "type": "address" },
179
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
180
+ ],
181
+ "name": "QuoteTransferFailed",
182
+ "type": "error"
183
+ },
184
+ {
185
+ "inputs": [
186
+ { "internalType": "address", "name": "thrower", "type": "address" },
187
+ {
188
+ "internalType": "uint256",
189
+ "name": "strikesLength",
190
+ "type": "uint256"
191
+ },
192
+ { "internalType": "uint256", "name": "skewsLength", "type": "uint256" }
193
+ ],
194
+ "name": "StrikeSkewLengthMismatch",
195
+ "type": "error"
196
+ },
197
+ {
198
+ "inputs": [
199
+ { "internalType": "address", "name": "thrower", "type": "address" },
200
+ { "internalType": "uint256", "name": "totalCost", "type": "uint256" },
201
+ { "internalType": "uint256", "name": "minCost", "type": "uint256" },
202
+ { "internalType": "uint256", "name": "maxCost", "type": "uint256" }
203
+ ],
204
+ "name": "TotalCostOutsideOfSpecifiedBounds",
205
+ "type": "error"
206
+ },
207
+ {
208
+ "inputs": [
209
+ { "internalType": "address", "name": "thrower", "type": "address" },
210
+ { "internalType": "uint256", "name": "iterations", "type": "uint256" },
211
+ {
212
+ "internalType": "uint256",
213
+ "name": "expectedAmount",
214
+ "type": "uint256"
215
+ },
216
+ { "internalType": "uint256", "name": "tradeAmount", "type": "uint256" },
217
+ { "internalType": "uint256", "name": "totalAmount", "type": "uint256" }
218
+ ],
219
+ "name": "TradeIterationsHasRemainder",
220
+ "type": "error"
221
+ },
222
+ {
223
+ "anonymous": false,
224
+ "inputs": [
225
+ {
226
+ "indexed": true,
227
+ "internalType": "uint256",
228
+ "name": "boardId",
229
+ "type": "uint256"
230
+ },
231
+ {
232
+ "indexed": false,
233
+ "internalType": "uint256",
234
+ "name": "baseIv",
235
+ "type": "uint256"
236
+ }
237
+ ],
238
+ "name": "BoardBaseIvSet",
239
+ "type": "event"
240
+ },
241
+ {
242
+ "anonymous": false,
243
+ "inputs": [
244
+ {
245
+ "indexed": true,
246
+ "internalType": "uint256",
247
+ "name": "boardId",
248
+ "type": "uint256"
249
+ },
250
+ {
251
+ "indexed": false,
252
+ "internalType": "uint256",
253
+ "name": "expiry",
254
+ "type": "uint256"
255
+ },
256
+ {
257
+ "indexed": false,
258
+ "internalType": "uint256",
259
+ "name": "baseIv",
260
+ "type": "uint256"
261
+ },
262
+ {
263
+ "indexed": false,
264
+ "internalType": "bool",
265
+ "name": "frozen",
266
+ "type": "bool"
267
+ }
268
+ ],
269
+ "name": "BoardCreated",
270
+ "type": "event"
271
+ },
272
+ {
273
+ "anonymous": false,
274
+ "inputs": [
275
+ {
276
+ "indexed": true,
277
+ "internalType": "uint256",
278
+ "name": "boardId",
279
+ "type": "uint256"
280
+ },
281
+ {
282
+ "indexed": false,
283
+ "internalType": "bool",
284
+ "name": "frozen",
285
+ "type": "bool"
286
+ }
287
+ ],
288
+ "name": "BoardFrozen",
289
+ "type": "event"
290
+ },
291
+ {
292
+ "anonymous": false,
293
+ "inputs": [
294
+ {
295
+ "indexed": true,
296
+ "internalType": "uint256",
297
+ "name": "boardId",
298
+ "type": "uint256"
299
+ },
300
+ {
301
+ "indexed": false,
302
+ "internalType": "uint256",
303
+ "name": "spotPriceAtExpiry",
304
+ "type": "uint256"
305
+ },
306
+ {
307
+ "indexed": false,
308
+ "internalType": "uint256",
309
+ "name": "totalUserLongProfitQuote",
310
+ "type": "uint256"
311
+ },
312
+ {
313
+ "indexed": false,
314
+ "internalType": "uint256",
315
+ "name": "totalBoardLongCallCollateral",
316
+ "type": "uint256"
317
+ },
318
+ {
319
+ "indexed": false,
320
+ "internalType": "uint256",
321
+ "name": "totalBoardLongPutCollateral",
322
+ "type": "uint256"
323
+ },
324
+ {
325
+ "indexed": false,
326
+ "internalType": "uint256",
327
+ "name": "totalAMMShortCallProfitBase",
328
+ "type": "uint256"
329
+ },
330
+ {
331
+ "indexed": false,
332
+ "internalType": "uint256",
333
+ "name": "totalAMMShortCallProfitQuote",
334
+ "type": "uint256"
335
+ },
336
+ {
337
+ "indexed": false,
338
+ "internalType": "uint256",
339
+ "name": "totalAMMShortPutProfitQuote",
340
+ "type": "uint256"
341
+ }
342
+ ],
343
+ "name": "BoardSettled",
344
+ "type": "event"
345
+ },
346
+ {
347
+ "anonymous": false,
348
+ "inputs": [
349
+ {
350
+ "components": [
351
+ {
352
+ "internalType": "uint256",
353
+ "name": "maxBoardExpiry",
354
+ "type": "uint256"
355
+ },
356
+ {
357
+ "internalType": "address",
358
+ "name": "securityModule",
359
+ "type": "address"
360
+ },
361
+ {
362
+ "internalType": "uint256",
363
+ "name": "feePortionReserved",
364
+ "type": "uint256"
365
+ },
366
+ {
367
+ "internalType": "uint256",
368
+ "name": "staticBaseSettlementFee",
369
+ "type": "uint256"
370
+ }
371
+ ],
372
+ "indexed": false,
373
+ "internalType": "struct OptionMarket.OptionMarketParameters",
374
+ "name": "optionMarketParams",
375
+ "type": "tuple"
376
+ }
377
+ ],
378
+ "name": "OptionMarketParamsSet",
379
+ "type": "event"
380
+ },
381
+ {
382
+ "anonymous": false,
383
+ "inputs": [
384
+ {
385
+ "indexed": false,
386
+ "internalType": "address",
387
+ "name": "oldOwner",
388
+ "type": "address"
389
+ },
390
+ {
391
+ "indexed": false,
392
+ "internalType": "address",
393
+ "name": "newOwner",
394
+ "type": "address"
395
+ }
396
+ ],
397
+ "name": "OwnerChanged",
398
+ "type": "event"
399
+ },
400
+ {
401
+ "anonymous": false,
402
+ "inputs": [
403
+ {
404
+ "indexed": false,
405
+ "internalType": "address",
406
+ "name": "newOwner",
407
+ "type": "address"
408
+ }
409
+ ],
410
+ "name": "OwnerNominated",
411
+ "type": "event"
412
+ },
413
+ {
414
+ "anonymous": false,
415
+ "inputs": [
416
+ {
417
+ "indexed": false,
418
+ "internalType": "address",
419
+ "name": "securityModule",
420
+ "type": "address"
421
+ },
422
+ {
423
+ "indexed": false,
424
+ "internalType": "uint256",
425
+ "name": "quoteAmount",
426
+ "type": "uint256"
427
+ },
428
+ {
429
+ "indexed": false,
430
+ "internalType": "uint256",
431
+ "name": "baseAmount",
432
+ "type": "uint256"
433
+ }
434
+ ],
435
+ "name": "SMClaimed",
436
+ "type": "event"
437
+ },
438
+ {
439
+ "anonymous": false,
440
+ "inputs": [
441
+ {
442
+ "indexed": true,
443
+ "internalType": "uint256",
444
+ "name": "boardId",
445
+ "type": "uint256"
446
+ },
447
+ {
448
+ "indexed": true,
449
+ "internalType": "uint256",
450
+ "name": "strikeId",
451
+ "type": "uint256"
452
+ },
453
+ {
454
+ "indexed": false,
455
+ "internalType": "uint256",
456
+ "name": "strikePrice",
457
+ "type": "uint256"
458
+ },
459
+ {
460
+ "indexed": false,
461
+ "internalType": "uint256",
462
+ "name": "skew",
463
+ "type": "uint256"
464
+ }
465
+ ],
466
+ "name": "StrikeAdded",
467
+ "type": "event"
468
+ },
469
+ {
470
+ "anonymous": false,
471
+ "inputs": [
472
+ {
473
+ "indexed": true,
474
+ "internalType": "uint256",
475
+ "name": "strikeId",
476
+ "type": "uint256"
477
+ },
478
+ {
479
+ "indexed": false,
480
+ "internalType": "uint256",
481
+ "name": "skew",
482
+ "type": "uint256"
483
+ }
484
+ ],
485
+ "name": "StrikeSkewSet",
486
+ "type": "event"
487
+ },
488
+ {
489
+ "anonymous": false,
490
+ "inputs": [
491
+ {
492
+ "indexed": true,
493
+ "internalType": "address",
494
+ "name": "trader",
495
+ "type": "address"
496
+ },
497
+ {
498
+ "indexed": true,
499
+ "internalType": "uint256",
500
+ "name": "strikeId",
501
+ "type": "uint256"
502
+ },
503
+ {
504
+ "indexed": true,
505
+ "internalType": "uint256",
506
+ "name": "positionId",
507
+ "type": "uint256"
508
+ },
509
+ {
510
+ "components": [
511
+ { "internalType": "uint256", "name": "expiry", "type": "uint256" },
512
+ {
513
+ "internalType": "uint256",
514
+ "name": "strikePrice",
515
+ "type": "uint256"
516
+ },
517
+ {
518
+ "internalType": "enum OptionMarket.OptionType",
519
+ "name": "optionType",
520
+ "type": "uint8"
521
+ },
522
+ {
523
+ "internalType": "enum OptionMarket.TradeDirection",
524
+ "name": "tradeDirection",
525
+ "type": "uint8"
526
+ },
527
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
528
+ {
529
+ "internalType": "uint256",
530
+ "name": "setCollateralTo",
531
+ "type": "uint256"
532
+ },
533
+ { "internalType": "bool", "name": "isForceClose", "type": "bool" },
534
+ {
535
+ "internalType": "uint256",
536
+ "name": "spotPrice",
537
+ "type": "uint256"
538
+ },
539
+ {
540
+ "internalType": "uint256",
541
+ "name": "reservedFee",
542
+ "type": "uint256"
543
+ },
544
+ {
545
+ "internalType": "uint256",
546
+ "name": "totalCost",
547
+ "type": "uint256"
548
+ }
549
+ ],
550
+ "indexed": false,
551
+ "internalType": "struct OptionMarket.TradeEventData",
552
+ "name": "trade",
553
+ "type": "tuple"
554
+ },
555
+ {
556
+ "components": [
557
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
558
+ { "internalType": "uint256", "name": "premium", "type": "uint256" },
559
+ {
560
+ "internalType": "uint256",
561
+ "name": "optionPriceFee",
562
+ "type": "uint256"
563
+ },
564
+ {
565
+ "internalType": "uint256",
566
+ "name": "spotPriceFee",
567
+ "type": "uint256"
568
+ },
569
+ {
570
+ "components": [
571
+ {
572
+ "internalType": "int256",
573
+ "name": "preTradeAmmNetStdVega",
574
+ "type": "int256"
575
+ },
576
+ {
577
+ "internalType": "int256",
578
+ "name": "postTradeAmmNetStdVega",
579
+ "type": "int256"
580
+ },
581
+ {
582
+ "internalType": "uint256",
583
+ "name": "vegaUtil",
584
+ "type": "uint256"
585
+ },
586
+ {
587
+ "internalType": "uint256",
588
+ "name": "volTraded",
589
+ "type": "uint256"
590
+ },
591
+ { "internalType": "uint256", "name": "NAV", "type": "uint256" },
592
+ {
593
+ "internalType": "uint256",
594
+ "name": "vegaUtilFee",
595
+ "type": "uint256"
596
+ }
597
+ ],
598
+ "internalType": "struct OptionMarketPricer.VegaUtilFeeComponents",
599
+ "name": "vegaUtilFee",
600
+ "type": "tuple"
601
+ },
602
+ {
603
+ "components": [
604
+ {
605
+ "internalType": "uint256",
606
+ "name": "varianceFeeCoefficient",
607
+ "type": "uint256"
608
+ },
609
+ {
610
+ "internalType": "uint256",
611
+ "name": "vega",
612
+ "type": "uint256"
613
+ },
614
+ {
615
+ "internalType": "uint256",
616
+ "name": "vegaCoefficient",
617
+ "type": "uint256"
618
+ },
619
+ {
620
+ "internalType": "uint256",
621
+ "name": "skew",
622
+ "type": "uint256"
623
+ },
624
+ {
625
+ "internalType": "uint256",
626
+ "name": "skewCoefficient",
627
+ "type": "uint256"
628
+ },
629
+ {
630
+ "internalType": "uint256",
631
+ "name": "ivVariance",
632
+ "type": "uint256"
633
+ },
634
+ {
635
+ "internalType": "uint256",
636
+ "name": "ivVarianceCoefficient",
637
+ "type": "uint256"
638
+ },
639
+ {
640
+ "internalType": "uint256",
641
+ "name": "varianceFee",
642
+ "type": "uint256"
643
+ }
644
+ ],
645
+ "internalType": "struct OptionMarketPricer.VarianceFeeComponents",
646
+ "name": "varianceFee",
647
+ "type": "tuple"
648
+ },
649
+ {
650
+ "internalType": "uint256",
651
+ "name": "totalFee",
652
+ "type": "uint256"
653
+ },
654
+ {
655
+ "internalType": "uint256",
656
+ "name": "totalCost",
657
+ "type": "uint256"
658
+ },
659
+ {
660
+ "internalType": "uint256",
661
+ "name": "volTraded",
662
+ "type": "uint256"
663
+ },
664
+ {
665
+ "internalType": "uint256",
666
+ "name": "newBaseIv",
667
+ "type": "uint256"
668
+ },
669
+ { "internalType": "uint256", "name": "newSkew", "type": "uint256" }
670
+ ],
671
+ "indexed": false,
672
+ "internalType": "struct OptionMarketPricer.TradeResult[]",
673
+ "name": "tradeResults",
674
+ "type": "tuple[]"
675
+ },
676
+ {
677
+ "components": [
678
+ {
679
+ "internalType": "address",
680
+ "name": "rewardBeneficiary",
681
+ "type": "address"
682
+ },
683
+ { "internalType": "address", "name": "caller", "type": "address" },
684
+ {
685
+ "internalType": "uint256",
686
+ "name": "returnCollateral",
687
+ "type": "uint256"
688
+ },
689
+ {
690
+ "internalType": "uint256",
691
+ "name": "lpPremiums",
692
+ "type": "uint256"
693
+ },
694
+ { "internalType": "uint256", "name": "lpFee", "type": "uint256" },
695
+ {
696
+ "internalType": "uint256",
697
+ "name": "liquidatorFee",
698
+ "type": "uint256"
699
+ },
700
+ { "internalType": "uint256", "name": "smFee", "type": "uint256" },
701
+ {
702
+ "internalType": "uint256",
703
+ "name": "insolventAmount",
704
+ "type": "uint256"
705
+ }
706
+ ],
707
+ "indexed": false,
708
+ "internalType": "struct OptionMarket.LiquidationEventData",
709
+ "name": "liquidation",
710
+ "type": "tuple"
711
+ },
712
+ {
713
+ "indexed": false,
714
+ "internalType": "uint256",
715
+ "name": "timestamp",
716
+ "type": "uint256"
717
+ }
718
+ ],
719
+ "name": "Trade",
720
+ "type": "event"
721
+ },
722
+ {
723
+ "inputs": [],
724
+ "name": "acceptOwnership",
725
+ "outputs": [],
726
+ "stateMutability": "nonpayable",
727
+ "type": "function"
728
+ },
729
+ {
730
+ "inputs": [
731
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" },
732
+ {
733
+ "internalType": "uint256",
734
+ "name": "amountCollateral",
735
+ "type": "uint256"
736
+ }
737
+ ],
738
+ "name": "addCollateral",
739
+ "outputs": [],
740
+ "stateMutability": "nonpayable",
741
+ "type": "function"
742
+ },
743
+ {
744
+ "inputs": [
745
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" },
746
+ { "internalType": "uint256", "name": "strikePrice", "type": "uint256" },
747
+ { "internalType": "uint256", "name": "skew", "type": "uint256" }
748
+ ],
749
+ "name": "addStrikeToBoard",
750
+ "outputs": [],
751
+ "stateMutability": "nonpayable",
752
+ "type": "function"
753
+ },
754
+ {
755
+ "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
756
+ "name": "boardToPriceAtExpiry",
757
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
758
+ "stateMutability": "view",
759
+ "type": "function"
760
+ },
761
+ {
762
+ "inputs": [
763
+ {
764
+ "components": [
765
+ {
766
+ "internalType": "uint256",
767
+ "name": "strikeId",
768
+ "type": "uint256"
769
+ },
770
+ {
771
+ "internalType": "uint256",
772
+ "name": "positionId",
773
+ "type": "uint256"
774
+ },
775
+ {
776
+ "internalType": "uint256",
777
+ "name": "iterations",
778
+ "type": "uint256"
779
+ },
780
+ {
781
+ "internalType": "enum OptionMarket.OptionType",
782
+ "name": "optionType",
783
+ "type": "uint8"
784
+ },
785
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
786
+ {
787
+ "internalType": "uint256",
788
+ "name": "setCollateralTo",
789
+ "type": "uint256"
790
+ },
791
+ {
792
+ "internalType": "uint256",
793
+ "name": "minTotalCost",
794
+ "type": "uint256"
795
+ },
796
+ {
797
+ "internalType": "uint256",
798
+ "name": "maxTotalCost",
799
+ "type": "uint256"
800
+ }
801
+ ],
802
+ "internalType": "struct OptionMarket.TradeInputParameters",
803
+ "name": "params",
804
+ "type": "tuple"
805
+ }
806
+ ],
807
+ "name": "closePosition",
808
+ "outputs": [
809
+ {
810
+ "components": [
811
+ {
812
+ "internalType": "uint256",
813
+ "name": "positionId",
814
+ "type": "uint256"
815
+ },
816
+ {
817
+ "internalType": "uint256",
818
+ "name": "totalCost",
819
+ "type": "uint256"
820
+ },
821
+ { "internalType": "uint256", "name": "totalFee", "type": "uint256" }
822
+ ],
823
+ "internalType": "struct OptionMarket.Result",
824
+ "name": "result",
825
+ "type": "tuple"
826
+ }
827
+ ],
828
+ "stateMutability": "nonpayable",
829
+ "type": "function"
830
+ },
831
+ {
832
+ "inputs": [
833
+ { "internalType": "uint256", "name": "expiry", "type": "uint256" },
834
+ { "internalType": "uint256", "name": "baseIV", "type": "uint256" },
835
+ {
836
+ "internalType": "uint256[]",
837
+ "name": "strikePrices",
838
+ "type": "uint256[]"
839
+ },
840
+ { "internalType": "uint256[]", "name": "skews", "type": "uint256[]" },
841
+ { "internalType": "bool", "name": "frozen", "type": "bool" }
842
+ ],
843
+ "name": "createOptionBoard",
844
+ "outputs": [
845
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" }
846
+ ],
847
+ "stateMutability": "nonpayable",
848
+ "type": "function"
849
+ },
850
+ {
851
+ "inputs": [
852
+ {
853
+ "components": [
854
+ {
855
+ "internalType": "uint256",
856
+ "name": "strikeId",
857
+ "type": "uint256"
858
+ },
859
+ {
860
+ "internalType": "uint256",
861
+ "name": "positionId",
862
+ "type": "uint256"
863
+ },
864
+ {
865
+ "internalType": "uint256",
866
+ "name": "iterations",
867
+ "type": "uint256"
868
+ },
869
+ {
870
+ "internalType": "enum OptionMarket.OptionType",
871
+ "name": "optionType",
872
+ "type": "uint8"
873
+ },
874
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
875
+ {
876
+ "internalType": "uint256",
877
+ "name": "setCollateralTo",
878
+ "type": "uint256"
879
+ },
880
+ {
881
+ "internalType": "uint256",
882
+ "name": "minTotalCost",
883
+ "type": "uint256"
884
+ },
885
+ {
886
+ "internalType": "uint256",
887
+ "name": "maxTotalCost",
888
+ "type": "uint256"
889
+ }
890
+ ],
891
+ "internalType": "struct OptionMarket.TradeInputParameters",
892
+ "name": "params",
893
+ "type": "tuple"
894
+ }
895
+ ],
896
+ "name": "forceClosePosition",
897
+ "outputs": [
898
+ {
899
+ "components": [
900
+ {
901
+ "internalType": "uint256",
902
+ "name": "positionId",
903
+ "type": "uint256"
904
+ },
905
+ {
906
+ "internalType": "uint256",
907
+ "name": "totalCost",
908
+ "type": "uint256"
909
+ },
910
+ { "internalType": "uint256", "name": "totalFee", "type": "uint256" }
911
+ ],
912
+ "internalType": "struct OptionMarket.Result",
913
+ "name": "result",
914
+ "type": "tuple"
915
+ }
916
+ ],
917
+ "stateMutability": "nonpayable",
918
+ "type": "function"
919
+ },
920
+ {
921
+ "inputs": [
922
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" }
923
+ ],
924
+ "name": "forceSettleBoard",
925
+ "outputs": [],
926
+ "stateMutability": "nonpayable",
927
+ "type": "function"
928
+ },
929
+ {
930
+ "inputs": [
931
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" }
932
+ ],
933
+ "name": "getBoardAndStrikeDetails",
934
+ "outputs": [
935
+ {
936
+ "components": [
937
+ { "internalType": "uint256", "name": "id", "type": "uint256" },
938
+ { "internalType": "uint256", "name": "expiry", "type": "uint256" },
939
+ { "internalType": "uint256", "name": "iv", "type": "uint256" },
940
+ { "internalType": "bool", "name": "frozen", "type": "bool" },
941
+ {
942
+ "internalType": "uint256[]",
943
+ "name": "strikeIds",
944
+ "type": "uint256[]"
945
+ }
946
+ ],
947
+ "internalType": "struct OptionMarket.OptionBoard",
948
+ "name": "",
949
+ "type": "tuple"
950
+ },
951
+ {
952
+ "components": [
953
+ { "internalType": "uint256", "name": "id", "type": "uint256" },
954
+ {
955
+ "internalType": "uint256",
956
+ "name": "strikePrice",
957
+ "type": "uint256"
958
+ },
959
+ { "internalType": "uint256", "name": "skew", "type": "uint256" },
960
+ {
961
+ "internalType": "uint256",
962
+ "name": "longCall",
963
+ "type": "uint256"
964
+ },
965
+ {
966
+ "internalType": "uint256",
967
+ "name": "shortCallBase",
968
+ "type": "uint256"
969
+ },
970
+ {
971
+ "internalType": "uint256",
972
+ "name": "shortCallQuote",
973
+ "type": "uint256"
974
+ },
975
+ { "internalType": "uint256", "name": "longPut", "type": "uint256" },
976
+ {
977
+ "internalType": "uint256",
978
+ "name": "shortPut",
979
+ "type": "uint256"
980
+ },
981
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" }
982
+ ],
983
+ "internalType": "struct OptionMarket.Strike[]",
984
+ "name": "",
985
+ "type": "tuple[]"
986
+ },
987
+ { "internalType": "uint256[]", "name": "", "type": "uint256[]" },
988
+ { "internalType": "uint256", "name": "", "type": "uint256" }
989
+ ],
990
+ "stateMutability": "view",
991
+ "type": "function"
992
+ },
993
+ {
994
+ "inputs": [
995
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" }
996
+ ],
997
+ "name": "getBoardStrikes",
998
+ "outputs": [
999
+ {
1000
+ "internalType": "uint256[]",
1001
+ "name": "strikeIds",
1002
+ "type": "uint256[]"
1003
+ }
1004
+ ],
1005
+ "stateMutability": "view",
1006
+ "type": "function"
1007
+ },
1008
+ {
1009
+ "inputs": [],
1010
+ "name": "getLiveBoards",
1011
+ "outputs": [
1012
+ {
1013
+ "internalType": "uint256[]",
1014
+ "name": "_liveBoards",
1015
+ "type": "uint256[]"
1016
+ }
1017
+ ],
1018
+ "stateMutability": "view",
1019
+ "type": "function"
1020
+ },
1021
+ {
1022
+ "inputs": [],
1023
+ "name": "getNumLiveBoards",
1024
+ "outputs": [
1025
+ {
1026
+ "internalType": "uint256",
1027
+ "name": "numLiveBoards",
1028
+ "type": "uint256"
1029
+ }
1030
+ ],
1031
+ "stateMutability": "view",
1032
+ "type": "function"
1033
+ },
1034
+ {
1035
+ "inputs": [
1036
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" }
1037
+ ],
1038
+ "name": "getOptionBoard",
1039
+ "outputs": [
1040
+ {
1041
+ "components": [
1042
+ { "internalType": "uint256", "name": "id", "type": "uint256" },
1043
+ { "internalType": "uint256", "name": "expiry", "type": "uint256" },
1044
+ { "internalType": "uint256", "name": "iv", "type": "uint256" },
1045
+ { "internalType": "bool", "name": "frozen", "type": "bool" },
1046
+ {
1047
+ "internalType": "uint256[]",
1048
+ "name": "strikeIds",
1049
+ "type": "uint256[]"
1050
+ }
1051
+ ],
1052
+ "internalType": "struct OptionMarket.OptionBoard",
1053
+ "name": "",
1054
+ "type": "tuple"
1055
+ }
1056
+ ],
1057
+ "stateMutability": "view",
1058
+ "type": "function"
1059
+ },
1060
+ {
1061
+ "inputs": [],
1062
+ "name": "getOptionMarketParams",
1063
+ "outputs": [
1064
+ {
1065
+ "components": [
1066
+ {
1067
+ "internalType": "uint256",
1068
+ "name": "maxBoardExpiry",
1069
+ "type": "uint256"
1070
+ },
1071
+ {
1072
+ "internalType": "address",
1073
+ "name": "securityModule",
1074
+ "type": "address"
1075
+ },
1076
+ {
1077
+ "internalType": "uint256",
1078
+ "name": "feePortionReserved",
1079
+ "type": "uint256"
1080
+ },
1081
+ {
1082
+ "internalType": "uint256",
1083
+ "name": "staticBaseSettlementFee",
1084
+ "type": "uint256"
1085
+ }
1086
+ ],
1087
+ "internalType": "struct OptionMarket.OptionMarketParameters",
1088
+ "name": "",
1089
+ "type": "tuple"
1090
+ }
1091
+ ],
1092
+ "stateMutability": "view",
1093
+ "type": "function"
1094
+ },
1095
+ {
1096
+ "inputs": [
1097
+ { "internalType": "uint256", "name": "strikeId", "type": "uint256" }
1098
+ ],
1099
+ "name": "getSettlementParameters",
1100
+ "outputs": [
1101
+ { "internalType": "uint256", "name": "strikePrice", "type": "uint256" },
1102
+ {
1103
+ "internalType": "uint256",
1104
+ "name": "priceAtExpiry",
1105
+ "type": "uint256"
1106
+ },
1107
+ {
1108
+ "internalType": "uint256",
1109
+ "name": "strikeToBaseReturned",
1110
+ "type": "uint256"
1111
+ }
1112
+ ],
1113
+ "stateMutability": "view",
1114
+ "type": "function"
1115
+ },
1116
+ {
1117
+ "inputs": [
1118
+ { "internalType": "uint256", "name": "strikeId", "type": "uint256" }
1119
+ ],
1120
+ "name": "getStrike",
1121
+ "outputs": [
1122
+ {
1123
+ "components": [
1124
+ { "internalType": "uint256", "name": "id", "type": "uint256" },
1125
+ {
1126
+ "internalType": "uint256",
1127
+ "name": "strikePrice",
1128
+ "type": "uint256"
1129
+ },
1130
+ { "internalType": "uint256", "name": "skew", "type": "uint256" },
1131
+ {
1132
+ "internalType": "uint256",
1133
+ "name": "longCall",
1134
+ "type": "uint256"
1135
+ },
1136
+ {
1137
+ "internalType": "uint256",
1138
+ "name": "shortCallBase",
1139
+ "type": "uint256"
1140
+ },
1141
+ {
1142
+ "internalType": "uint256",
1143
+ "name": "shortCallQuote",
1144
+ "type": "uint256"
1145
+ },
1146
+ { "internalType": "uint256", "name": "longPut", "type": "uint256" },
1147
+ {
1148
+ "internalType": "uint256",
1149
+ "name": "shortPut",
1150
+ "type": "uint256"
1151
+ },
1152
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" }
1153
+ ],
1154
+ "internalType": "struct OptionMarket.Strike",
1155
+ "name": "",
1156
+ "type": "tuple"
1157
+ }
1158
+ ],
1159
+ "stateMutability": "view",
1160
+ "type": "function"
1161
+ },
1162
+ {
1163
+ "inputs": [
1164
+ { "internalType": "uint256", "name": "strikeId", "type": "uint256" }
1165
+ ],
1166
+ "name": "getStrikeAndBoard",
1167
+ "outputs": [
1168
+ {
1169
+ "components": [
1170
+ { "internalType": "uint256", "name": "id", "type": "uint256" },
1171
+ {
1172
+ "internalType": "uint256",
1173
+ "name": "strikePrice",
1174
+ "type": "uint256"
1175
+ },
1176
+ { "internalType": "uint256", "name": "skew", "type": "uint256" },
1177
+ {
1178
+ "internalType": "uint256",
1179
+ "name": "longCall",
1180
+ "type": "uint256"
1181
+ },
1182
+ {
1183
+ "internalType": "uint256",
1184
+ "name": "shortCallBase",
1185
+ "type": "uint256"
1186
+ },
1187
+ {
1188
+ "internalType": "uint256",
1189
+ "name": "shortCallQuote",
1190
+ "type": "uint256"
1191
+ },
1192
+ { "internalType": "uint256", "name": "longPut", "type": "uint256" },
1193
+ {
1194
+ "internalType": "uint256",
1195
+ "name": "shortPut",
1196
+ "type": "uint256"
1197
+ },
1198
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" }
1199
+ ],
1200
+ "internalType": "struct OptionMarket.Strike",
1201
+ "name": "",
1202
+ "type": "tuple"
1203
+ },
1204
+ {
1205
+ "components": [
1206
+ { "internalType": "uint256", "name": "id", "type": "uint256" },
1207
+ { "internalType": "uint256", "name": "expiry", "type": "uint256" },
1208
+ { "internalType": "uint256", "name": "iv", "type": "uint256" },
1209
+ { "internalType": "bool", "name": "frozen", "type": "bool" },
1210
+ {
1211
+ "internalType": "uint256[]",
1212
+ "name": "strikeIds",
1213
+ "type": "uint256[]"
1214
+ }
1215
+ ],
1216
+ "internalType": "struct OptionMarket.OptionBoard",
1217
+ "name": "",
1218
+ "type": "tuple"
1219
+ }
1220
+ ],
1221
+ "stateMutability": "view",
1222
+ "type": "function"
1223
+ },
1224
+ {
1225
+ "inputs": [
1226
+ { "internalType": "uint256", "name": "strikeId", "type": "uint256" }
1227
+ ],
1228
+ "name": "getStrikeAndExpiry",
1229
+ "outputs": [
1230
+ { "internalType": "uint256", "name": "strikePrice", "type": "uint256" },
1231
+ { "internalType": "uint256", "name": "expiry", "type": "uint256" }
1232
+ ],
1233
+ "stateMutability": "view",
1234
+ "type": "function"
1235
+ },
1236
+ {
1237
+ "inputs": [
1238
+ {
1239
+ "internalType": "contract SynthetixAdapter",
1240
+ "name": "_synthetixAdapter",
1241
+ "type": "address"
1242
+ },
1243
+ {
1244
+ "internalType": "contract LiquidityPool",
1245
+ "name": "_liquidityPool",
1246
+ "type": "address"
1247
+ },
1248
+ {
1249
+ "internalType": "contract OptionMarketPricer",
1250
+ "name": "_optionPricer",
1251
+ "type": "address"
1252
+ },
1253
+ {
1254
+ "internalType": "contract OptionGreekCache",
1255
+ "name": "_greekCache",
1256
+ "type": "address"
1257
+ },
1258
+ {
1259
+ "internalType": "contract ShortCollateral",
1260
+ "name": "_shortCollateral",
1261
+ "type": "address"
1262
+ },
1263
+ {
1264
+ "internalType": "contract OptionToken",
1265
+ "name": "_optionToken",
1266
+ "type": "address"
1267
+ },
1268
+ {
1269
+ "internalType": "contract IERC20",
1270
+ "name": "_quoteAsset",
1271
+ "type": "address"
1272
+ },
1273
+ {
1274
+ "internalType": "contract IERC20",
1275
+ "name": "_baseAsset",
1276
+ "type": "address"
1277
+ }
1278
+ ],
1279
+ "name": "init",
1280
+ "outputs": [],
1281
+ "stateMutability": "nonpayable",
1282
+ "type": "function"
1283
+ },
1284
+ {
1285
+ "inputs": [
1286
+ { "internalType": "uint256", "name": "positionId", "type": "uint256" },
1287
+ {
1288
+ "internalType": "address",
1289
+ "name": "rewardBeneficiary",
1290
+ "type": "address"
1291
+ }
1292
+ ],
1293
+ "name": "liquidatePosition",
1294
+ "outputs": [],
1295
+ "stateMutability": "nonpayable",
1296
+ "type": "function"
1297
+ },
1298
+ {
1299
+ "inputs": [
1300
+ { "internalType": "address", "name": "_owner", "type": "address" }
1301
+ ],
1302
+ "name": "nominateNewOwner",
1303
+ "outputs": [],
1304
+ "stateMutability": "nonpayable",
1305
+ "type": "function"
1306
+ },
1307
+ {
1308
+ "inputs": [],
1309
+ "name": "nominatedOwner",
1310
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
1311
+ "stateMutability": "view",
1312
+ "type": "function"
1313
+ },
1314
+ {
1315
+ "inputs": [
1316
+ {
1317
+ "components": [
1318
+ {
1319
+ "internalType": "uint256",
1320
+ "name": "strikeId",
1321
+ "type": "uint256"
1322
+ },
1323
+ {
1324
+ "internalType": "uint256",
1325
+ "name": "positionId",
1326
+ "type": "uint256"
1327
+ },
1328
+ {
1329
+ "internalType": "uint256",
1330
+ "name": "iterations",
1331
+ "type": "uint256"
1332
+ },
1333
+ {
1334
+ "internalType": "enum OptionMarket.OptionType",
1335
+ "name": "optionType",
1336
+ "type": "uint8"
1337
+ },
1338
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
1339
+ {
1340
+ "internalType": "uint256",
1341
+ "name": "setCollateralTo",
1342
+ "type": "uint256"
1343
+ },
1344
+ {
1345
+ "internalType": "uint256",
1346
+ "name": "minTotalCost",
1347
+ "type": "uint256"
1348
+ },
1349
+ {
1350
+ "internalType": "uint256",
1351
+ "name": "maxTotalCost",
1352
+ "type": "uint256"
1353
+ }
1354
+ ],
1355
+ "internalType": "struct OptionMarket.TradeInputParameters",
1356
+ "name": "params",
1357
+ "type": "tuple"
1358
+ }
1359
+ ],
1360
+ "name": "openPosition",
1361
+ "outputs": [
1362
+ {
1363
+ "components": [
1364
+ {
1365
+ "internalType": "uint256",
1366
+ "name": "positionId",
1367
+ "type": "uint256"
1368
+ },
1369
+ {
1370
+ "internalType": "uint256",
1371
+ "name": "totalCost",
1372
+ "type": "uint256"
1373
+ },
1374
+ { "internalType": "uint256", "name": "totalFee", "type": "uint256" }
1375
+ ],
1376
+ "internalType": "struct OptionMarket.Result",
1377
+ "name": "result",
1378
+ "type": "tuple"
1379
+ }
1380
+ ],
1381
+ "stateMutability": "nonpayable",
1382
+ "type": "function"
1383
+ },
1384
+ {
1385
+ "inputs": [],
1386
+ "name": "owner",
1387
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
1388
+ "stateMutability": "view",
1389
+ "type": "function"
1390
+ },
1391
+ {
1392
+ "inputs": [
1393
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" },
1394
+ { "internalType": "uint256", "name": "baseIv", "type": "uint256" }
1395
+ ],
1396
+ "name": "setBoardBaseIv",
1397
+ "outputs": [],
1398
+ "stateMutability": "nonpayable",
1399
+ "type": "function"
1400
+ },
1401
+ {
1402
+ "inputs": [
1403
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" },
1404
+ { "internalType": "bool", "name": "frozen", "type": "bool" }
1405
+ ],
1406
+ "name": "setBoardFrozen",
1407
+ "outputs": [],
1408
+ "stateMutability": "nonpayable",
1409
+ "type": "function"
1410
+ },
1411
+ {
1412
+ "inputs": [
1413
+ {
1414
+ "components": [
1415
+ {
1416
+ "internalType": "uint256",
1417
+ "name": "maxBoardExpiry",
1418
+ "type": "uint256"
1419
+ },
1420
+ {
1421
+ "internalType": "address",
1422
+ "name": "securityModule",
1423
+ "type": "address"
1424
+ },
1425
+ {
1426
+ "internalType": "uint256",
1427
+ "name": "feePortionReserved",
1428
+ "type": "uint256"
1429
+ },
1430
+ {
1431
+ "internalType": "uint256",
1432
+ "name": "staticBaseSettlementFee",
1433
+ "type": "uint256"
1434
+ }
1435
+ ],
1436
+ "internalType": "struct OptionMarket.OptionMarketParameters",
1437
+ "name": "_optionMarketParams",
1438
+ "type": "tuple"
1439
+ }
1440
+ ],
1441
+ "name": "setOptionMarketParams",
1442
+ "outputs": [],
1443
+ "stateMutability": "nonpayable",
1444
+ "type": "function"
1445
+ },
1446
+ {
1447
+ "inputs": [
1448
+ { "internalType": "uint256", "name": "strikeId", "type": "uint256" },
1449
+ { "internalType": "uint256", "name": "skew", "type": "uint256" }
1450
+ ],
1451
+ "name": "setStrikeSkew",
1452
+ "outputs": [],
1453
+ "stateMutability": "nonpayable",
1454
+ "type": "function"
1455
+ },
1456
+ {
1457
+ "inputs": [
1458
+ { "internalType": "uint256", "name": "boardId", "type": "uint256" }
1459
+ ],
1460
+ "name": "settleExpiredBoard",
1461
+ "outputs": [],
1462
+ "stateMutability": "nonpayable",
1463
+ "type": "function"
1464
+ },
1465
+ {
1466
+ "inputs": [],
1467
+ "name": "smClaim",
1468
+ "outputs": [],
1469
+ "stateMutability": "nonpayable",
1470
+ "type": "function"
1471
+ }
1472
+ ]
1473
+ }