@the-situation/artifacts 0.5.0-alpha.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.
@@ -0,0 +1,786 @@
1
+ [
2
+ {
3
+ "type": "impl",
4
+ "name": "ExtensionImpl",
5
+ "interface_name": "the_situation::onchain::extension::interface::IExtension"
6
+ },
7
+ {
8
+ "type": "enum",
9
+ "name": "core::bool",
10
+ "variants": [
11
+ {
12
+ "name": "False",
13
+ "type": "()"
14
+ },
15
+ {
16
+ "name": "True",
17
+ "type": "()"
18
+ }
19
+ ]
20
+ },
21
+ {
22
+ "type": "struct",
23
+ "name": "the_situation::types::sq128::types::SQ128x128Raw",
24
+ "members": [
25
+ {
26
+ "name": "limb0",
27
+ "type": "core::integer::u64"
28
+ },
29
+ {
30
+ "name": "limb1",
31
+ "type": "core::integer::u64"
32
+ },
33
+ {
34
+ "name": "limb2",
35
+ "type": "core::integer::u64"
36
+ },
37
+ {
38
+ "name": "limb3",
39
+ "type": "core::integer::u64"
40
+ },
41
+ {
42
+ "name": "neg",
43
+ "type": "core::bool"
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "type": "struct",
49
+ "name": "the_situation::types::normal_distribution::NormalDistributionRaw",
50
+ "members": [
51
+ {
52
+ "name": "mean",
53
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
54
+ },
55
+ {
56
+ "name": "variance",
57
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
58
+ },
59
+ {
60
+ "name": "sigma",
61
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "type": "struct",
67
+ "name": "the_situation::onchain::extension::market_key::MarketKey",
68
+ "members": [
69
+ {
70
+ "name": "collateral_token",
71
+ "type": "core::starknet::contract_address::ContractAddress"
72
+ },
73
+ {
74
+ "name": "initial_distribution",
75
+ "type": "the_situation::types::normal_distribution::NormalDistributionRaw"
76
+ },
77
+ {
78
+ "name": "k",
79
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
80
+ },
81
+ {
82
+ "name": "initial_backing",
83
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
84
+ },
85
+ {
86
+ "name": "extension",
87
+ "type": "core::starknet::contract_address::ContractAddress"
88
+ },
89
+ {
90
+ "name": "metadata_hash",
91
+ "type": "core::felt252"
92
+ }
93
+ ]
94
+ },
95
+ {
96
+ "type": "struct",
97
+ "name": "core::integer::u256",
98
+ "members": [
99
+ {
100
+ "name": "low",
101
+ "type": "core::integer::u128"
102
+ },
103
+ {
104
+ "name": "high",
105
+ "type": "core::integer::u128"
106
+ }
107
+ ]
108
+ },
109
+ {
110
+ "type": "struct",
111
+ "name": "the_situation::onchain::common::NormalSqrtHintsRaw",
112
+ "members": [
113
+ {
114
+ "name": "l2_norm_denom",
115
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
116
+ },
117
+ {
118
+ "name": "backing_denom",
119
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ "type": "struct",
125
+ "name": "the_situation::onchain::extension::params::TradeParams",
126
+ "members": [
127
+ {
128
+ "name": "candidate",
129
+ "type": "the_situation::types::normal_distribution::NormalDistributionRaw"
130
+ },
131
+ {
132
+ "name": "x_star",
133
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
134
+ },
135
+ {
136
+ "name": "supplied_collateral",
137
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
138
+ },
139
+ {
140
+ "name": "candidate_hints",
141
+ "type": "the_situation::onchain::common::NormalSqrtHintsRaw"
142
+ }
143
+ ]
144
+ },
145
+ {
146
+ "type": "struct",
147
+ "name": "the_situation::onchain::extension::params::MarketSnapshot",
148
+ "members": [
149
+ {
150
+ "name": "mean",
151
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
152
+ },
153
+ {
154
+ "name": "variance",
155
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
156
+ },
157
+ {
158
+ "name": "sigma",
159
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
160
+ },
161
+ {
162
+ "name": "total_backing",
163
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
164
+ },
165
+ {
166
+ "name": "total_shares",
167
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
168
+ },
169
+ {
170
+ "name": "block_timestamp",
171
+ "type": "core::integer::u64"
172
+ }
173
+ ]
174
+ },
175
+ {
176
+ "type": "struct",
177
+ "name": "the_situation::onchain::extension::params::TradeDelta",
178
+ "members": [
179
+ {
180
+ "name": "token_amount",
181
+ "type": "core::integer::u256"
182
+ },
183
+ {
184
+ "name": "old_distribution",
185
+ "type": "the_situation::types::normal_distribution::NormalDistributionRaw"
186
+ },
187
+ {
188
+ "name": "new_distribution",
189
+ "type": "the_situation::types::normal_distribution::NormalDistributionRaw"
190
+ },
191
+ {
192
+ "name": "delta_index",
193
+ "type": "core::integer::u32"
194
+ },
195
+ {
196
+ "name": "is_valid",
197
+ "type": "core::bool"
198
+ }
199
+ ]
200
+ },
201
+ {
202
+ "type": "struct",
203
+ "name": "the_situation::onchain::extension::params::LiquidityParams",
204
+ "members": [
205
+ {
206
+ "name": "share_amount",
207
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
208
+ }
209
+ ]
210
+ },
211
+ {
212
+ "type": "struct",
213
+ "name": "the_situation::onchain::extension::params::LiquidityDelta",
214
+ "members": [
215
+ {
216
+ "name": "token_amount",
217
+ "type": "core::integer::u256"
218
+ },
219
+ {
220
+ "name": "shares",
221
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
222
+ },
223
+ {
224
+ "name": "total_shares",
225
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
226
+ },
227
+ {
228
+ "name": "total_backing",
229
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
230
+ }
231
+ ]
232
+ },
233
+ {
234
+ "type": "struct",
235
+ "name": "the_situation::onchain::extension::params::ClaimDelta",
236
+ "members": [
237
+ {
238
+ "name": "position_value",
239
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
240
+ },
241
+ {
242
+ "name": "collateral_returned",
243
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
244
+ },
245
+ {
246
+ "name": "token_payout",
247
+ "type": "core::integer::u256"
248
+ },
249
+ {
250
+ "name": "settlement_fee",
251
+ "type": "core::integer::u256"
252
+ }
253
+ ]
254
+ },
255
+ {
256
+ "type": "interface",
257
+ "name": "the_situation::onchain::extension::interface::IExtension",
258
+ "items": [
259
+ {
260
+ "type": "function",
261
+ "name": "before_initialize",
262
+ "inputs": [
263
+ {
264
+ "name": "caller",
265
+ "type": "core::starknet::contract_address::ContractAddress"
266
+ },
267
+ {
268
+ "name": "market_key",
269
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
270
+ },
271
+ {
272
+ "name": "initial_backing",
273
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
274
+ }
275
+ ],
276
+ "outputs": [],
277
+ "state_mutability": "external"
278
+ },
279
+ {
280
+ "type": "function",
281
+ "name": "after_initialize",
282
+ "inputs": [
283
+ {
284
+ "name": "caller",
285
+ "type": "core::starknet::contract_address::ContractAddress"
286
+ },
287
+ {
288
+ "name": "market_key",
289
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
290
+ },
291
+ {
292
+ "name": "initial_backing",
293
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
294
+ },
295
+ {
296
+ "name": "token_amount",
297
+ "type": "core::integer::u256"
298
+ }
299
+ ],
300
+ "outputs": [],
301
+ "state_mutability": "external"
302
+ },
303
+ {
304
+ "type": "function",
305
+ "name": "before_trade",
306
+ "inputs": [
307
+ {
308
+ "name": "caller",
309
+ "type": "core::starknet::contract_address::ContractAddress"
310
+ },
311
+ {
312
+ "name": "market_key",
313
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
314
+ },
315
+ {
316
+ "name": "params",
317
+ "type": "the_situation::onchain::extension::params::TradeParams"
318
+ },
319
+ {
320
+ "name": "snapshot",
321
+ "type": "the_situation::onchain::extension::params::MarketSnapshot"
322
+ }
323
+ ],
324
+ "outputs": [],
325
+ "state_mutability": "external"
326
+ },
327
+ {
328
+ "type": "function",
329
+ "name": "after_trade",
330
+ "inputs": [
331
+ {
332
+ "name": "caller",
333
+ "type": "core::starknet::contract_address::ContractAddress"
334
+ },
335
+ {
336
+ "name": "market_key",
337
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
338
+ },
339
+ {
340
+ "name": "params",
341
+ "type": "the_situation::onchain::extension::params::TradeParams"
342
+ },
343
+ {
344
+ "name": "delta",
345
+ "type": "the_situation::onchain::extension::params::TradeDelta"
346
+ },
347
+ {
348
+ "name": "snapshot",
349
+ "type": "the_situation::onchain::extension::params::MarketSnapshot"
350
+ }
351
+ ],
352
+ "outputs": [],
353
+ "state_mutability": "external"
354
+ },
355
+ {
356
+ "type": "function",
357
+ "name": "before_add_liquidity",
358
+ "inputs": [
359
+ {
360
+ "name": "caller",
361
+ "type": "core::starknet::contract_address::ContractAddress"
362
+ },
363
+ {
364
+ "name": "market_key",
365
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
366
+ },
367
+ {
368
+ "name": "params",
369
+ "type": "the_situation::onchain::extension::params::LiquidityParams"
370
+ }
371
+ ],
372
+ "outputs": [],
373
+ "state_mutability": "external"
374
+ },
375
+ {
376
+ "type": "function",
377
+ "name": "after_add_liquidity",
378
+ "inputs": [
379
+ {
380
+ "name": "caller",
381
+ "type": "core::starknet::contract_address::ContractAddress"
382
+ },
383
+ {
384
+ "name": "market_key",
385
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
386
+ },
387
+ {
388
+ "name": "params",
389
+ "type": "the_situation::onchain::extension::params::LiquidityParams"
390
+ },
391
+ {
392
+ "name": "delta",
393
+ "type": "the_situation::onchain::extension::params::LiquidityDelta"
394
+ }
395
+ ],
396
+ "outputs": [],
397
+ "state_mutability": "external"
398
+ },
399
+ {
400
+ "type": "function",
401
+ "name": "before_remove_liquidity",
402
+ "inputs": [
403
+ {
404
+ "name": "caller",
405
+ "type": "core::starknet::contract_address::ContractAddress"
406
+ },
407
+ {
408
+ "name": "market_key",
409
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
410
+ },
411
+ {
412
+ "name": "params",
413
+ "type": "the_situation::onchain::extension::params::LiquidityParams"
414
+ }
415
+ ],
416
+ "outputs": [],
417
+ "state_mutability": "external"
418
+ },
419
+ {
420
+ "type": "function",
421
+ "name": "after_remove_liquidity",
422
+ "inputs": [
423
+ {
424
+ "name": "caller",
425
+ "type": "core::starknet::contract_address::ContractAddress"
426
+ },
427
+ {
428
+ "name": "market_key",
429
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
430
+ },
431
+ {
432
+ "name": "params",
433
+ "type": "the_situation::onchain::extension::params::LiquidityParams"
434
+ },
435
+ {
436
+ "name": "delta",
437
+ "type": "the_situation::onchain::extension::params::LiquidityDelta"
438
+ }
439
+ ],
440
+ "outputs": [],
441
+ "state_mutability": "external"
442
+ },
443
+ {
444
+ "type": "function",
445
+ "name": "before_claim",
446
+ "inputs": [
447
+ {
448
+ "name": "caller",
449
+ "type": "core::starknet::contract_address::ContractAddress"
450
+ },
451
+ {
452
+ "name": "market_key",
453
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
454
+ }
455
+ ],
456
+ "outputs": [],
457
+ "state_mutability": "external"
458
+ },
459
+ {
460
+ "type": "function",
461
+ "name": "after_claim",
462
+ "inputs": [
463
+ {
464
+ "name": "caller",
465
+ "type": "core::starknet::contract_address::ContractAddress"
466
+ },
467
+ {
468
+ "name": "market_key",
469
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
470
+ },
471
+ {
472
+ "name": "delta",
473
+ "type": "the_situation::onchain::extension::params::ClaimDelta"
474
+ }
475
+ ],
476
+ "outputs": [],
477
+ "state_mutability": "external"
478
+ },
479
+ {
480
+ "type": "function",
481
+ "name": "before_settle",
482
+ "inputs": [
483
+ {
484
+ "name": "caller",
485
+ "type": "core::starknet::contract_address::ContractAddress"
486
+ },
487
+ {
488
+ "name": "market_key",
489
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
490
+ },
491
+ {
492
+ "name": "settlement_value",
493
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
494
+ }
495
+ ],
496
+ "outputs": [],
497
+ "state_mutability": "external"
498
+ },
499
+ {
500
+ "type": "function",
501
+ "name": "after_settle",
502
+ "inputs": [
503
+ {
504
+ "name": "caller",
505
+ "type": "core::starknet::contract_address::ContractAddress"
506
+ },
507
+ {
508
+ "name": "market_key",
509
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
510
+ },
511
+ {
512
+ "name": "settlement_value",
513
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
514
+ },
515
+ {
516
+ "name": "final_snapshot",
517
+ "type": "the_situation::onchain::extension::params::MarketSnapshot"
518
+ }
519
+ ],
520
+ "outputs": [],
521
+ "state_mutability": "external"
522
+ }
523
+ ]
524
+ },
525
+ {
526
+ "type": "impl",
527
+ "name": "OracleImpl",
528
+ "interface_name": "the_situation::extensions::oracle::interface::IOracle"
529
+ },
530
+ {
531
+ "type": "struct",
532
+ "name": "the_situation::types::cumulative256::types::Cumulative256Raw",
533
+ "members": [
534
+ {
535
+ "name": "limb0",
536
+ "type": "core::integer::u64"
537
+ },
538
+ {
539
+ "name": "limb1",
540
+ "type": "core::integer::u64"
541
+ },
542
+ {
543
+ "name": "limb2",
544
+ "type": "core::integer::u64"
545
+ },
546
+ {
547
+ "name": "limb3",
548
+ "type": "core::integer::u64"
549
+ },
550
+ {
551
+ "name": "neg",
552
+ "type": "core::bool"
553
+ }
554
+ ]
555
+ },
556
+ {
557
+ "type": "struct",
558
+ "name": "the_situation::extensions::oracle::types::SnapshotRaw",
559
+ "members": [
560
+ {
561
+ "name": "block_timestamp",
562
+ "type": "core::integer::u64"
563
+ },
564
+ {
565
+ "name": "mean_cumulative",
566
+ "type": "the_situation::types::cumulative256::types::Cumulative256Raw"
567
+ },
568
+ {
569
+ "name": "variance_cumulative",
570
+ "type": "the_situation::types::cumulative256::types::Cumulative256Raw"
571
+ }
572
+ ]
573
+ },
574
+ {
575
+ "type": "interface",
576
+ "name": "the_situation::extensions::oracle::interface::IOracle",
577
+ "items": [
578
+ {
579
+ "type": "function",
580
+ "name": "get_average_mean_over_period",
581
+ "inputs": [
582
+ {
583
+ "name": "market_key",
584
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
585
+ },
586
+ {
587
+ "name": "start_time",
588
+ "type": "core::integer::u64"
589
+ },
590
+ {
591
+ "name": "end_time",
592
+ "type": "core::integer::u64"
593
+ }
594
+ ],
595
+ "outputs": [
596
+ {
597
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
598
+ }
599
+ ],
600
+ "state_mutability": "view"
601
+ },
602
+ {
603
+ "type": "function",
604
+ "name": "get_average_mean_over_last",
605
+ "inputs": [
606
+ {
607
+ "name": "market_key",
608
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
609
+ },
610
+ {
611
+ "name": "period_seconds",
612
+ "type": "core::integer::u64"
613
+ }
614
+ ],
615
+ "outputs": [
616
+ {
617
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
618
+ }
619
+ ],
620
+ "state_mutability": "view"
621
+ },
622
+ {
623
+ "type": "function",
624
+ "name": "get_average_variance_over_period",
625
+ "inputs": [
626
+ {
627
+ "name": "market_key",
628
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
629
+ },
630
+ {
631
+ "name": "start_time",
632
+ "type": "core::integer::u64"
633
+ },
634
+ {
635
+ "name": "end_time",
636
+ "type": "core::integer::u64"
637
+ }
638
+ ],
639
+ "outputs": [
640
+ {
641
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
642
+ }
643
+ ],
644
+ "state_mutability": "view"
645
+ },
646
+ {
647
+ "type": "function",
648
+ "name": "get_average_variance_over_last",
649
+ "inputs": [
650
+ {
651
+ "name": "market_key",
652
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
653
+ },
654
+ {
655
+ "name": "period_seconds",
656
+ "type": "core::integer::u64"
657
+ }
658
+ ],
659
+ "outputs": [
660
+ {
661
+ "type": "the_situation::types::sq128::types::SQ128x128Raw"
662
+ }
663
+ ],
664
+ "state_mutability": "view"
665
+ },
666
+ {
667
+ "type": "function",
668
+ "name": "get_earliest_observation_time",
669
+ "inputs": [
670
+ {
671
+ "name": "market_key",
672
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
673
+ }
674
+ ],
675
+ "outputs": [
676
+ {
677
+ "type": "core::integer::u64"
678
+ }
679
+ ],
680
+ "state_mutability": "view"
681
+ },
682
+ {
683
+ "type": "function",
684
+ "name": "get_latest_observation_time",
685
+ "inputs": [
686
+ {
687
+ "name": "market_key",
688
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
689
+ }
690
+ ],
691
+ "outputs": [
692
+ {
693
+ "type": "core::integer::u64"
694
+ }
695
+ ],
696
+ "state_mutability": "view"
697
+ },
698
+ {
699
+ "type": "function",
700
+ "name": "get_snapshot_count",
701
+ "inputs": [
702
+ {
703
+ "name": "market_key",
704
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
705
+ }
706
+ ],
707
+ "outputs": [
708
+ {
709
+ "type": "core::integer::u64"
710
+ }
711
+ ],
712
+ "state_mutability": "view"
713
+ },
714
+ {
715
+ "type": "function",
716
+ "name": "get_snapshot",
717
+ "inputs": [
718
+ {
719
+ "name": "market_key",
720
+ "type": "the_situation::onchain::extension::market_key::MarketKey"
721
+ },
722
+ {
723
+ "name": "index",
724
+ "type": "core::integer::u64"
725
+ }
726
+ ],
727
+ "outputs": [
728
+ {
729
+ "type": "the_situation::extensions::oracle::types::SnapshotRaw"
730
+ }
731
+ ],
732
+ "state_mutability": "view"
733
+ },
734
+ {
735
+ "type": "function",
736
+ "name": "get_amm",
737
+ "inputs": [],
738
+ "outputs": [
739
+ {
740
+ "type": "core::starknet::contract_address::ContractAddress"
741
+ }
742
+ ],
743
+ "state_mutability": "view"
744
+ }
745
+ ]
746
+ },
747
+ {
748
+ "type": "constructor",
749
+ "name": "constructor",
750
+ "inputs": []
751
+ },
752
+ {
753
+ "type": "event",
754
+ "name": "the_situation::extensions::oracle::contract::oracle::SnapshotRecorded",
755
+ "kind": "struct",
756
+ "members": [
757
+ {
758
+ "name": "market_key_hash",
759
+ "type": "core::felt252",
760
+ "kind": "key"
761
+ },
762
+ {
763
+ "name": "snapshot_index",
764
+ "type": "core::integer::u64",
765
+ "kind": "data"
766
+ },
767
+ {
768
+ "name": "block_timestamp",
769
+ "type": "core::integer::u64",
770
+ "kind": "data"
771
+ }
772
+ ]
773
+ },
774
+ {
775
+ "type": "event",
776
+ "name": "the_situation::extensions::oracle::contract::oracle::Event",
777
+ "kind": "enum",
778
+ "variants": [
779
+ {
780
+ "name": "SnapshotRecorded",
781
+ "type": "the_situation::extensions::oracle::contract::oracle::SnapshotRecorded",
782
+ "kind": "nested"
783
+ }
784
+ ]
785
+ }
786
+ ]