nado-protocol 0.1.0__py3-none-any.whl

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 (78) hide show
  1. nado_protocol/__init__.py +0 -0
  2. nado_protocol/client/__init__.py +200 -0
  3. nado_protocol/client/apis/__init__.py +26 -0
  4. nado_protocol/client/apis/base.py +42 -0
  5. nado_protocol/client/apis/market/__init__.py +23 -0
  6. nado_protocol/client/apis/market/execute.py +192 -0
  7. nado_protocol/client/apis/market/query.py +310 -0
  8. nado_protocol/client/apis/perp/__init__.py +18 -0
  9. nado_protocol/client/apis/perp/query.py +30 -0
  10. nado_protocol/client/apis/rewards/__init__.py +6 -0
  11. nado_protocol/client/apis/rewards/execute.py +131 -0
  12. nado_protocol/client/apis/rewards/query.py +12 -0
  13. nado_protocol/client/apis/spot/__init__.py +23 -0
  14. nado_protocol/client/apis/spot/base.py +32 -0
  15. nado_protocol/client/apis/spot/execute.py +117 -0
  16. nado_protocol/client/apis/spot/query.py +79 -0
  17. nado_protocol/client/apis/subaccount/__init__.py +24 -0
  18. nado_protocol/client/apis/subaccount/execute.py +54 -0
  19. nado_protocol/client/apis/subaccount/query.py +145 -0
  20. nado_protocol/client/context.py +90 -0
  21. nado_protocol/contracts/__init__.py +377 -0
  22. nado_protocol/contracts/abis/Endpoint.json +636 -0
  23. nado_protocol/contracts/abis/FQuerier.json +1909 -0
  24. nado_protocol/contracts/abis/IClearinghouse.json +876 -0
  25. nado_protocol/contracts/abis/IERC20.json +185 -0
  26. nado_protocol/contracts/abis/IEndpoint.json +250 -0
  27. nado_protocol/contracts/abis/IFoundationRewardsAirdrop.json +76 -0
  28. nado_protocol/contracts/abis/IOffchainBook.json +536 -0
  29. nado_protocol/contracts/abis/IPerpEngine.json +931 -0
  30. nado_protocol/contracts/abis/IProductEngine.json +352 -0
  31. nado_protocol/contracts/abis/ISpotEngine.json +813 -0
  32. nado_protocol/contracts/abis/IStaking.json +288 -0
  33. nado_protocol/contracts/abis/IVrtxAirdrop.json +138 -0
  34. nado_protocol/contracts/abis/MockERC20.json +311 -0
  35. nado_protocol/contracts/deployments/deployment.test.json +18 -0
  36. nado_protocol/contracts/eip712/__init__.py +16 -0
  37. nado_protocol/contracts/eip712/domain.py +36 -0
  38. nado_protocol/contracts/eip712/sign.py +79 -0
  39. nado_protocol/contracts/eip712/types.py +154 -0
  40. nado_protocol/contracts/loader.py +55 -0
  41. nado_protocol/contracts/types.py +141 -0
  42. nado_protocol/engine_client/__init__.py +35 -0
  43. nado_protocol/engine_client/execute.py +416 -0
  44. nado_protocol/engine_client/query.py +481 -0
  45. nado_protocol/engine_client/types/__init__.py +113 -0
  46. nado_protocol/engine_client/types/execute.py +680 -0
  47. nado_protocol/engine_client/types/models.py +247 -0
  48. nado_protocol/engine_client/types/query.py +516 -0
  49. nado_protocol/engine_client/types/stream.py +6 -0
  50. nado_protocol/indexer_client/__init__.py +28 -0
  51. nado_protocol/indexer_client/query.py +466 -0
  52. nado_protocol/indexer_client/types/__init__.py +122 -0
  53. nado_protocol/indexer_client/types/models.py +364 -0
  54. nado_protocol/indexer_client/types/query.py +819 -0
  55. nado_protocol/trigger_client/__init__.py +17 -0
  56. nado_protocol/trigger_client/execute.py +118 -0
  57. nado_protocol/trigger_client/query.py +61 -0
  58. nado_protocol/trigger_client/types/__init__.py +7 -0
  59. nado_protocol/trigger_client/types/execute.py +89 -0
  60. nado_protocol/trigger_client/types/models.py +44 -0
  61. nado_protocol/trigger_client/types/query.py +77 -0
  62. nado_protocol/utils/__init__.py +37 -0
  63. nado_protocol/utils/backend.py +111 -0
  64. nado_protocol/utils/bytes32.py +159 -0
  65. nado_protocol/utils/enum.py +6 -0
  66. nado_protocol/utils/exceptions.py +58 -0
  67. nado_protocol/utils/execute.py +403 -0
  68. nado_protocol/utils/expiration.py +45 -0
  69. nado_protocol/utils/interest.py +66 -0
  70. nado_protocol/utils/math.py +67 -0
  71. nado_protocol/utils/model.py +79 -0
  72. nado_protocol/utils/nonce.py +33 -0
  73. nado_protocol/utils/subaccount.py +18 -0
  74. nado_protocol/utils/time.py +21 -0
  75. nado_protocol-0.1.0.dist-info/METADATA +157 -0
  76. nado_protocol-0.1.0.dist-info/RECORD +78 -0
  77. nado_protocol-0.1.0.dist-info/WHEEL +4 -0
  78. nado_protocol-0.1.0.dist-info/entry_points.txt +11 -0
@@ -0,0 +1,931 @@
1
+ [
2
+ {
3
+ "anonymous": false,
4
+ "inputs": [
5
+ {
6
+ "indexed": false,
7
+ "internalType": "uint32",
8
+ "name": "productId",
9
+ "type": "uint32"
10
+ }
11
+ ],
12
+ "name": "AddProduct",
13
+ "type": "event"
14
+ },
15
+ {
16
+ "inputs": [
17
+ {
18
+ "components": [
19
+ {
20
+ "internalType": "uint32",
21
+ "name": "productId",
22
+ "type": "uint32"
23
+ },
24
+ {
25
+ "internalType": "bytes32",
26
+ "name": "subaccount",
27
+ "type": "bytes32"
28
+ },
29
+ {
30
+ "internalType": "int128",
31
+ "name": "amountDelta",
32
+ "type": "int128"
33
+ },
34
+ {
35
+ "internalType": "int128",
36
+ "name": "vQuoteDelta",
37
+ "type": "int128"
38
+ }
39
+ ],
40
+ "internalType": "struct IProductEngine.ProductDelta[]",
41
+ "name": "deltas",
42
+ "type": "tuple[]"
43
+ }
44
+ ],
45
+ "name": "applyDeltas",
46
+ "outputs": [],
47
+ "stateMutability": "nonpayable",
48
+ "type": "function"
49
+ },
50
+ {
51
+ "inputs": [
52
+ {
53
+ "internalType": "uint32",
54
+ "name": "productId",
55
+ "type": "uint32"
56
+ },
57
+ {
58
+ "internalType": "bytes32",
59
+ "name": "subaccount",
60
+ "type": "bytes32"
61
+ },
62
+ {
63
+ "internalType": "int128",
64
+ "name": "amountLp",
65
+ "type": "int128"
66
+ }
67
+ ],
68
+ "name": "burnLp",
69
+ "outputs": [
70
+ {
71
+ "internalType": "int128",
72
+ "name": "",
73
+ "type": "int128"
74
+ },
75
+ {
76
+ "internalType": "int128",
77
+ "name": "",
78
+ "type": "int128"
79
+ }
80
+ ],
81
+ "stateMutability": "nonpayable",
82
+ "type": "function"
83
+ },
84
+ {
85
+ "inputs": [
86
+ {
87
+ "internalType": "bytes32",
88
+ "name": "liquidatee",
89
+ "type": "bytes32"
90
+ },
91
+ {
92
+ "internalType": "bytes32",
93
+ "name": "liquidator",
94
+ "type": "bytes32"
95
+ },
96
+ {
97
+ "internalType": "address",
98
+ "name": "feeCalculator",
99
+ "type": "address"
100
+ }
101
+ ],
102
+ "name": "decomposeLps",
103
+ "outputs": [
104
+ {
105
+ "internalType": "int128",
106
+ "name": "",
107
+ "type": "int128"
108
+ }
109
+ ],
110
+ "stateMutability": "nonpayable",
111
+ "type": "function"
112
+ },
113
+ {
114
+ "inputs": [
115
+ {
116
+ "internalType": "uint32",
117
+ "name": "productId",
118
+ "type": "uint32"
119
+ },
120
+ {
121
+ "internalType": "bytes32",
122
+ "name": "subaccount",
123
+ "type": "bytes32"
124
+ }
125
+ ],
126
+ "name": "getBalance",
127
+ "outputs": [
128
+ {
129
+ "components": [
130
+ {
131
+ "internalType": "int128",
132
+ "name": "amount",
133
+ "type": "int128"
134
+ },
135
+ {
136
+ "internalType": "int128",
137
+ "name": "vQuoteBalance",
138
+ "type": "int128"
139
+ },
140
+ {
141
+ "internalType": "int128",
142
+ "name": "lastCumulativeFundingX18",
143
+ "type": "int128"
144
+ }
145
+ ],
146
+ "internalType": "struct IPerpEngine.Balance",
147
+ "name": "",
148
+ "type": "tuple"
149
+ }
150
+ ],
151
+ "stateMutability": "view",
152
+ "type": "function"
153
+ },
154
+ {
155
+ "inputs": [
156
+ {
157
+ "internalType": "uint32",
158
+ "name": "productId",
159
+ "type": "uint32"
160
+ },
161
+ {
162
+ "internalType": "bytes32",
163
+ "name": "subaccount",
164
+ "type": "bytes32"
165
+ }
166
+ ],
167
+ "name": "getBalanceAmount",
168
+ "outputs": [
169
+ {
170
+ "internalType": "int128",
171
+ "name": "",
172
+ "type": "int128"
173
+ }
174
+ ],
175
+ "stateMutability": "view",
176
+ "type": "function"
177
+ },
178
+ {
179
+ "inputs": [
180
+ {
181
+ "internalType": "uint32",
182
+ "name": "productId",
183
+ "type": "uint32"
184
+ },
185
+ {
186
+ "internalType": "bytes32",
187
+ "name": "subaccount",
188
+ "type": "bytes32"
189
+ }
190
+ ],
191
+ "name": "getBalances",
192
+ "outputs": [
193
+ {
194
+ "components": [
195
+ {
196
+ "internalType": "int128",
197
+ "name": "amount",
198
+ "type": "int128"
199
+ },
200
+ {
201
+ "internalType": "int128",
202
+ "name": "lastCumulativeFundingX18",
203
+ "type": "int128"
204
+ }
205
+ ],
206
+ "internalType": "struct IPerpEngine.LpBalance",
207
+ "name": "",
208
+ "type": "tuple"
209
+ },
210
+ {
211
+ "components": [
212
+ {
213
+ "internalType": "int128",
214
+ "name": "amount",
215
+ "type": "int128"
216
+ },
217
+ {
218
+ "internalType": "int128",
219
+ "name": "vQuoteBalance",
220
+ "type": "int128"
221
+ },
222
+ {
223
+ "internalType": "int128",
224
+ "name": "lastCumulativeFundingX18",
225
+ "type": "int128"
226
+ }
227
+ ],
228
+ "internalType": "struct IPerpEngine.Balance",
229
+ "name": "",
230
+ "type": "tuple"
231
+ }
232
+ ],
233
+ "stateMutability": "view",
234
+ "type": "function"
235
+ },
236
+ {
237
+ "inputs": [],
238
+ "name": "getClearinghouse",
239
+ "outputs": [
240
+ {
241
+ "internalType": "address",
242
+ "name": "",
243
+ "type": "address"
244
+ }
245
+ ],
246
+ "stateMutability": "view",
247
+ "type": "function"
248
+ },
249
+ {
250
+ "inputs": [],
251
+ "name": "getEngineType",
252
+ "outputs": [
253
+ {
254
+ "internalType": "enum IProductEngine.EngineType",
255
+ "name": "",
256
+ "type": "uint8"
257
+ }
258
+ ],
259
+ "stateMutability": "pure",
260
+ "type": "function"
261
+ },
262
+ {
263
+ "inputs": [
264
+ {
265
+ "internalType": "uint32",
266
+ "name": "productId",
267
+ "type": "uint32"
268
+ }
269
+ ],
270
+ "name": "getLpState",
271
+ "outputs": [
272
+ {
273
+ "components": [
274
+ {
275
+ "internalType": "int128",
276
+ "name": "supply",
277
+ "type": "int128"
278
+ },
279
+ {
280
+ "internalType": "int128",
281
+ "name": "lastCumulativeFundingX18",
282
+ "type": "int128"
283
+ },
284
+ {
285
+ "internalType": "int128",
286
+ "name": "cumulativeFundingPerLpX18",
287
+ "type": "int128"
288
+ },
289
+ {
290
+ "internalType": "int128",
291
+ "name": "base",
292
+ "type": "int128"
293
+ },
294
+ {
295
+ "internalType": "int128",
296
+ "name": "quote",
297
+ "type": "int128"
298
+ }
299
+ ],
300
+ "internalType": "struct IPerpEngine.LpState",
301
+ "name": "",
302
+ "type": "tuple"
303
+ }
304
+ ],
305
+ "stateMutability": "view",
306
+ "type": "function"
307
+ },
308
+ {
309
+ "inputs": [
310
+ {
311
+ "internalType": "uint32",
312
+ "name": "productId",
313
+ "type": "uint32"
314
+ }
315
+ ],
316
+ "name": "getOrderbook",
317
+ "outputs": [
318
+ {
319
+ "internalType": "address",
320
+ "name": "",
321
+ "type": "address"
322
+ }
323
+ ],
324
+ "stateMutability": "view",
325
+ "type": "function"
326
+ },
327
+ {
328
+ "inputs": [
329
+ {
330
+ "internalType": "uint32",
331
+ "name": "productId",
332
+ "type": "uint32"
333
+ },
334
+ {
335
+ "internalType": "bytes32",
336
+ "name": "subaccount",
337
+ "type": "bytes32"
338
+ }
339
+ ],
340
+ "name": "getPositionPnl",
341
+ "outputs": [
342
+ {
343
+ "internalType": "int128",
344
+ "name": "",
345
+ "type": "int128"
346
+ }
347
+ ],
348
+ "stateMutability": "view",
349
+ "type": "function"
350
+ },
351
+ {
352
+ "inputs": [],
353
+ "name": "getProductIds",
354
+ "outputs": [
355
+ {
356
+ "internalType": "uint32[]",
357
+ "name": "",
358
+ "type": "uint32[]"
359
+ }
360
+ ],
361
+ "stateMutability": "view",
362
+ "type": "function"
363
+ },
364
+ {
365
+ "inputs": [
366
+ {
367
+ "internalType": "uint32",
368
+ "name": "productId",
369
+ "type": "uint32"
370
+ },
371
+ {
372
+ "internalType": "bytes32",
373
+ "name": "subaccount",
374
+ "type": "bytes32"
375
+ }
376
+ ],
377
+ "name": "getSettlementState",
378
+ "outputs": [
379
+ {
380
+ "internalType": "int128",
381
+ "name": "availableSettle",
382
+ "type": "int128"
383
+ },
384
+ {
385
+ "components": [
386
+ {
387
+ "internalType": "int128",
388
+ "name": "supply",
389
+ "type": "int128"
390
+ },
391
+ {
392
+ "internalType": "int128",
393
+ "name": "lastCumulativeFundingX18",
394
+ "type": "int128"
395
+ },
396
+ {
397
+ "internalType": "int128",
398
+ "name": "cumulativeFundingPerLpX18",
399
+ "type": "int128"
400
+ },
401
+ {
402
+ "internalType": "int128",
403
+ "name": "base",
404
+ "type": "int128"
405
+ },
406
+ {
407
+ "internalType": "int128",
408
+ "name": "quote",
409
+ "type": "int128"
410
+ }
411
+ ],
412
+ "internalType": "struct IPerpEngine.LpState",
413
+ "name": "lpState",
414
+ "type": "tuple"
415
+ },
416
+ {
417
+ "components": [
418
+ {
419
+ "internalType": "int128",
420
+ "name": "amount",
421
+ "type": "int128"
422
+ },
423
+ {
424
+ "internalType": "int128",
425
+ "name": "lastCumulativeFundingX18",
426
+ "type": "int128"
427
+ }
428
+ ],
429
+ "internalType": "struct IPerpEngine.LpBalance",
430
+ "name": "lpBalance",
431
+ "type": "tuple"
432
+ },
433
+ {
434
+ "components": [
435
+ {
436
+ "internalType": "int128",
437
+ "name": "cumulativeFundingLongX18",
438
+ "type": "int128"
439
+ },
440
+ {
441
+ "internalType": "int128",
442
+ "name": "cumulativeFundingShortX18",
443
+ "type": "int128"
444
+ },
445
+ {
446
+ "internalType": "int128",
447
+ "name": "availableSettle",
448
+ "type": "int128"
449
+ },
450
+ {
451
+ "internalType": "int128",
452
+ "name": "openInterest",
453
+ "type": "int128"
454
+ }
455
+ ],
456
+ "internalType": "struct IPerpEngine.State",
457
+ "name": "state",
458
+ "type": "tuple"
459
+ },
460
+ {
461
+ "components": [
462
+ {
463
+ "internalType": "int128",
464
+ "name": "amount",
465
+ "type": "int128"
466
+ },
467
+ {
468
+ "internalType": "int128",
469
+ "name": "vQuoteBalance",
470
+ "type": "int128"
471
+ },
472
+ {
473
+ "internalType": "int128",
474
+ "name": "lastCumulativeFundingX18",
475
+ "type": "int128"
476
+ }
477
+ ],
478
+ "internalType": "struct IPerpEngine.Balance",
479
+ "name": "balance",
480
+ "type": "tuple"
481
+ }
482
+ ],
483
+ "stateMutability": "view",
484
+ "type": "function"
485
+ },
486
+ {
487
+ "inputs": [
488
+ {
489
+ "internalType": "uint32",
490
+ "name": "productId",
491
+ "type": "uint32"
492
+ },
493
+ {
494
+ "internalType": "bytes32",
495
+ "name": "subaccount",
496
+ "type": "bytes32"
497
+ }
498
+ ],
499
+ "name": "getStateAndBalance",
500
+ "outputs": [
501
+ {
502
+ "components": [
503
+ {
504
+ "internalType": "int128",
505
+ "name": "cumulativeFundingLongX18",
506
+ "type": "int128"
507
+ },
508
+ {
509
+ "internalType": "int128",
510
+ "name": "cumulativeFundingShortX18",
511
+ "type": "int128"
512
+ },
513
+ {
514
+ "internalType": "int128",
515
+ "name": "availableSettle",
516
+ "type": "int128"
517
+ },
518
+ {
519
+ "internalType": "int128",
520
+ "name": "openInterest",
521
+ "type": "int128"
522
+ }
523
+ ],
524
+ "internalType": "struct IPerpEngine.State",
525
+ "name": "",
526
+ "type": "tuple"
527
+ },
528
+ {
529
+ "components": [
530
+ {
531
+ "internalType": "int128",
532
+ "name": "amount",
533
+ "type": "int128"
534
+ },
535
+ {
536
+ "internalType": "int128",
537
+ "name": "vQuoteBalance",
538
+ "type": "int128"
539
+ },
540
+ {
541
+ "internalType": "int128",
542
+ "name": "lastCumulativeFundingX18",
543
+ "type": "int128"
544
+ }
545
+ ],
546
+ "internalType": "struct IPerpEngine.Balance",
547
+ "name": "",
548
+ "type": "tuple"
549
+ }
550
+ ],
551
+ "stateMutability": "view",
552
+ "type": "function"
553
+ },
554
+ {
555
+ "inputs": [
556
+ {
557
+ "internalType": "uint32",
558
+ "name": "productId",
559
+ "type": "uint32"
560
+ },
561
+ {
562
+ "internalType": "bytes32",
563
+ "name": "subaccount",
564
+ "type": "bytes32"
565
+ }
566
+ ],
567
+ "name": "getStatesAndBalances",
568
+ "outputs": [
569
+ {
570
+ "components": [
571
+ {
572
+ "internalType": "int128",
573
+ "name": "supply",
574
+ "type": "int128"
575
+ },
576
+ {
577
+ "internalType": "int128",
578
+ "name": "lastCumulativeFundingX18",
579
+ "type": "int128"
580
+ },
581
+ {
582
+ "internalType": "int128",
583
+ "name": "cumulativeFundingPerLpX18",
584
+ "type": "int128"
585
+ },
586
+ {
587
+ "internalType": "int128",
588
+ "name": "base",
589
+ "type": "int128"
590
+ },
591
+ {
592
+ "internalType": "int128",
593
+ "name": "quote",
594
+ "type": "int128"
595
+ }
596
+ ],
597
+ "internalType": "struct IPerpEngine.LpState",
598
+ "name": "",
599
+ "type": "tuple"
600
+ },
601
+ {
602
+ "components": [
603
+ {
604
+ "internalType": "int128",
605
+ "name": "amount",
606
+ "type": "int128"
607
+ },
608
+ {
609
+ "internalType": "int128",
610
+ "name": "lastCumulativeFundingX18",
611
+ "type": "int128"
612
+ }
613
+ ],
614
+ "internalType": "struct IPerpEngine.LpBalance",
615
+ "name": "",
616
+ "type": "tuple"
617
+ },
618
+ {
619
+ "components": [
620
+ {
621
+ "internalType": "int128",
622
+ "name": "cumulativeFundingLongX18",
623
+ "type": "int128"
624
+ },
625
+ {
626
+ "internalType": "int128",
627
+ "name": "cumulativeFundingShortX18",
628
+ "type": "int128"
629
+ },
630
+ {
631
+ "internalType": "int128",
632
+ "name": "availableSettle",
633
+ "type": "int128"
634
+ },
635
+ {
636
+ "internalType": "int128",
637
+ "name": "openInterest",
638
+ "type": "int128"
639
+ }
640
+ ],
641
+ "internalType": "struct IPerpEngine.State",
642
+ "name": "",
643
+ "type": "tuple"
644
+ },
645
+ {
646
+ "components": [
647
+ {
648
+ "internalType": "int128",
649
+ "name": "amount",
650
+ "type": "int128"
651
+ },
652
+ {
653
+ "internalType": "int128",
654
+ "name": "vQuoteBalance",
655
+ "type": "int128"
656
+ },
657
+ {
658
+ "internalType": "int128",
659
+ "name": "lastCumulativeFundingX18",
660
+ "type": "int128"
661
+ }
662
+ ],
663
+ "internalType": "struct IPerpEngine.Balance",
664
+ "name": "",
665
+ "type": "tuple"
666
+ }
667
+ ],
668
+ "stateMutability": "view",
669
+ "type": "function"
670
+ },
671
+ {
672
+ "inputs": [
673
+ {
674
+ "internalType": "uint32",
675
+ "name": "productId",
676
+ "type": "uint32"
677
+ },
678
+ {
679
+ "internalType": "bytes32",
680
+ "name": "subaccount",
681
+ "type": "bytes32"
682
+ }
683
+ ],
684
+ "name": "hasBalance",
685
+ "outputs": [
686
+ {
687
+ "internalType": "bool",
688
+ "name": "",
689
+ "type": "bool"
690
+ }
691
+ ],
692
+ "stateMutability": "view",
693
+ "type": "function"
694
+ },
695
+ {
696
+ "inputs": [
697
+ {
698
+ "internalType": "address",
699
+ "name": "_clearinghouse",
700
+ "type": "address"
701
+ },
702
+ {
703
+ "internalType": "address",
704
+ "name": "_quote",
705
+ "type": "address"
706
+ },
707
+ {
708
+ "internalType": "address",
709
+ "name": "_endpoint",
710
+ "type": "address"
711
+ },
712
+ {
713
+ "internalType": "address",
714
+ "name": "_admin",
715
+ "type": "address"
716
+ },
717
+ {
718
+ "internalType": "address",
719
+ "name": "_fees",
720
+ "type": "address"
721
+ }
722
+ ],
723
+ "name": "initialize",
724
+ "outputs": [],
725
+ "stateMutability": "nonpayable",
726
+ "type": "function"
727
+ },
728
+ {
729
+ "inputs": [
730
+ {
731
+ "internalType": "int128[]",
732
+ "name": "openInterests",
733
+ "type": "int128[]"
734
+ }
735
+ ],
736
+ "name": "manualAssert",
737
+ "outputs": [],
738
+ "stateMutability": "view",
739
+ "type": "function"
740
+ },
741
+ {
742
+ "inputs": [
743
+ {
744
+ "internalType": "uint32",
745
+ "name": "productId",
746
+ "type": "uint32"
747
+ },
748
+ {
749
+ "internalType": "bytes32",
750
+ "name": "subaccount",
751
+ "type": "bytes32"
752
+ },
753
+ {
754
+ "internalType": "int128",
755
+ "name": "amountBase",
756
+ "type": "int128"
757
+ },
758
+ {
759
+ "internalType": "int128",
760
+ "name": "quoteAmountLow",
761
+ "type": "int128"
762
+ },
763
+ {
764
+ "internalType": "int128",
765
+ "name": "quoteAmountHigh",
766
+ "type": "int128"
767
+ }
768
+ ],
769
+ "name": "mintLp",
770
+ "outputs": [],
771
+ "stateMutability": "nonpayable",
772
+ "type": "function"
773
+ },
774
+ {
775
+ "inputs": [
776
+ {
777
+ "internalType": "bytes32",
778
+ "name": "subaccount",
779
+ "type": "bytes32"
780
+ },
781
+ {
782
+ "internalType": "uint256",
783
+ "name": "productIds",
784
+ "type": "uint256"
785
+ }
786
+ ],
787
+ "name": "settlePnl",
788
+ "outputs": [
789
+ {
790
+ "internalType": "int128",
791
+ "name": "",
792
+ "type": "int128"
793
+ }
794
+ ],
795
+ "stateMutability": "nonpayable",
796
+ "type": "function"
797
+ },
798
+ {
799
+ "inputs": [
800
+ {
801
+ "internalType": "bytes32",
802
+ "name": "subaccount",
803
+ "type": "bytes32"
804
+ },
805
+ {
806
+ "internalType": "int128",
807
+ "name": "insurance",
808
+ "type": "int128"
809
+ }
810
+ ],
811
+ "name": "socializeSubaccount",
812
+ "outputs": [
813
+ {
814
+ "internalType": "int128",
815
+ "name": "",
816
+ "type": "int128"
817
+ }
818
+ ],
819
+ "stateMutability": "nonpayable",
820
+ "type": "function"
821
+ },
822
+ {
823
+ "inputs": [
824
+ {
825
+ "internalType": "uint32",
826
+ "name": "productId",
827
+ "type": "uint32"
828
+ },
829
+ {
830
+ "internalType": "int128",
831
+ "name": "baseDelta",
832
+ "type": "int128"
833
+ },
834
+ {
835
+ "internalType": "int128",
836
+ "name": "quoteDelta",
837
+ "type": "int128"
838
+ }
839
+ ],
840
+ "name": "swapLp",
841
+ "outputs": [
842
+ {
843
+ "internalType": "int128",
844
+ "name": "",
845
+ "type": "int128"
846
+ },
847
+ {
848
+ "internalType": "int128",
849
+ "name": "",
850
+ "type": "int128"
851
+ }
852
+ ],
853
+ "stateMutability": "nonpayable",
854
+ "type": "function"
855
+ },
856
+ {
857
+ "inputs": [
858
+ {
859
+ "internalType": "uint32",
860
+ "name": "productId",
861
+ "type": "uint32"
862
+ },
863
+ {
864
+ "internalType": "int128",
865
+ "name": "amount",
866
+ "type": "int128"
867
+ },
868
+ {
869
+ "internalType": "int128",
870
+ "name": "priceX18",
871
+ "type": "int128"
872
+ },
873
+ {
874
+ "internalType": "int128",
875
+ "name": "sizeIncrement",
876
+ "type": "int128"
877
+ },
878
+ {
879
+ "internalType": "int128",
880
+ "name": "lpSpreadX18",
881
+ "type": "int128"
882
+ }
883
+ ],
884
+ "name": "swapLp",
885
+ "outputs": [
886
+ {
887
+ "internalType": "int128",
888
+ "name": "",
889
+ "type": "int128"
890
+ },
891
+ {
892
+ "internalType": "int128",
893
+ "name": "",
894
+ "type": "int128"
895
+ }
896
+ ],
897
+ "stateMutability": "nonpayable",
898
+ "type": "function"
899
+ },
900
+ {
901
+ "inputs": [
902
+ {
903
+ "internalType": "bytes",
904
+ "name": "txn",
905
+ "type": "bytes"
906
+ }
907
+ ],
908
+ "name": "updateProduct",
909
+ "outputs": [],
910
+ "stateMutability": "nonpayable",
911
+ "type": "function"
912
+ },
913
+ {
914
+ "inputs": [
915
+ {
916
+ "internalType": "uint128",
917
+ "name": "dt",
918
+ "type": "uint128"
919
+ },
920
+ {
921
+ "internalType": "int128[]",
922
+ "name": "avgPriceDiffs",
923
+ "type": "int128[]"
924
+ }
925
+ ],
926
+ "name": "updateStates",
927
+ "outputs": [],
928
+ "stateMutability": "nonpayable",
929
+ "type": "function"
930
+ }
931
+ ]