afp-sdk 0.5.4__py3-none-any.whl → 0.6.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 (49) hide show
  1. afp/__init__.py +4 -1
  2. afp/afp.py +11 -0
  3. afp/api/admin.py +1 -1
  4. afp/api/base.py +11 -2
  5. afp/api/margin_account.py +12 -148
  6. afp/api/product.py +302 -148
  7. afp/api/trading.py +10 -19
  8. afp/auth.py +14 -0
  9. afp/bindings/__init__.py +30 -16
  10. afp/bindings/admin_facet.py +890 -0
  11. afp/bindings/clearing_facet.py +356 -773
  12. afp/bindings/facade.py +9 -6
  13. afp/bindings/final_settlement_facet.py +258 -99
  14. afp/bindings/margin_account.py +524 -839
  15. afp/bindings/margin_account_facet.py +722 -0
  16. afp/bindings/margin_account_registry.py +184 -310
  17. afp/bindings/mark_price_tracker_facet.py +74 -16
  18. afp/bindings/product_registry.py +1577 -541
  19. afp/bindings/product_registry_facet.py +1467 -0
  20. afp/bindings/system_viewer.py +592 -369
  21. afp/bindings/types.py +223 -0
  22. afp/config.py +4 -0
  23. afp/constants.py +49 -6
  24. afp/decorators.py +25 -3
  25. afp/dtos.py +142 -0
  26. afp/exceptions.py +10 -0
  27. afp/exchange.py +10 -8
  28. afp/hashing.py +7 -5
  29. afp/ipfs.py +245 -0
  30. afp/json-schemas/bafyreiaw34o6l3rmatabzbds2i2myazdw2yolevcpsoyd2i2g3ms7wa2eq.json +1 -0
  31. afp/json-schemas/bafyreibnfg6nq74dvpkre5rakkccij7iadp5rxpim7omsatjnrpmj3y7v4.json +1 -0
  32. afp/json-schemas/bafyreicgr6dfo5yduixjkcifghiulskfegwojvuwodtouvivl362zndhxe.json +1 -0
  33. afp/json-schemas/bafyreicheoypx6synljushh7mq2572iyhlolf4nake2p5dwobgnj3r5eua.json +1 -0
  34. afp/json-schemas/bafyreid35a67db4sqh4fs6boddyt2xvscbqy6nqvsp5jjur56qhkw4ixre.json +1 -0
  35. afp/json-schemas/bafyreidzs7okcpqiss6ztftltyptqwnw5e5opsy5yntospekjha4kpykaa.json +1 -0
  36. afp/json-schemas/bafyreifcec2km7hxwq6oqzjlspni2mgipetjb7pqtaewh2efislzoctboi.json +1 -0
  37. afp/json-schemas/bafyreihn3oiaxffe4e2w7pwtreadpw3obfd7gqlogbcxm56jc2hzfvco74.json +1 -0
  38. afp/json-schemas/bafyreihur3dzwhja6uxsbcw6eeoj3xmmc4e3zkmyzpot5v5dleevxe5zam.json +1 -0
  39. afp/schemas.py +227 -177
  40. afp/types.py +169 -0
  41. afp/validators.py +218 -8
  42. {afp_sdk-0.5.4.dist-info → afp_sdk-0.6.0.dist-info}/METADATA +73 -10
  43. afp_sdk-0.6.0.dist-info/RECORD +50 -0
  44. afp/bindings/auctioneer_facet.py +0 -752
  45. afp/bindings/bankruptcy_facet.py +0 -391
  46. afp/bindings/trading_protocol.py +0 -1158
  47. afp_sdk-0.5.4.dist-info/RECORD +0 -37
  48. {afp_sdk-0.5.4.dist-info → afp_sdk-0.6.0.dist-info}/WHEEL +0 -0
  49. {afp_sdk-0.5.4.dist-info → afp_sdk-0.6.0.dist-info}/licenses/LICENSE +0 -0
@@ -2,64 +2,26 @@
2
2
 
3
3
  # This module has been generated using pyabigen v0.2.16
4
4
 
5
- import enum
6
5
  import typing
7
- from dataclasses import dataclass
8
6
 
9
7
  import eth_typing
10
8
  import hexbytes
11
9
  import web3
10
+ from web3 import types
12
11
  from web3.contract import contract
13
12
 
14
-
15
- class ProductState(enum.IntEnum):
16
- """Port of `enum ProductState` on the ProductRegistry contract."""
17
-
18
- NOT_EXIST = 0
19
- PENDING = 1
20
- LIVE = 2
21
- TRADEOUT = 3
22
- FINAL_SETTLEMENT = 4
23
- EXPIRED = 5
24
-
25
-
26
- @dataclass
27
- class ProductMetadata:
28
- """Port of `struct ProductMetadata` on the IProductRegistry contract."""
29
-
30
- builder: eth_typing.ChecksumAddress
31
- symbol: str
32
- description: str
33
-
34
-
35
- @dataclass
36
- class OracleSpecification:
37
- """Port of `struct OracleSpecification` on the IProductRegistry contract."""
38
-
39
- oracle_address: eth_typing.ChecksumAddress
40
- fsv_decimals: int
41
- fsp_alpha: int
42
- fsp_beta: int
43
- fsv_calldata: hexbytes.HexBytes
44
-
45
-
46
- @dataclass
47
- class Product:
48
- """Port of `struct Product` on the IProductRegistry contract."""
49
-
50
- metadata: ProductMetadata
51
- oracle_spec: OracleSpecification
52
- price_quotation: str
53
- collateral_asset: eth_typing.ChecksumAddress
54
- start_time: int
55
- earliest_fsp_submission_time: int
56
- unit_value: int
57
- initial_margin_requirement: int
58
- maintenance_margin_requirement: int
59
- auction_bounty: int
60
- tradeout_interval: int
61
- tick_size: int
62
- extended_metadata: str
13
+ from .types import (
14
+ ProductState,
15
+ ExpirySpecification,
16
+ PendingStakeData,
17
+ BuilderStakeData,
18
+ ProductMetadata,
19
+ OracleSpecification,
20
+ BaseProduct,
21
+ MarginSpecification,
22
+ FuturesProductV1,
23
+ PredictionProductV1,
24
+ )
63
25
 
64
26
 
65
27
  class ProductRegistry:
@@ -106,56 +68,189 @@ class ProductRegistry:
106
68
 
107
69
  def upgrade_interface_version(
108
70
  self,
71
+ block_identifier: types.BlockIdentifier = "latest",
109
72
  ) -> str:
110
73
  """Binding for `UPGRADE_INTERFACE_VERSION` on the ProductRegistry contract.
111
74
 
75
+ Parameters
76
+ ----------
77
+ block_identifier : web3.types.BlockIdentifier
78
+ The block identifier, defaults to the latest block.
79
+
112
80
  Returns
113
81
  -------
114
82
  str
115
83
  """
116
- return_value = self._contract.functions.UPGRADE_INTERFACE_VERSION().call()
84
+ return_value = self._contract.functions.UPGRADE_INTERFACE_VERSION().call(
85
+ block_identifier=block_identifier
86
+ )
117
87
  return str(return_value)
118
88
 
119
- def auction_bounty(
89
+ def add_allowed(
90
+ self,
91
+ addr: eth_typing.ChecksumAddress,
92
+ ) -> contract.ContractFunction:
93
+ """Binding for `addAllowed` on the ProductRegistry contract.
94
+
95
+ Parameters
96
+ ----------
97
+ addr : eth_typing.ChecksumAddress
98
+
99
+ Returns
100
+ -------
101
+ web3.contract.contract.ContractFunction
102
+ A contract function instance to be sent in a transaction.
103
+ """
104
+ return self._contract.functions.addAllowed(
105
+ addr,
106
+ )
107
+
108
+ def admin(
109
+ self,
110
+ block_identifier: types.BlockIdentifier = "latest",
111
+ ) -> eth_typing.ChecksumAddress:
112
+ """Binding for `admin` on the ProductRegistry contract.
113
+
114
+ Parameters
115
+ ----------
116
+ block_identifier : web3.types.BlockIdentifier
117
+ The block identifier, defaults to the latest block.
118
+
119
+ Returns
120
+ -------
121
+ eth_typing.ChecksumAddress
122
+ """
123
+ return_value = self._contract.functions.admin().call(
124
+ block_identifier=block_identifier
125
+ )
126
+ return eth_typing.ChecksumAddress(return_value)
127
+
128
+ def allowed(
129
+ self,
130
+ block_identifier: types.BlockIdentifier = "latest",
131
+ ) -> typing.List[eth_typing.ChecksumAddress]:
132
+ """Binding for `allowed` on the ProductRegistry contract.
133
+
134
+ Parameters
135
+ ----------
136
+ block_identifier : web3.types.BlockIdentifier
137
+ The block identifier, defaults to the latest block.
138
+
139
+ Returns
140
+ -------
141
+ typing.List[eth_typing.ChecksumAddress]
142
+ """
143
+ return_value = self._contract.functions.allowed().call(
144
+ block_identifier=block_identifier
145
+ )
146
+ return [
147
+ eth_typing.ChecksumAddress(return_value_elem)
148
+ for return_value_elem in return_value
149
+ ]
150
+
151
+ def builder_stake_data(
120
152
  self,
121
153
  product_id: hexbytes.HexBytes,
122
- ) -> int:
123
- """Binding for `auctionBounty` on the ProductRegistry contract.
154
+ block_identifier: types.BlockIdentifier = "latest",
155
+ ) -> BuilderStakeData:
156
+ """Binding for `builderStakeData` on the ProductRegistry contract.
157
+
158
+ Parameters
159
+ ----------
160
+ product_id : hexbytes.HexBytes
161
+ block_identifier : web3.types.BlockIdentifier
162
+ The block identifier, defaults to the latest block.
163
+
164
+ Returns
165
+ -------
166
+ BuilderStakeData
167
+ """
168
+ return_value = self._contract.functions.builderStakeData(
169
+ product_id,
170
+ ).call(block_identifier=block_identifier)
171
+ return BuilderStakeData(
172
+ int(return_value[0]),
173
+ int(return_value[1]),
174
+ PendingStakeData(int(return_value[2][0]), int(return_value[2][1])),
175
+ )
176
+
177
+ def claim_builder_rewards(
178
+ self,
179
+ product_id: hexbytes.HexBytes,
180
+ ) -> contract.ContractFunction:
181
+ """Binding for `claimBuilderRewards` on the ProductRegistry contract.
182
+
183
+ Parameters
184
+ ----------
185
+ product_id : hexbytes.HexBytes
186
+
187
+ Returns
188
+ -------
189
+ web3.contract.contract.ContractFunction
190
+ A contract function instance to be sent in a transaction.
191
+ """
192
+ return self._contract.functions.claimBuilderRewards(
193
+ product_id,
194
+ )
195
+
196
+ def claimable_builder_rewards(
197
+ self,
198
+ product_id: hexbytes.HexBytes,
199
+ block_identifier: types.BlockIdentifier = "latest",
200
+ ) -> typing.Tuple[int, int]:
201
+ """Binding for `claimableBuilderRewards` on the ProductRegistry contract.
124
202
 
125
203
  Parameters
126
204
  ----------
127
205
  product_id : hexbytes.HexBytes
206
+ block_identifier : web3.types.BlockIdentifier
207
+ The block identifier, defaults to the latest block.
128
208
 
129
209
  Returns
130
210
  -------
131
211
  int
212
+ int
132
213
  """
133
- return_value = self._contract.functions.auctionBounty(
214
+ return_value = self._contract.functions.claimableBuilderRewards(
134
215
  product_id,
135
- ).call()
136
- return int(return_value)
216
+ ).call(block_identifier=block_identifier)
217
+ return (
218
+ int(return_value[0]),
219
+ int(return_value[1]),
220
+ )
137
221
 
138
222
  def clearing(
139
223
  self,
224
+ block_identifier: types.BlockIdentifier = "latest",
140
225
  ) -> eth_typing.ChecksumAddress:
141
226
  """Binding for `clearing` on the ProductRegistry contract.
142
227
 
228
+ Parameters
229
+ ----------
230
+ block_identifier : web3.types.BlockIdentifier
231
+ The block identifier, defaults to the latest block.
232
+
143
233
  Returns
144
234
  -------
145
235
  eth_typing.ChecksumAddress
146
236
  """
147
- return_value = self._contract.functions.clearing().call()
237
+ return_value = self._contract.functions.clearing().call(
238
+ block_identifier=block_identifier
239
+ )
148
240
  return eth_typing.ChecksumAddress(return_value)
149
241
 
150
242
  def collateral_asset(
151
243
  self,
152
244
  product_id: hexbytes.HexBytes,
245
+ block_identifier: types.BlockIdentifier = "latest",
153
246
  ) -> eth_typing.ChecksumAddress:
154
247
  """Binding for `collateralAsset` on the ProductRegistry contract.
155
248
 
156
249
  Parameters
157
250
  ----------
158
251
  product_id : hexbytes.HexBytes
252
+ block_identifier : web3.types.BlockIdentifier
253
+ The block identifier, defaults to the latest block.
159
254
 
160
255
  Returns
161
256
  -------
@@ -163,18 +258,21 @@ class ProductRegistry:
163
258
  """
164
259
  return_value = self._contract.functions.collateralAsset(
165
260
  product_id,
166
- ).call()
261
+ ).call(block_identifier=block_identifier)
167
262
  return eth_typing.ChecksumAddress(return_value)
168
263
 
169
264
  def earliest_fsp_submission_time(
170
265
  self,
171
266
  product_id: hexbytes.HexBytes,
267
+ block_identifier: types.BlockIdentifier = "latest",
172
268
  ) -> int:
173
269
  """Binding for `earliestFSPSubmissionTime` on the ProductRegistry contract.
174
270
 
175
271
  Parameters
176
272
  ----------
177
273
  product_id : hexbytes.HexBytes
274
+ block_identifier : web3.types.BlockIdentifier
275
+ The block identifier, defaults to the latest block.
178
276
 
179
277
  Returns
180
278
  -------
@@ -182,18 +280,65 @@ class ProductRegistry:
182
280
  """
183
281
  return_value = self._contract.functions.earliestFSPSubmissionTime(
184
282
  product_id,
185
- ).call()
283
+ ).call(block_identifier=block_identifier)
186
284
  return int(return_value)
187
285
 
286
+ def futures_product_v1(
287
+ self,
288
+ product_id: hexbytes.HexBytes,
289
+ block_identifier: types.BlockIdentifier = "latest",
290
+ ) -> FuturesProductV1:
291
+ """Binding for `futuresProductV1` on the ProductRegistry contract.
292
+
293
+ Parameters
294
+ ----------
295
+ product_id : hexbytes.HexBytes
296
+ block_identifier : web3.types.BlockIdentifier
297
+ The block identifier, defaults to the latest block.
298
+
299
+ Returns
300
+ -------
301
+ FuturesProductV1
302
+ """
303
+ return_value = self._contract.functions.futuresProductV1(
304
+ product_id,
305
+ ).call(block_identifier=block_identifier)
306
+ return FuturesProductV1(
307
+ BaseProduct(
308
+ ProductMetadata(
309
+ eth_typing.ChecksumAddress(return_value[0][0][0]),
310
+ str(return_value[0][0][1]),
311
+ str(return_value[0][0][2]),
312
+ ),
313
+ OracleSpecification(
314
+ eth_typing.ChecksumAddress(return_value[0][1][0]),
315
+ int(return_value[0][1][1]),
316
+ int(return_value[0][1][2]),
317
+ int(return_value[0][1][3]),
318
+ hexbytes.HexBytes(return_value[0][1][4]),
319
+ ),
320
+ eth_typing.ChecksumAddress(return_value[0][2]),
321
+ int(return_value[0][3]),
322
+ int(return_value[0][4]),
323
+ int(return_value[0][5]),
324
+ str(return_value[0][6]),
325
+ ),
326
+ ExpirySpecification(int(return_value[1][0]), int(return_value[1][1])),
327
+ MarginSpecification(int(return_value[2][0]), int(return_value[2][1])),
328
+ )
329
+
188
330
  def id(
189
331
  self,
190
- product: Product,
332
+ product: BaseProduct,
333
+ block_identifier: types.BlockIdentifier = "latest",
191
334
  ) -> hexbytes.HexBytes:
192
335
  """Binding for `id` on the ProductRegistry contract.
193
336
 
194
337
  Parameters
195
338
  ----------
196
- product : Product
339
+ product : BaseProduct
340
+ block_identifier : web3.types.BlockIdentifier
341
+ The block identifier, defaults to the latest block.
197
342
 
198
343
  Returns
199
344
  -------
@@ -213,61 +358,112 @@ class ProductRegistry:
213
358
  product.oracle_spec.fsp_beta,
214
359
  product.oracle_spec.fsv_calldata,
215
360
  ),
216
- product.price_quotation,
217
361
  product.collateral_asset,
218
362
  product.start_time,
219
- product.earliest_fsp_submission_time,
220
- product.unit_value,
221
- product.initial_margin_requirement,
222
- product.maintenance_margin_requirement,
223
- product.auction_bounty,
224
- product.tradeout_interval,
225
- product.tick_size,
363
+ product.point_value,
364
+ product.price_decimals,
226
365
  product.extended_metadata,
227
366
  ),
228
- ).call()
367
+ ).call(block_identifier=block_identifier)
229
368
  return hexbytes.HexBytes(return_value)
230
369
 
231
- def imr(
370
+ def increase_builder_stake(
232
371
  self,
233
372
  product_id: hexbytes.HexBytes,
234
- ) -> int:
235
- """Binding for `imr` on the ProductRegistry contract.
373
+ fee: int,
374
+ ) -> contract.ContractFunction:
375
+ """Binding for `increaseBuilderStake` on the ProductRegistry contract.
236
376
 
237
377
  Parameters
238
378
  ----------
239
379
  product_id : hexbytes.HexBytes
380
+ fee : int
240
381
 
241
382
  Returns
242
383
  -------
243
- int
384
+ web3.contract.contract.ContractFunction
385
+ A contract function instance to be sent in a transaction.
244
386
  """
245
- return_value = self._contract.functions.imr(
387
+ return self._contract.functions.increaseBuilderStake(
246
388
  product_id,
247
- ).call()
248
- return int(return_value)
389
+ fee,
390
+ )
249
391
 
250
392
  def initialize(
251
393
  self,
394
+ clearing_: eth_typing.ChecksumAddress,
252
395
  ) -> contract.ContractFunction:
253
396
  """Binding for `initialize` on the ProductRegistry contract.
254
397
 
398
+ Parameters
399
+ ----------
400
+ clearing_ : eth_typing.ChecksumAddress
401
+
255
402
  Returns
256
403
  -------
257
404
  web3.contract.contract.ContractFunction
258
405
  A contract function instance to be sent in a transaction.
259
406
  """
260
- return self._contract.functions.initialize()
407
+ return self._contract.functions.initialize(
408
+ clearing_,
409
+ )
410
+
411
+ def max_price(
412
+ self,
413
+ product_id: hexbytes.HexBytes,
414
+ block_identifier: types.BlockIdentifier = "latest",
415
+ ) -> int:
416
+ """Binding for `maxPrice` on the ProductRegistry contract.
417
+
418
+ Parameters
419
+ ----------
420
+ product_id : hexbytes.HexBytes
421
+ block_identifier : web3.types.BlockIdentifier
422
+ The block identifier, defaults to the latest block.
423
+
424
+ Returns
425
+ -------
426
+ int
427
+ """
428
+ return_value = self._contract.functions.maxPrice(
429
+ product_id,
430
+ ).call(block_identifier=block_identifier)
431
+ return int(return_value)
432
+
433
+ def min_price(
434
+ self,
435
+ product_id: hexbytes.HexBytes,
436
+ block_identifier: types.BlockIdentifier = "latest",
437
+ ) -> int:
438
+ """Binding for `minPrice` on the ProductRegistry contract.
439
+
440
+ Parameters
441
+ ----------
442
+ product_id : hexbytes.HexBytes
443
+ block_identifier : web3.types.BlockIdentifier
444
+ The block identifier, defaults to the latest block.
445
+
446
+ Returns
447
+ -------
448
+ int
449
+ """
450
+ return_value = self._contract.functions.minPrice(
451
+ product_id,
452
+ ).call(block_identifier=block_identifier)
453
+ return int(return_value)
261
454
 
262
455
  def mmr(
263
456
  self,
264
457
  product_id: hexbytes.HexBytes,
458
+ block_identifier: types.BlockIdentifier = "latest",
265
459
  ) -> int:
266
460
  """Binding for `mmr` on the ProductRegistry contract.
267
461
 
268
462
  Parameters
269
463
  ----------
270
464
  product_id : hexbytes.HexBytes
465
+ block_identifier : web3.types.BlockIdentifier
466
+ The block identifier, defaults to the latest block.
271
467
 
272
468
  Returns
273
469
  -------
@@ -275,18 +471,43 @@ class ProductRegistry:
275
471
  """
276
472
  return_value = self._contract.functions.mmr(
277
473
  product_id,
278
- ).call()
474
+ ).call(block_identifier=block_identifier)
475
+ return int(return_value)
476
+
477
+ def next_interval(
478
+ self,
479
+ product_id: hexbytes.HexBytes,
480
+ block_identifier: types.BlockIdentifier = "latest",
481
+ ) -> int:
482
+ """Binding for `nextInterval` on the ProductRegistry contract.
483
+
484
+ Parameters
485
+ ----------
486
+ product_id : hexbytes.HexBytes
487
+ block_identifier : web3.types.BlockIdentifier
488
+ The block identifier, defaults to the latest block.
489
+
490
+ Returns
491
+ -------
492
+ int
493
+ """
494
+ return_value = self._contract.functions.nextInterval(
495
+ product_id,
496
+ ).call(block_identifier=block_identifier)
279
497
  return int(return_value)
280
498
 
281
499
  def oracle_specification(
282
500
  self,
283
501
  product_id: hexbytes.HexBytes,
502
+ block_identifier: types.BlockIdentifier = "latest",
284
503
  ) -> OracleSpecification:
285
504
  """Binding for `oracleSpecification` on the ProductRegistry contract.
286
505
 
287
506
  Parameters
288
507
  ----------
289
508
  product_id : hexbytes.HexBytes
509
+ block_identifier : web3.types.BlockIdentifier
510
+ The block identifier, defaults to the latest block.
290
511
 
291
512
  Returns
292
513
  -------
@@ -294,7 +515,7 @@ class ProductRegistry:
294
515
  """
295
516
  return_value = self._contract.functions.oracleSpecification(
296
517
  product_id,
297
- ).call()
518
+ ).call(block_identifier=block_identifier)
298
519
  return OracleSpecification(
299
520
  eth_typing.ChecksumAddress(return_value[0]),
300
521
  int(return_value[1]),
@@ -305,25 +526,36 @@ class ProductRegistry:
305
526
 
306
527
  def owner(
307
528
  self,
529
+ block_identifier: types.BlockIdentifier = "latest",
308
530
  ) -> eth_typing.ChecksumAddress:
309
531
  """Binding for `owner` on the ProductRegistry contract.
310
532
 
533
+ Parameters
534
+ ----------
535
+ block_identifier : web3.types.BlockIdentifier
536
+ The block identifier, defaults to the latest block.
537
+
311
538
  Returns
312
539
  -------
313
540
  eth_typing.ChecksumAddress
314
541
  """
315
- return_value = self._contract.functions.owner().call()
542
+ return_value = self._contract.functions.owner().call(
543
+ block_identifier=block_identifier
544
+ )
316
545
  return eth_typing.ChecksumAddress(return_value)
317
546
 
318
547
  def point_value(
319
548
  self,
320
549
  product_id: hexbytes.HexBytes,
550
+ block_identifier: types.BlockIdentifier = "latest",
321
551
  ) -> int:
322
552
  """Binding for `pointValue` on the ProductRegistry contract.
323
553
 
324
554
  Parameters
325
555
  ----------
326
556
  product_id : hexbytes.HexBytes
557
+ block_identifier : web3.types.BlockIdentifier
558
+ The block identifier, defaults to the latest block.
327
559
 
328
560
  Returns
329
561
  -------
@@ -331,147 +563,348 @@ class ProductRegistry:
331
563
  """
332
564
  return_value = self._contract.functions.pointValue(
333
565
  product_id,
334
- ).call()
566
+ ).call(block_identifier=block_identifier)
567
+ return int(return_value)
568
+
569
+ def prediction_product_v1(
570
+ self,
571
+ product_id: hexbytes.HexBytes,
572
+ block_identifier: types.BlockIdentifier = "latest",
573
+ ) -> PredictionProductV1:
574
+ """Binding for `predictionProductV1` on the ProductRegistry contract.
575
+
576
+ Parameters
577
+ ----------
578
+ product_id : hexbytes.HexBytes
579
+ block_identifier : web3.types.BlockIdentifier
580
+ The block identifier, defaults to the latest block.
581
+
582
+ Returns
583
+ -------
584
+ PredictionProductV1
585
+ """
586
+ return_value = self._contract.functions.predictionProductV1(
587
+ product_id,
588
+ ).call(block_identifier=block_identifier)
589
+ return PredictionProductV1(
590
+ BaseProduct(
591
+ ProductMetadata(
592
+ eth_typing.ChecksumAddress(return_value[0][0][0]),
593
+ str(return_value[0][0][1]),
594
+ str(return_value[0][0][2]),
595
+ ),
596
+ OracleSpecification(
597
+ eth_typing.ChecksumAddress(return_value[0][1][0]),
598
+ int(return_value[0][1][1]),
599
+ int(return_value[0][1][2]),
600
+ int(return_value[0][1][3]),
601
+ hexbytes.HexBytes(return_value[0][1][4]),
602
+ ),
603
+ eth_typing.ChecksumAddress(return_value[0][2]),
604
+ int(return_value[0][3]),
605
+ int(return_value[0][4]),
606
+ int(return_value[0][5]),
607
+ str(return_value[0][6]),
608
+ ),
609
+ ExpirySpecification(int(return_value[1][0]), int(return_value[1][1])),
610
+ int(return_value[2]),
611
+ int(return_value[3]),
612
+ )
613
+
614
+ def price_decimals(
615
+ self,
616
+ product_id: hexbytes.HexBytes,
617
+ block_identifier: types.BlockIdentifier = "latest",
618
+ ) -> int:
619
+ """Binding for `priceDecimals` on the ProductRegistry contract.
620
+
621
+ Parameters
622
+ ----------
623
+ product_id : hexbytes.HexBytes
624
+ block_identifier : web3.types.BlockIdentifier
625
+ The block identifier, defaults to the latest block.
626
+
627
+ Returns
628
+ -------
629
+ int
630
+ """
631
+ return_value = self._contract.functions.priceDecimals(
632
+ product_id,
633
+ ).call(block_identifier=block_identifier)
335
634
  return int(return_value)
336
635
 
636
+ def product_treasury(
637
+ self,
638
+ product_id: hexbytes.HexBytes,
639
+ block_identifier: types.BlockIdentifier = "latest",
640
+ ) -> eth_typing.ChecksumAddress:
641
+ """Binding for `productTreasury` on the ProductRegistry contract.
642
+
643
+ Parameters
644
+ ----------
645
+ product_id : hexbytes.HexBytes
646
+ block_identifier : web3.types.BlockIdentifier
647
+ The block identifier, defaults to the latest block.
648
+
649
+ Returns
650
+ -------
651
+ eth_typing.ChecksumAddress
652
+ """
653
+ return_value = self._contract.functions.productTreasury(
654
+ product_id,
655
+ ).call(block_identifier=block_identifier)
656
+ return eth_typing.ChecksumAddress(return_value)
657
+
337
658
  def products(
338
659
  self,
339
660
  product_id: hexbytes.HexBytes,
340
- ) -> Product:
661
+ block_identifier: types.BlockIdentifier = "latest",
662
+ ) -> typing.Tuple[int, BaseProduct]:
341
663
  """Binding for `products` on the ProductRegistry contract.
342
664
 
343
665
  Parameters
344
666
  ----------
345
667
  product_id : hexbytes.HexBytes
668
+ block_identifier : web3.types.BlockIdentifier
669
+ The block identifier, defaults to the latest block.
346
670
 
347
671
  Returns
348
672
  -------
349
- Product
673
+ int
674
+ BaseProduct
350
675
  """
351
676
  return_value = self._contract.functions.products(
352
677
  product_id,
353
- ).call()
354
- return Product(
355
- ProductMetadata(
356
- eth_typing.ChecksumAddress(return_value[0][0]),
357
- str(return_value[0][1]),
358
- str(return_value[0][2]),
359
- ),
360
- OracleSpecification(
361
- eth_typing.ChecksumAddress(return_value[1][0]),
362
- int(return_value[1][1]),
363
- int(return_value[1][2]),
678
+ ).call(block_identifier=block_identifier)
679
+ return (
680
+ int(return_value[0]),
681
+ BaseProduct(
682
+ ProductMetadata(
683
+ eth_typing.ChecksumAddress(return_value[1][0][0]),
684
+ str(return_value[1][0][1]),
685
+ str(return_value[1][0][2]),
686
+ ),
687
+ OracleSpecification(
688
+ eth_typing.ChecksumAddress(return_value[1][1][0]),
689
+ int(return_value[1][1][1]),
690
+ int(return_value[1][1][2]),
691
+ int(return_value[1][1][3]),
692
+ hexbytes.HexBytes(return_value[1][1][4]),
693
+ ),
694
+ eth_typing.ChecksumAddress(return_value[1][2]),
364
695
  int(return_value[1][3]),
365
- hexbytes.HexBytes(return_value[1][4]),
696
+ int(return_value[1][4]),
697
+ int(return_value[1][5]),
698
+ str(return_value[1][6]),
366
699
  ),
367
- str(return_value[2]),
368
- eth_typing.ChecksumAddress(return_value[3]),
369
- int(return_value[4]),
370
- int(return_value[5]),
371
- int(return_value[6]),
372
- int(return_value[7]),
373
- int(return_value[8]),
374
- int(return_value[9]),
375
- int(return_value[10]),
376
- int(return_value[11]),
377
- str(return_value[12]),
378
700
  )
379
701
 
380
702
  def proxiable_uuid(
381
703
  self,
704
+ block_identifier: types.BlockIdentifier = "latest",
382
705
  ) -> hexbytes.HexBytes:
383
706
  """Binding for `proxiableUUID` on the ProductRegistry contract.
384
707
 
708
+ Parameters
709
+ ----------
710
+ block_identifier : web3.types.BlockIdentifier
711
+ The block identifier, defaults to the latest block.
712
+
385
713
  Returns
386
714
  -------
387
715
  hexbytes.HexBytes
388
716
  """
389
- return_value = self._contract.functions.proxiableUUID().call()
717
+ return_value = self._contract.functions.proxiableUUID().call(
718
+ block_identifier=block_identifier
719
+ )
390
720
  return hexbytes.HexBytes(return_value)
391
721
 
392
- def register(
722
+ def register_future_product(
393
723
  self,
394
- product: Product,
724
+ product: FuturesProductV1,
725
+ initial_builder_stake: int,
395
726
  ) -> contract.ContractFunction:
396
- """Binding for `register` on the ProductRegistry contract.
727
+ """Binding for `registerFutureProduct` on the ProductRegistry contract.
397
728
 
398
729
  Parameters
399
730
  ----------
400
- product : Product
731
+ product : FuturesProductV1
732
+ initial_builder_stake : int
401
733
 
402
734
  Returns
403
735
  -------
404
736
  web3.contract.contract.ContractFunction
405
737
  A contract function instance to be sent in a transaction.
406
738
  """
407
- return self._contract.functions.register(
739
+ return self._contract.functions.registerFutureProduct(
408
740
  (
409
741
  (
410
- product.metadata.builder,
411
- product.metadata.symbol,
412
- product.metadata.description,
742
+ (
743
+ product.base.metadata.builder,
744
+ product.base.metadata.symbol,
745
+ product.base.metadata.description,
746
+ ),
747
+ (
748
+ product.base.oracle_spec.oracle_address,
749
+ product.base.oracle_spec.fsv_decimals,
750
+ product.base.oracle_spec.fsp_alpha,
751
+ product.base.oracle_spec.fsp_beta,
752
+ product.base.oracle_spec.fsv_calldata,
753
+ ),
754
+ product.base.collateral_asset,
755
+ product.base.start_time,
756
+ product.base.point_value,
757
+ product.base.price_decimals,
758
+ product.base.extended_metadata,
413
759
  ),
414
760
  (
415
- product.oracle_spec.oracle_address,
416
- product.oracle_spec.fsv_decimals,
417
- product.oracle_spec.fsp_alpha,
418
- product.oracle_spec.fsp_beta,
419
- product.oracle_spec.fsv_calldata,
761
+ product.expiry_spec.earliest_fsp_submission_time,
762
+ product.expiry_spec.tradeout_interval,
420
763
  ),
421
- product.price_quotation,
422
- product.collateral_asset,
423
- product.start_time,
424
- product.earliest_fsp_submission_time,
425
- product.unit_value,
426
- product.initial_margin_requirement,
427
- product.maintenance_margin_requirement,
428
- product.auction_bounty,
429
- product.tradeout_interval,
430
- product.tick_size,
431
- product.extended_metadata,
764
+ (product.margin_spec.imr, product.margin_spec.mmr),
432
765
  ),
766
+ initial_builder_stake,
433
767
  )
434
768
 
435
- def renounce_ownership(
769
+ def register_prediction_product(
436
770
  self,
771
+ product: PredictionProductV1,
772
+ initial_builder_stake: int,
437
773
  ) -> contract.ContractFunction:
438
- """Binding for `renounceOwnership` on the ProductRegistry contract.
774
+ """Binding for `registerPredictionProduct` on the ProductRegistry contract.
775
+
776
+ Parameters
777
+ ----------
778
+ product : PredictionProductV1
779
+ initial_builder_stake : int
439
780
 
440
781
  Returns
441
782
  -------
442
783
  web3.contract.contract.ContractFunction
443
784
  A contract function instance to be sent in a transaction.
444
785
  """
445
- return self._contract.functions.renounceOwnership()
786
+ return self._contract.functions.registerPredictionProduct(
787
+ (
788
+ (
789
+ (
790
+ product.base.metadata.builder,
791
+ product.base.metadata.symbol,
792
+ product.base.metadata.description,
793
+ ),
794
+ (
795
+ product.base.oracle_spec.oracle_address,
796
+ product.base.oracle_spec.fsv_decimals,
797
+ product.base.oracle_spec.fsp_alpha,
798
+ product.base.oracle_spec.fsp_beta,
799
+ product.base.oracle_spec.fsv_calldata,
800
+ ),
801
+ product.base.collateral_asset,
802
+ product.base.start_time,
803
+ product.base.point_value,
804
+ product.base.price_decimals,
805
+ product.base.extended_metadata,
806
+ ),
807
+ (
808
+ product.expiry_spec.earliest_fsp_submission_time,
809
+ product.expiry_spec.tradeout_interval,
810
+ ),
811
+ product.max_price,
812
+ product.min_price,
813
+ ),
814
+ initial_builder_stake,
815
+ )
446
816
 
447
- def set_clearing(
817
+ def register_prediction_product_for(
448
818
  self,
449
- clearing_: eth_typing.ChecksumAddress,
819
+ product: PredictionProductV1,
820
+ initial_builder_stake: int,
450
821
  ) -> contract.ContractFunction:
451
- """Binding for `setClearing` on the ProductRegistry contract.
822
+ """Binding for `registerPredictionProductFor` on the ProductRegistry contract.
452
823
 
453
824
  Parameters
454
825
  ----------
455
- clearing_ : eth_typing.ChecksumAddress
826
+ product : PredictionProductV1
827
+ initial_builder_stake : int
456
828
 
457
829
  Returns
458
830
  -------
459
831
  web3.contract.contract.ContractFunction
460
832
  A contract function instance to be sent in a transaction.
461
833
  """
462
- return self._contract.functions.setClearing(
463
- clearing_,
464
- )
465
-
466
- def state(
834
+ return self._contract.functions.registerPredictionProductFor(
835
+ (
836
+ (
837
+ (
838
+ product.base.metadata.builder,
839
+ product.base.metadata.symbol,
840
+ product.base.metadata.description,
841
+ ),
842
+ (
843
+ product.base.oracle_spec.oracle_address,
844
+ product.base.oracle_spec.fsv_decimals,
845
+ product.base.oracle_spec.fsp_alpha,
846
+ product.base.oracle_spec.fsp_beta,
847
+ product.base.oracle_spec.fsv_calldata,
848
+ ),
849
+ product.base.collateral_asset,
850
+ product.base.start_time,
851
+ product.base.point_value,
852
+ product.base.price_decimals,
853
+ product.base.extended_metadata,
854
+ ),
855
+ (
856
+ product.expiry_spec.earliest_fsp_submission_time,
857
+ product.expiry_spec.tradeout_interval,
858
+ ),
859
+ product.max_price,
860
+ product.min_price,
861
+ ),
862
+ initial_builder_stake,
863
+ )
864
+
865
+ def remove_allowed(
866
+ self,
867
+ addr: eth_typing.ChecksumAddress,
868
+ ) -> contract.ContractFunction:
869
+ """Binding for `removeAllowed` on the ProductRegistry contract.
870
+
871
+ Parameters
872
+ ----------
873
+ addr : eth_typing.ChecksumAddress
874
+
875
+ Returns
876
+ -------
877
+ web3.contract.contract.ContractFunction
878
+ A contract function instance to be sent in a transaction.
879
+ """
880
+ return self._contract.functions.removeAllowed(
881
+ addr,
882
+ )
883
+
884
+ def renounce_ownership(
885
+ self,
886
+ ) -> contract.ContractFunction:
887
+ """Binding for `renounceOwnership` on the ProductRegistry contract.
888
+
889
+ Returns
890
+ -------
891
+ web3.contract.contract.ContractFunction
892
+ A contract function instance to be sent in a transaction.
893
+ """
894
+ return self._contract.functions.renounceOwnership()
895
+
896
+ def state(
467
897
  self,
468
898
  product_id: hexbytes.HexBytes,
899
+ block_identifier: types.BlockIdentifier = "latest",
469
900
  ) -> ProductState:
470
901
  """Binding for `state` on the ProductRegistry contract.
471
902
 
472
903
  Parameters
473
904
  ----------
474
905
  product_id : hexbytes.HexBytes
906
+ block_identifier : web3.types.BlockIdentifier
907
+ The block identifier, defaults to the latest block.
475
908
 
476
909
  Returns
477
910
  -------
@@ -479,18 +912,21 @@ class ProductRegistry:
479
912
  """
480
913
  return_value = self._contract.functions.state(
481
914
  product_id,
482
- ).call()
915
+ ).call(block_identifier=block_identifier)
483
916
  return ProductState(return_value)
484
917
 
485
918
  def tick_size(
486
919
  self,
487
920
  product_id: hexbytes.HexBytes,
921
+ block_identifier: types.BlockIdentifier = "latest",
488
922
  ) -> int:
489
923
  """Binding for `tickSize` on the ProductRegistry contract.
490
924
 
491
925
  Parameters
492
926
  ----------
493
927
  product_id : hexbytes.HexBytes
928
+ block_identifier : web3.types.BlockIdentifier
929
+ The block identifier, defaults to the latest block.
494
930
 
495
931
  Returns
496
932
  -------
@@ -498,7 +934,7 @@ class ProductRegistry:
498
934
  """
499
935
  return_value = self._contract.functions.tickSize(
500
936
  product_id,
501
- ).call()
937
+ ).call(block_identifier=block_identifier)
502
938
  return int(return_value)
503
939
 
504
940
  def transfer_ownership(
@@ -546,710 +982,1310 @@ class ProductRegistry:
546
982
  ABI = typing.cast(
547
983
  eth_typing.ABI,
548
984
  [
549
- {"inputs": [], "stateMutability": "nonpayable", "type": "constructor"},
550
- {
551
- "inputs": [
552
- {"internalType": "address", "name": "target", "type": "address"}
553
- ],
554
- "name": "AddressEmptyCode",
555
- "type": "error",
556
- },
557
- {
558
- "inputs": [
559
- {"internalType": "string", "name": "parameter", "type": "string"}
560
- ],
561
- "name": "AlreadyExists",
562
- "type": "error",
563
- },
564
- {
565
- "inputs": [
566
- {"internalType": "address", "name": "implementation", "type": "address"}
567
- ],
568
- "name": "ERC1967InvalidImplementation",
569
- "type": "error",
570
- },
571
- {"inputs": [], "name": "ERC1967NonPayable", "type": "error"},
572
- {"inputs": [], "name": "FailedCall", "type": "error"},
573
- {
574
- "inputs": [
575
- {"internalType": "uint256", "name": "startTime", "type": "uint256"},
576
- {
577
- "internalType": "uint256",
578
- "name": "earliestFSPSubmissionTime",
579
- "type": "uint256",
580
- },
581
- ],
582
- "name": "InvalidFSPSubmissionTime",
583
- "type": "error",
584
- },
585
- {"inputs": [], "name": "InvalidInitialization", "type": "error"},
586
985
  {
587
- "inputs": [
588
- {"internalType": "uint16", "name": "imr", "type": "uint16"},
589
- {"internalType": "uint16", "name": "mmr", "type": "uint16"},
590
- ],
591
- "name": "InvalidMarginRequirement",
592
- "type": "error",
986
+ "type": "function",
987
+ "name": "UPGRADE_INTERFACE_VERSION",
988
+ "inputs": [],
989
+ "outputs": [{"name": "", "type": "string", "internalType": "string"}],
990
+ "stateMutability": "view",
593
991
  },
594
992
  {
595
- "inputs": [
596
- {"internalType": "string", "name": "paramName", "type": "string"}
597
- ],
598
- "name": "InvalidParameter",
599
- "type": "error",
993
+ "type": "function",
994
+ "name": "addAllowed",
995
+ "inputs": [{"name": "addr", "type": "address", "internalType": "address"}],
996
+ "outputs": [],
997
+ "stateMutability": "nonpayable",
600
998
  },
601
999
  {
602
- "inputs": [
603
- {"internalType": "uint256", "name": "startTime", "type": "uint256"},
604
- {
605
- "internalType": "uint256",
606
- "name": "blockTimestamp",
607
- "type": "uint256",
608
- },
609
- ],
610
- "name": "InvalidStartTime",
611
- "type": "error",
1000
+ "type": "function",
1001
+ "name": "admin",
1002
+ "inputs": [],
1003
+ "outputs": [{"name": "", "type": "address", "internalType": "address"}],
1004
+ "stateMutability": "view",
612
1005
  },
613
- {"inputs": [], "name": "NotInitializing", "type": "error"},
614
1006
  {
615
- "inputs": [{"internalType": "address", "name": "owner", "type": "address"}],
616
- "name": "OwnableInvalidOwner",
617
- "type": "error",
1007
+ "type": "function",
1008
+ "name": "allowed",
1009
+ "inputs": [],
1010
+ "outputs": [{"name": "", "type": "address[]", "internalType": "address[]"}],
1011
+ "stateMutability": "view",
618
1012
  },
619
1013
  {
1014
+ "type": "function",
1015
+ "name": "builderStakeData",
620
1016
  "inputs": [
621
- {"internalType": "address", "name": "account", "type": "address"}
1017
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
622
1018
  ],
623
- "name": "OwnableUnauthorizedAccount",
624
- "type": "error",
625
- },
626
- {"inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error"},
627
- {
628
- "inputs": [{"internalType": "bytes32", "name": "slot", "type": "bytes32"}],
629
- "name": "UUPSUnsupportedProxiableUUID",
630
- "type": "error",
631
- },
632
- {
633
- "anonymous": False,
634
- "inputs": [
1019
+ "outputs": [
635
1020
  {
636
- "indexed": False,
637
- "internalType": "uint64",
638
- "name": "version",
639
- "type": "uint64",
1021
+ "name": "",
1022
+ "type": "tuple",
1023
+ "internalType": "struct BuilderStakeData",
1024
+ "components": [
1025
+ {
1026
+ "name": "payoutRemaining",
1027
+ "type": "uint256",
1028
+ "internalType": "uint256",
1029
+ },
1030
+ {
1031
+ "name": "claimableRewards",
1032
+ "type": "uint256",
1033
+ "internalType": "uint256",
1034
+ },
1035
+ {
1036
+ "name": "pendingStakeData",
1037
+ "type": "tuple",
1038
+ "internalType": "struct PendingStakeData",
1039
+ "components": [
1040
+ {
1041
+ "name": "payout",
1042
+ "type": "uint256",
1043
+ "internalType": "uint256",
1044
+ },
1045
+ {
1046
+ "name": "activeAt",
1047
+ "type": "uint256",
1048
+ "internalType": "uint256",
1049
+ },
1050
+ ],
1051
+ },
1052
+ ],
640
1053
  }
641
1054
  ],
642
- "name": "Initialized",
643
- "type": "event",
1055
+ "stateMutability": "view",
644
1056
  },
645
1057
  {
646
- "anonymous": False,
1058
+ "type": "function",
1059
+ "name": "claimBuilderRewards",
647
1060
  "inputs": [
648
- {
649
- "indexed": True,
650
- "internalType": "address",
651
- "name": "previousOwner",
652
- "type": "address",
653
- },
654
- {
655
- "indexed": True,
656
- "internalType": "address",
657
- "name": "newOwner",
658
- "type": "address",
659
- },
1061
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
660
1062
  ],
661
- "name": "OwnershipTransferred",
662
- "type": "event",
1063
+ "outputs": [],
1064
+ "stateMutability": "nonpayable",
663
1065
  },
664
1066
  {
665
- "anonymous": False,
1067
+ "type": "function",
1068
+ "name": "claimableBuilderRewards",
666
1069
  "inputs": [
1070
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
1071
+ ],
1072
+ "outputs": [
667
1073
  {
668
- "indexed": True,
669
- "internalType": "address",
670
- "name": "builder",
671
- "type": "address",
1074
+ "name": "builderRewards",
1075
+ "type": "uint256",
1076
+ "internalType": "uint256",
672
1077
  },
673
1078
  {
674
- "indexed": False,
675
- "internalType": "bytes32",
676
- "name": "productId",
677
- "type": "bytes32",
1079
+ "name": "treasuryRewads",
1080
+ "type": "uint256",
1081
+ "internalType": "uint256",
678
1082
  },
679
1083
  ],
680
- "name": "ProductRegistered",
681
- "type": "event",
682
- },
683
- {
684
- "anonymous": False,
685
- "inputs": [
686
- {
687
- "indexed": True,
688
- "internalType": "address",
689
- "name": "implementation",
690
- "type": "address",
691
- }
692
- ],
693
- "name": "Upgraded",
694
- "type": "event",
695
- },
696
- {
697
- "inputs": [],
698
- "name": "UPGRADE_INTERFACE_VERSION",
699
- "outputs": [{"internalType": "string", "name": "", "type": "string"}],
700
1084
  "stateMutability": "view",
701
- "type": "function",
702
1085
  },
703
1086
  {
704
- "inputs": [
705
- {"internalType": "bytes32", "name": "productId", "type": "bytes32"}
706
- ],
707
- "name": "auctionBounty",
708
- "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
709
- "stateMutability": "view",
710
1087
  "type": "function",
711
- },
712
- {
713
- "inputs": [],
714
1088
  "name": "clearing",
1089
+ "inputs": [],
715
1090
  "outputs": [
716
1091
  {
717
- "internalType": "contract IClearingSubset",
718
1092
  "name": "",
719
1093
  "type": "address",
1094
+ "internalType": "contract IProductRegistryFacet",
720
1095
  }
721
1096
  ],
722
1097
  "stateMutability": "view",
723
- "type": "function",
724
1098
  },
725
1099
  {
1100
+ "type": "function",
1101
+ "name": "collateralAsset",
726
1102
  "inputs": [
727
- {"internalType": "bytes32", "name": "productId", "type": "bytes32"}
1103
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
728
1104
  ],
729
- "name": "collateralAsset",
730
- "outputs": [{"internalType": "address", "name": "", "type": "address"}],
1105
+ "outputs": [{"name": "", "type": "address", "internalType": "address"}],
731
1106
  "stateMutability": "view",
732
- "type": "function",
733
1107
  },
734
1108
  {
1109
+ "type": "function",
1110
+ "name": "earliestFSPSubmissionTime",
735
1111
  "inputs": [
736
- {"internalType": "bytes32", "name": "productId", "type": "bytes32"}
1112
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
737
1113
  ],
738
- "name": "earliestFSPSubmissionTime",
739
- "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
1114
+ "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}],
740
1115
  "stateMutability": "view",
741
- "type": "function",
742
1116
  },
743
1117
  {
1118
+ "type": "function",
1119
+ "name": "futuresProductV1",
744
1120
  "inputs": [
1121
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
1122
+ ],
1123
+ "outputs": [
745
1124
  {
1125
+ "name": "",
1126
+ "type": "tuple",
1127
+ "internalType": "struct FuturesProductV1",
746
1128
  "components": [
747
1129
  {
1130
+ "name": "base",
1131
+ "type": "tuple",
1132
+ "internalType": "struct BaseProduct",
748
1133
  "components": [
749
1134
  {
750
- "internalType": "address",
751
- "name": "builder",
1135
+ "name": "metadata",
1136
+ "type": "tuple",
1137
+ "internalType": "struct ProductMetadata",
1138
+ "components": [
1139
+ {
1140
+ "name": "builder",
1141
+ "type": "address",
1142
+ "internalType": "address",
1143
+ },
1144
+ {
1145
+ "name": "symbol",
1146
+ "type": "string",
1147
+ "internalType": "string",
1148
+ },
1149
+ {
1150
+ "name": "description",
1151
+ "type": "string",
1152
+ "internalType": "string",
1153
+ },
1154
+ ],
1155
+ },
1156
+ {
1157
+ "name": "oracleSpec",
1158
+ "type": "tuple",
1159
+ "internalType": "struct OracleSpecification",
1160
+ "components": [
1161
+ {
1162
+ "name": "oracleAddress",
1163
+ "type": "address",
1164
+ "internalType": "address",
1165
+ },
1166
+ {
1167
+ "name": "fsvDecimals",
1168
+ "type": "uint8",
1169
+ "internalType": "uint8",
1170
+ },
1171
+ {
1172
+ "name": "fspAlpha",
1173
+ "type": "int256",
1174
+ "internalType": "int256",
1175
+ },
1176
+ {
1177
+ "name": "fspBeta",
1178
+ "type": "int256",
1179
+ "internalType": "int256",
1180
+ },
1181
+ {
1182
+ "name": "fsvCalldata",
1183
+ "type": "bytes",
1184
+ "internalType": "bytes",
1185
+ },
1186
+ ],
1187
+ },
1188
+ {
1189
+ "name": "collateralAsset",
752
1190
  "type": "address",
1191
+ "internalType": "address",
753
1192
  },
754
1193
  {
755
- "internalType": "string",
756
- "name": "symbol",
757
- "type": "string",
1194
+ "name": "startTime",
1195
+ "type": "uint256",
1196
+ "internalType": "uint256",
758
1197
  },
759
1198
  {
760
- "internalType": "string",
761
- "name": "description",
1199
+ "name": "pointValue",
1200
+ "type": "uint256",
1201
+ "internalType": "uint256",
1202
+ },
1203
+ {
1204
+ "name": "priceDecimals",
1205
+ "type": "uint8",
1206
+ "internalType": "uint8",
1207
+ },
1208
+ {
1209
+ "name": "extendedMetadata",
762
1210
  "type": "string",
1211
+ "internalType": "string",
763
1212
  },
764
1213
  ],
765
- "internalType": "struct IProductRegistry.ProductMetadata",
766
- "name": "metadata",
767
- "type": "tuple",
768
1214
  },
769
1215
  {
1216
+ "name": "expirySpec",
1217
+ "type": "tuple",
1218
+ "internalType": "struct ExpirySpecification",
770
1219
  "components": [
771
1220
  {
772
- "internalType": "address",
773
- "name": "oracleAddress",
774
- "type": "address",
775
- },
776
- {
777
- "internalType": "uint8",
778
- "name": "fsvDecimals",
779
- "type": "uint8",
1221
+ "name": "earliestFSPSubmissionTime",
1222
+ "type": "uint256",
1223
+ "internalType": "uint256",
780
1224
  },
781
1225
  {
782
- "internalType": "int256",
783
- "name": "fspAlpha",
784
- "type": "int256",
1226
+ "name": "tradeoutInterval",
1227
+ "type": "uint256",
1228
+ "internalType": "uint256",
785
1229
  },
1230
+ ],
1231
+ },
1232
+ {
1233
+ "name": "marginSpec",
1234
+ "type": "tuple",
1235
+ "internalType": "struct MarginSpecification",
1236
+ "components": [
786
1237
  {
787
- "internalType": "int256",
788
- "name": "fspBeta",
789
- "type": "int256",
1238
+ "name": "imr",
1239
+ "type": "uint256",
1240
+ "internalType": "uint256",
790
1241
  },
791
1242
  {
792
- "internalType": "bytes",
793
- "name": "fsvCalldata",
794
- "type": "bytes",
1243
+ "name": "mmr",
1244
+ "type": "uint256",
1245
+ "internalType": "uint256",
795
1246
  },
796
1247
  ],
797
- "internalType": "struct IProductRegistry.OracleSpecification",
798
- "name": "oracleSpec",
799
- "type": "tuple",
800
- },
801
- {
802
- "internalType": "string",
803
- "name": "priceQuotation",
804
- "type": "string",
805
1248
  },
806
- {
807
- "internalType": "address",
1249
+ ],
1250
+ }
1251
+ ],
1252
+ "stateMutability": "view",
1253
+ },
1254
+ {
1255
+ "type": "function",
1256
+ "name": "id",
1257
+ "inputs": [
1258
+ {
1259
+ "name": "product",
1260
+ "type": "tuple",
1261
+ "internalType": "struct BaseProduct",
1262
+ "components": [
1263
+ {
1264
+ "name": "metadata",
1265
+ "type": "tuple",
1266
+ "internalType": "struct ProductMetadata",
1267
+ "components": [
1268
+ {
1269
+ "name": "builder",
1270
+ "type": "address",
1271
+ "internalType": "address",
1272
+ },
1273
+ {
1274
+ "name": "symbol",
1275
+ "type": "string",
1276
+ "internalType": "string",
1277
+ },
1278
+ {
1279
+ "name": "description",
1280
+ "type": "string",
1281
+ "internalType": "string",
1282
+ },
1283
+ ],
1284
+ },
1285
+ {
1286
+ "name": "oracleSpec",
1287
+ "type": "tuple",
1288
+ "internalType": "struct OracleSpecification",
1289
+ "components": [
1290
+ {
1291
+ "name": "oracleAddress",
1292
+ "type": "address",
1293
+ "internalType": "address",
1294
+ },
1295
+ {
1296
+ "name": "fsvDecimals",
1297
+ "type": "uint8",
1298
+ "internalType": "uint8",
1299
+ },
1300
+ {
1301
+ "name": "fspAlpha",
1302
+ "type": "int256",
1303
+ "internalType": "int256",
1304
+ },
1305
+ {
1306
+ "name": "fspBeta",
1307
+ "type": "int256",
1308
+ "internalType": "int256",
1309
+ },
1310
+ {
1311
+ "name": "fsvCalldata",
1312
+ "type": "bytes",
1313
+ "internalType": "bytes",
1314
+ },
1315
+ ],
1316
+ },
1317
+ {
808
1318
  "name": "collateralAsset",
809
1319
  "type": "address",
1320
+ "internalType": "address",
810
1321
  },
811
1322
  {
812
- "internalType": "uint256",
813
1323
  "name": "startTime",
814
1324
  "type": "uint256",
815
- },
816
- {
817
1325
  "internalType": "uint256",
818
- "name": "earliestFSPSubmissionTime",
819
- "type": "uint256",
820
1326
  },
821
1327
  {
822
- "internalType": "uint256",
823
- "name": "unitValue",
1328
+ "name": "pointValue",
824
1329
  "type": "uint256",
1330
+ "internalType": "uint256",
825
1331
  },
826
1332
  {
827
- "internalType": "uint16",
828
- "name": "initialMarginRequirement",
829
- "type": "uint16",
830
- },
831
- {
832
- "internalType": "uint16",
833
- "name": "maintenanceMarginRequirement",
834
- "type": "uint16",
835
- },
836
- {
837
- "internalType": "uint64",
838
- "name": "auctionBounty",
839
- "type": "uint64",
840
- },
841
- {
842
- "internalType": "uint32",
843
- "name": "tradeoutInterval",
844
- "type": "uint32",
1333
+ "name": "priceDecimals",
1334
+ "type": "uint8",
1335
+ "internalType": "uint8",
845
1336
  },
846
- {"internalType": "uint8", "name": "tickSize", "type": "uint8"},
847
1337
  {
848
- "internalType": "string",
849
1338
  "name": "extendedMetadata",
850
1339
  "type": "string",
1340
+ "internalType": "string",
851
1341
  },
852
1342
  ],
853
- "internalType": "struct IProductRegistry.Product",
854
- "name": "product",
855
- "type": "tuple",
856
1343
  }
857
1344
  ],
858
- "name": "id",
859
- "outputs": [{"internalType": "bytes32", "name": "", "type": "bytes32"}],
860
- "stateMutability": "pure",
861
- "type": "function",
1345
+ "outputs": [{"name": "", "type": "bytes32", "internalType": "bytes32"}],
1346
+ "stateMutability": "view",
862
1347
  },
863
1348
  {
1349
+ "type": "function",
1350
+ "name": "increaseBuilderStake",
864
1351
  "inputs": [
865
- {"internalType": "bytes32", "name": "productId", "type": "bytes32"}
1352
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"},
1353
+ {"name": "fee", "type": "uint256", "internalType": "uint256"},
866
1354
  ],
867
- "name": "imr",
868
- "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
869
- "stateMutability": "view",
870
- "type": "function",
1355
+ "outputs": [],
1356
+ "stateMutability": "nonpayable",
871
1357
  },
872
1358
  {
873
- "inputs": [],
1359
+ "type": "function",
874
1360
  "name": "initialize",
1361
+ "inputs": [
1362
+ {
1363
+ "name": "clearing_",
1364
+ "type": "address",
1365
+ "internalType": "contract IProductRegistryFacet",
1366
+ }
1367
+ ],
875
1368
  "outputs": [],
876
1369
  "stateMutability": "nonpayable",
1370
+ },
1371
+ {
877
1372
  "type": "function",
1373
+ "name": "maxPrice",
1374
+ "inputs": [
1375
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
1376
+ ],
1377
+ "outputs": [{"name": "", "type": "int256", "internalType": "int256"}],
1378
+ "stateMutability": "view",
878
1379
  },
879
1380
  {
1381
+ "type": "function",
1382
+ "name": "minPrice",
880
1383
  "inputs": [
881
- {"internalType": "bytes32", "name": "productId", "type": "bytes32"}
1384
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
882
1385
  ],
883
- "name": "mmr",
884
- "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
1386
+ "outputs": [{"name": "", "type": "int256", "internalType": "int256"}],
885
1387
  "stateMutability": "view",
1388
+ },
1389
+ {
886
1390
  "type": "function",
1391
+ "name": "mmr",
1392
+ "inputs": [
1393
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
1394
+ ],
1395
+ "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}],
1396
+ "stateMutability": "view",
887
1397
  },
888
1398
  {
1399
+ "type": "function",
1400
+ "name": "nextInterval",
889
1401
  "inputs": [
890
- {"internalType": "bytes32", "name": "productId", "type": "bytes32"}
1402
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
891
1403
  ],
1404
+ "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}],
1405
+ "stateMutability": "view",
1406
+ },
1407
+ {
1408
+ "type": "function",
892
1409
  "name": "oracleSpecification",
1410
+ "inputs": [
1411
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
1412
+ ],
893
1413
  "outputs": [
894
1414
  {
1415
+ "name": "",
1416
+ "type": "tuple",
1417
+ "internalType": "struct OracleSpecification",
895
1418
  "components": [
896
1419
  {
897
- "internalType": "address",
898
1420
  "name": "oracleAddress",
899
1421
  "type": "address",
1422
+ "internalType": "address",
900
1423
  },
901
1424
  {
902
- "internalType": "uint8",
903
1425
  "name": "fsvDecimals",
904
1426
  "type": "uint8",
1427
+ "internalType": "uint8",
905
1428
  },
906
1429
  {
907
- "internalType": "int256",
908
1430
  "name": "fspAlpha",
909
1431
  "type": "int256",
1432
+ "internalType": "int256",
910
1433
  },
911
- {"internalType": "int256", "name": "fspBeta", "type": "int256"},
1434
+ {"name": "fspBeta", "type": "int256", "internalType": "int256"},
912
1435
  {
913
- "internalType": "bytes",
914
1436
  "name": "fsvCalldata",
915
1437
  "type": "bytes",
1438
+ "internalType": "bytes",
916
1439
  },
917
1440
  ],
918
- "internalType": "struct IProductRegistry.OracleSpecification",
919
- "name": "",
920
- "type": "tuple",
921
1441
  }
922
1442
  ],
923
1443
  "stateMutability": "view",
924
- "type": "function",
925
1444
  },
926
1445
  {
927
- "inputs": [],
1446
+ "type": "function",
928
1447
  "name": "owner",
929
- "outputs": [{"internalType": "address", "name": "", "type": "address"}],
1448
+ "inputs": [],
1449
+ "outputs": [{"name": "", "type": "address", "internalType": "address"}],
930
1450
  "stateMutability": "view",
1451
+ },
1452
+ {
931
1453
  "type": "function",
1454
+ "name": "pointValue",
1455
+ "inputs": [
1456
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
1457
+ ],
1458
+ "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}],
1459
+ "stateMutability": "view",
932
1460
  },
933
1461
  {
1462
+ "type": "function",
1463
+ "name": "predictionProductV1",
934
1464
  "inputs": [
935
- {"internalType": "bytes32", "name": "productId", "type": "bytes32"}
1465
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
1466
+ ],
1467
+ "outputs": [
1468
+ {
1469
+ "name": "",
1470
+ "type": "tuple",
1471
+ "internalType": "struct PredictionProductV1",
1472
+ "components": [
1473
+ {
1474
+ "name": "base",
1475
+ "type": "tuple",
1476
+ "internalType": "struct BaseProduct",
1477
+ "components": [
1478
+ {
1479
+ "name": "metadata",
1480
+ "type": "tuple",
1481
+ "internalType": "struct ProductMetadata",
1482
+ "components": [
1483
+ {
1484
+ "name": "builder",
1485
+ "type": "address",
1486
+ "internalType": "address",
1487
+ },
1488
+ {
1489
+ "name": "symbol",
1490
+ "type": "string",
1491
+ "internalType": "string",
1492
+ },
1493
+ {
1494
+ "name": "description",
1495
+ "type": "string",
1496
+ "internalType": "string",
1497
+ },
1498
+ ],
1499
+ },
1500
+ {
1501
+ "name": "oracleSpec",
1502
+ "type": "tuple",
1503
+ "internalType": "struct OracleSpecification",
1504
+ "components": [
1505
+ {
1506
+ "name": "oracleAddress",
1507
+ "type": "address",
1508
+ "internalType": "address",
1509
+ },
1510
+ {
1511
+ "name": "fsvDecimals",
1512
+ "type": "uint8",
1513
+ "internalType": "uint8",
1514
+ },
1515
+ {
1516
+ "name": "fspAlpha",
1517
+ "type": "int256",
1518
+ "internalType": "int256",
1519
+ },
1520
+ {
1521
+ "name": "fspBeta",
1522
+ "type": "int256",
1523
+ "internalType": "int256",
1524
+ },
1525
+ {
1526
+ "name": "fsvCalldata",
1527
+ "type": "bytes",
1528
+ "internalType": "bytes",
1529
+ },
1530
+ ],
1531
+ },
1532
+ {
1533
+ "name": "collateralAsset",
1534
+ "type": "address",
1535
+ "internalType": "address",
1536
+ },
1537
+ {
1538
+ "name": "startTime",
1539
+ "type": "uint256",
1540
+ "internalType": "uint256",
1541
+ },
1542
+ {
1543
+ "name": "pointValue",
1544
+ "type": "uint256",
1545
+ "internalType": "uint256",
1546
+ },
1547
+ {
1548
+ "name": "priceDecimals",
1549
+ "type": "uint8",
1550
+ "internalType": "uint8",
1551
+ },
1552
+ {
1553
+ "name": "extendedMetadata",
1554
+ "type": "string",
1555
+ "internalType": "string",
1556
+ },
1557
+ ],
1558
+ },
1559
+ {
1560
+ "name": "expirySpec",
1561
+ "type": "tuple",
1562
+ "internalType": "struct ExpirySpecification",
1563
+ "components": [
1564
+ {
1565
+ "name": "earliestFSPSubmissionTime",
1566
+ "type": "uint256",
1567
+ "internalType": "uint256",
1568
+ },
1569
+ {
1570
+ "name": "tradeoutInterval",
1571
+ "type": "uint256",
1572
+ "internalType": "uint256",
1573
+ },
1574
+ ],
1575
+ },
1576
+ {
1577
+ "name": "maxPrice",
1578
+ "type": "int256",
1579
+ "internalType": "int256",
1580
+ },
1581
+ {
1582
+ "name": "minPrice",
1583
+ "type": "int256",
1584
+ "internalType": "int256",
1585
+ },
1586
+ ],
1587
+ }
936
1588
  ],
937
- "name": "pointValue",
938
- "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
939
1589
  "stateMutability": "view",
1590
+ },
1591
+ {
940
1592
  "type": "function",
1593
+ "name": "priceDecimals",
1594
+ "inputs": [
1595
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
1596
+ ],
1597
+ "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}],
1598
+ "stateMutability": "view",
941
1599
  },
942
1600
  {
1601
+ "type": "function",
1602
+ "name": "productTreasury",
943
1603
  "inputs": [
944
- {"internalType": "bytes32", "name": "productId", "type": "bytes32"}
1604
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
945
1605
  ],
1606
+ "outputs": [{"name": "", "type": "address", "internalType": "address"}],
1607
+ "stateMutability": "view",
1608
+ },
1609
+ {
1610
+ "type": "function",
946
1611
  "name": "products",
1612
+ "inputs": [
1613
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
1614
+ ],
947
1615
  "outputs": [
1616
+ {"name": "", "type": "uint8", "internalType": "enum ProductType"},
948
1617
  {
1618
+ "name": "",
1619
+ "type": "tuple",
1620
+ "internalType": "struct BaseProduct",
949
1621
  "components": [
950
1622
  {
1623
+ "name": "metadata",
1624
+ "type": "tuple",
1625
+ "internalType": "struct ProductMetadata",
951
1626
  "components": [
952
1627
  {
953
- "internalType": "address",
954
1628
  "name": "builder",
955
1629
  "type": "address",
1630
+ "internalType": "address",
956
1631
  },
957
1632
  {
958
- "internalType": "string",
959
1633
  "name": "symbol",
960
1634
  "type": "string",
1635
+ "internalType": "string",
961
1636
  },
962
1637
  {
963
- "internalType": "string",
964
1638
  "name": "description",
965
1639
  "type": "string",
1640
+ "internalType": "string",
966
1641
  },
967
1642
  ],
968
- "internalType": "struct IProductRegistry.ProductMetadata",
969
- "name": "metadata",
970
- "type": "tuple",
971
1643
  },
972
1644
  {
1645
+ "name": "oracleSpec",
1646
+ "type": "tuple",
1647
+ "internalType": "struct OracleSpecification",
973
1648
  "components": [
974
1649
  {
975
- "internalType": "address",
976
1650
  "name": "oracleAddress",
977
1651
  "type": "address",
1652
+ "internalType": "address",
978
1653
  },
979
1654
  {
980
- "internalType": "uint8",
981
1655
  "name": "fsvDecimals",
982
1656
  "type": "uint8",
1657
+ "internalType": "uint8",
983
1658
  },
984
1659
  {
985
- "internalType": "int256",
986
1660
  "name": "fspAlpha",
987
1661
  "type": "int256",
1662
+ "internalType": "int256",
988
1663
  },
989
1664
  {
990
- "internalType": "int256",
991
1665
  "name": "fspBeta",
992
1666
  "type": "int256",
1667
+ "internalType": "int256",
993
1668
  },
994
1669
  {
995
- "internalType": "bytes",
996
1670
  "name": "fsvCalldata",
997
1671
  "type": "bytes",
1672
+ "internalType": "bytes",
998
1673
  },
999
1674
  ],
1000
- "internalType": "struct IProductRegistry.OracleSpecification",
1001
- "name": "oracleSpec",
1002
- "type": "tuple",
1003
- },
1004
- {
1005
- "internalType": "string",
1006
- "name": "priceQuotation",
1007
- "type": "string",
1008
1675
  },
1009
1676
  {
1010
- "internalType": "address",
1011
1677
  "name": "collateralAsset",
1012
1678
  "type": "address",
1679
+ "internalType": "address",
1013
1680
  },
1014
1681
  {
1015
- "internalType": "uint256",
1016
1682
  "name": "startTime",
1017
1683
  "type": "uint256",
1018
- },
1019
- {
1020
1684
  "internalType": "uint256",
1021
- "name": "earliestFSPSubmissionTime",
1022
- "type": "uint256",
1023
1685
  },
1024
1686
  {
1025
- "internalType": "uint256",
1026
- "name": "unitValue",
1687
+ "name": "pointValue",
1027
1688
  "type": "uint256",
1689
+ "internalType": "uint256",
1028
1690
  },
1029
1691
  {
1030
- "internalType": "uint16",
1031
- "name": "initialMarginRequirement",
1032
- "type": "uint16",
1033
- },
1034
- {
1035
- "internalType": "uint16",
1036
- "name": "maintenanceMarginRequirement",
1037
- "type": "uint16",
1038
- },
1039
- {
1040
- "internalType": "uint64",
1041
- "name": "auctionBounty",
1042
- "type": "uint64",
1043
- },
1044
- {
1045
- "internalType": "uint32",
1046
- "name": "tradeoutInterval",
1047
- "type": "uint32",
1692
+ "name": "priceDecimals",
1693
+ "type": "uint8",
1694
+ "internalType": "uint8",
1048
1695
  },
1049
- {"internalType": "uint8", "name": "tickSize", "type": "uint8"},
1050
1696
  {
1051
- "internalType": "string",
1052
1697
  "name": "extendedMetadata",
1053
1698
  "type": "string",
1699
+ "internalType": "string",
1054
1700
  },
1055
1701
  ],
1056
- "internalType": "struct IProductRegistry.Product",
1057
- "name": "",
1058
- "type": "tuple",
1059
- }
1702
+ },
1060
1703
  ],
1061
1704
  "stateMutability": "view",
1062
- "type": "function",
1063
1705
  },
1064
1706
  {
1065
- "inputs": [],
1707
+ "type": "function",
1066
1708
  "name": "proxiableUUID",
1067
- "outputs": [{"internalType": "bytes32", "name": "", "type": "bytes32"}],
1709
+ "inputs": [],
1710
+ "outputs": [{"name": "", "type": "bytes32", "internalType": "bytes32"}],
1068
1711
  "stateMutability": "view",
1069
- "type": "function",
1070
1712
  },
1071
1713
  {
1714
+ "type": "function",
1715
+ "name": "registerFutureProduct",
1072
1716
  "inputs": [
1073
1717
  {
1718
+ "name": "product",
1719
+ "type": "tuple",
1720
+ "internalType": "struct FuturesProductV1",
1074
1721
  "components": [
1075
1722
  {
1723
+ "name": "base",
1724
+ "type": "tuple",
1725
+ "internalType": "struct BaseProduct",
1076
1726
  "components": [
1077
1727
  {
1078
- "internalType": "address",
1079
- "name": "builder",
1728
+ "name": "metadata",
1729
+ "type": "tuple",
1730
+ "internalType": "struct ProductMetadata",
1731
+ "components": [
1732
+ {
1733
+ "name": "builder",
1734
+ "type": "address",
1735
+ "internalType": "address",
1736
+ },
1737
+ {
1738
+ "name": "symbol",
1739
+ "type": "string",
1740
+ "internalType": "string",
1741
+ },
1742
+ {
1743
+ "name": "description",
1744
+ "type": "string",
1745
+ "internalType": "string",
1746
+ },
1747
+ ],
1748
+ },
1749
+ {
1750
+ "name": "oracleSpec",
1751
+ "type": "tuple",
1752
+ "internalType": "struct OracleSpecification",
1753
+ "components": [
1754
+ {
1755
+ "name": "oracleAddress",
1756
+ "type": "address",
1757
+ "internalType": "address",
1758
+ },
1759
+ {
1760
+ "name": "fsvDecimals",
1761
+ "type": "uint8",
1762
+ "internalType": "uint8",
1763
+ },
1764
+ {
1765
+ "name": "fspAlpha",
1766
+ "type": "int256",
1767
+ "internalType": "int256",
1768
+ },
1769
+ {
1770
+ "name": "fspBeta",
1771
+ "type": "int256",
1772
+ "internalType": "int256",
1773
+ },
1774
+ {
1775
+ "name": "fsvCalldata",
1776
+ "type": "bytes",
1777
+ "internalType": "bytes",
1778
+ },
1779
+ ],
1780
+ },
1781
+ {
1782
+ "name": "collateralAsset",
1080
1783
  "type": "address",
1784
+ "internalType": "address",
1081
1785
  },
1082
1786
  {
1083
- "internalType": "string",
1084
- "name": "symbol",
1085
- "type": "string",
1787
+ "name": "startTime",
1788
+ "type": "uint256",
1789
+ "internalType": "uint256",
1086
1790
  },
1087
1791
  {
1088
- "internalType": "string",
1089
- "name": "description",
1792
+ "name": "pointValue",
1793
+ "type": "uint256",
1794
+ "internalType": "uint256",
1795
+ },
1796
+ {
1797
+ "name": "priceDecimals",
1798
+ "type": "uint8",
1799
+ "internalType": "uint8",
1800
+ },
1801
+ {
1802
+ "name": "extendedMetadata",
1090
1803
  "type": "string",
1804
+ "internalType": "string",
1091
1805
  },
1092
1806
  ],
1093
- "internalType": "struct IProductRegistry.ProductMetadata",
1094
- "name": "metadata",
1807
+ },
1808
+ {
1809
+ "name": "expirySpec",
1810
+ "type": "tuple",
1811
+ "internalType": "struct ExpirySpecification",
1812
+ "components": [
1813
+ {
1814
+ "name": "earliestFSPSubmissionTime",
1815
+ "type": "uint256",
1816
+ "internalType": "uint256",
1817
+ },
1818
+ {
1819
+ "name": "tradeoutInterval",
1820
+ "type": "uint256",
1821
+ "internalType": "uint256",
1822
+ },
1823
+ ],
1824
+ },
1825
+ {
1826
+ "name": "marginSpec",
1095
1827
  "type": "tuple",
1828
+ "internalType": "struct MarginSpecification",
1829
+ "components": [
1830
+ {
1831
+ "name": "imr",
1832
+ "type": "uint256",
1833
+ "internalType": "uint256",
1834
+ },
1835
+ {
1836
+ "name": "mmr",
1837
+ "type": "uint256",
1838
+ "internalType": "uint256",
1839
+ },
1840
+ ],
1096
1841
  },
1842
+ ],
1843
+ },
1844
+ {
1845
+ "name": "initialBuilderStake",
1846
+ "type": "uint256",
1847
+ "internalType": "uint256",
1848
+ },
1849
+ ],
1850
+ "outputs": [{"name": "", "type": "bytes32", "internalType": "bytes32"}],
1851
+ "stateMutability": "nonpayable",
1852
+ },
1853
+ {
1854
+ "type": "function",
1855
+ "name": "registerPredictionProduct",
1856
+ "inputs": [
1857
+ {
1858
+ "name": "product",
1859
+ "type": "tuple",
1860
+ "internalType": "struct PredictionProductV1",
1861
+ "components": [
1097
1862
  {
1863
+ "name": "base",
1864
+ "type": "tuple",
1865
+ "internalType": "struct BaseProduct",
1098
1866
  "components": [
1099
1867
  {
1100
- "internalType": "address",
1101
- "name": "oracleAddress",
1868
+ "name": "metadata",
1869
+ "type": "tuple",
1870
+ "internalType": "struct ProductMetadata",
1871
+ "components": [
1872
+ {
1873
+ "name": "builder",
1874
+ "type": "address",
1875
+ "internalType": "address",
1876
+ },
1877
+ {
1878
+ "name": "symbol",
1879
+ "type": "string",
1880
+ "internalType": "string",
1881
+ },
1882
+ {
1883
+ "name": "description",
1884
+ "type": "string",
1885
+ "internalType": "string",
1886
+ },
1887
+ ],
1888
+ },
1889
+ {
1890
+ "name": "oracleSpec",
1891
+ "type": "tuple",
1892
+ "internalType": "struct OracleSpecification",
1893
+ "components": [
1894
+ {
1895
+ "name": "oracleAddress",
1896
+ "type": "address",
1897
+ "internalType": "address",
1898
+ },
1899
+ {
1900
+ "name": "fsvDecimals",
1901
+ "type": "uint8",
1902
+ "internalType": "uint8",
1903
+ },
1904
+ {
1905
+ "name": "fspAlpha",
1906
+ "type": "int256",
1907
+ "internalType": "int256",
1908
+ },
1909
+ {
1910
+ "name": "fspBeta",
1911
+ "type": "int256",
1912
+ "internalType": "int256",
1913
+ },
1914
+ {
1915
+ "name": "fsvCalldata",
1916
+ "type": "bytes",
1917
+ "internalType": "bytes",
1918
+ },
1919
+ ],
1920
+ },
1921
+ {
1922
+ "name": "collateralAsset",
1102
1923
  "type": "address",
1924
+ "internalType": "address",
1103
1925
  },
1104
1926
  {
1105
- "internalType": "uint8",
1106
- "name": "fsvDecimals",
1107
- "type": "uint8",
1927
+ "name": "startTime",
1928
+ "type": "uint256",
1929
+ "internalType": "uint256",
1108
1930
  },
1109
1931
  {
1110
- "internalType": "int256",
1111
- "name": "fspAlpha",
1112
- "type": "int256",
1932
+ "name": "pointValue",
1933
+ "type": "uint256",
1934
+ "internalType": "uint256",
1113
1935
  },
1114
1936
  {
1115
- "internalType": "int256",
1116
- "name": "fspBeta",
1117
- "type": "int256",
1937
+ "name": "priceDecimals",
1938
+ "type": "uint8",
1939
+ "internalType": "uint8",
1118
1940
  },
1119
1941
  {
1120
- "internalType": "bytes",
1121
- "name": "fsvCalldata",
1122
- "type": "bytes",
1942
+ "name": "extendedMetadata",
1943
+ "type": "string",
1944
+ "internalType": "string",
1123
1945
  },
1124
1946
  ],
1125
- "internalType": "struct IProductRegistry.OracleSpecification",
1126
- "name": "oracleSpec",
1127
- "type": "tuple",
1128
- },
1129
- {
1130
- "internalType": "string",
1131
- "name": "priceQuotation",
1132
- "type": "string",
1133
- },
1134
- {
1135
- "internalType": "address",
1136
- "name": "collateralAsset",
1137
- "type": "address",
1138
- },
1139
- {
1140
- "internalType": "uint256",
1141
- "name": "startTime",
1142
- "type": "uint256",
1143
1947
  },
1144
1948
  {
1145
- "internalType": "uint256",
1146
- "name": "earliestFSPSubmissionTime",
1147
- "type": "uint256",
1949
+ "name": "expirySpec",
1950
+ "type": "tuple",
1951
+ "internalType": "struct ExpirySpecification",
1952
+ "components": [
1953
+ {
1954
+ "name": "earliestFSPSubmissionTime",
1955
+ "type": "uint256",
1956
+ "internalType": "uint256",
1957
+ },
1958
+ {
1959
+ "name": "tradeoutInterval",
1960
+ "type": "uint256",
1961
+ "internalType": "uint256",
1962
+ },
1963
+ ],
1148
1964
  },
1149
1965
  {
1150
- "internalType": "uint256",
1151
- "name": "unitValue",
1152
- "type": "uint256",
1966
+ "name": "maxPrice",
1967
+ "type": "int256",
1968
+ "internalType": "int256",
1153
1969
  },
1154
1970
  {
1155
- "internalType": "uint16",
1156
- "name": "initialMarginRequirement",
1157
- "type": "uint16",
1971
+ "name": "minPrice",
1972
+ "type": "int256",
1973
+ "internalType": "int256",
1158
1974
  },
1975
+ ],
1976
+ },
1977
+ {
1978
+ "name": "initialBuilderStake",
1979
+ "type": "uint256",
1980
+ "internalType": "uint256",
1981
+ },
1982
+ ],
1983
+ "outputs": [{"name": "", "type": "bytes32", "internalType": "bytes32"}],
1984
+ "stateMutability": "nonpayable",
1985
+ },
1986
+ {
1987
+ "type": "function",
1988
+ "name": "registerPredictionProductFor",
1989
+ "inputs": [
1990
+ {
1991
+ "name": "product",
1992
+ "type": "tuple",
1993
+ "internalType": "struct PredictionProductV1",
1994
+ "components": [
1159
1995
  {
1160
- "internalType": "uint16",
1161
- "name": "maintenanceMarginRequirement",
1162
- "type": "uint16",
1996
+ "name": "base",
1997
+ "type": "tuple",
1998
+ "internalType": "struct BaseProduct",
1999
+ "components": [
2000
+ {
2001
+ "name": "metadata",
2002
+ "type": "tuple",
2003
+ "internalType": "struct ProductMetadata",
2004
+ "components": [
2005
+ {
2006
+ "name": "builder",
2007
+ "type": "address",
2008
+ "internalType": "address",
2009
+ },
2010
+ {
2011
+ "name": "symbol",
2012
+ "type": "string",
2013
+ "internalType": "string",
2014
+ },
2015
+ {
2016
+ "name": "description",
2017
+ "type": "string",
2018
+ "internalType": "string",
2019
+ },
2020
+ ],
2021
+ },
2022
+ {
2023
+ "name": "oracleSpec",
2024
+ "type": "tuple",
2025
+ "internalType": "struct OracleSpecification",
2026
+ "components": [
2027
+ {
2028
+ "name": "oracleAddress",
2029
+ "type": "address",
2030
+ "internalType": "address",
2031
+ },
2032
+ {
2033
+ "name": "fsvDecimals",
2034
+ "type": "uint8",
2035
+ "internalType": "uint8",
2036
+ },
2037
+ {
2038
+ "name": "fspAlpha",
2039
+ "type": "int256",
2040
+ "internalType": "int256",
2041
+ },
2042
+ {
2043
+ "name": "fspBeta",
2044
+ "type": "int256",
2045
+ "internalType": "int256",
2046
+ },
2047
+ {
2048
+ "name": "fsvCalldata",
2049
+ "type": "bytes",
2050
+ "internalType": "bytes",
2051
+ },
2052
+ ],
2053
+ },
2054
+ {
2055
+ "name": "collateralAsset",
2056
+ "type": "address",
2057
+ "internalType": "address",
2058
+ },
2059
+ {
2060
+ "name": "startTime",
2061
+ "type": "uint256",
2062
+ "internalType": "uint256",
2063
+ },
2064
+ {
2065
+ "name": "pointValue",
2066
+ "type": "uint256",
2067
+ "internalType": "uint256",
2068
+ },
2069
+ {
2070
+ "name": "priceDecimals",
2071
+ "type": "uint8",
2072
+ "internalType": "uint8",
2073
+ },
2074
+ {
2075
+ "name": "extendedMetadata",
2076
+ "type": "string",
2077
+ "internalType": "string",
2078
+ },
2079
+ ],
1163
2080
  },
1164
2081
  {
1165
- "internalType": "uint64",
1166
- "name": "auctionBounty",
1167
- "type": "uint64",
2082
+ "name": "expirySpec",
2083
+ "type": "tuple",
2084
+ "internalType": "struct ExpirySpecification",
2085
+ "components": [
2086
+ {
2087
+ "name": "earliestFSPSubmissionTime",
2088
+ "type": "uint256",
2089
+ "internalType": "uint256",
2090
+ },
2091
+ {
2092
+ "name": "tradeoutInterval",
2093
+ "type": "uint256",
2094
+ "internalType": "uint256",
2095
+ },
2096
+ ],
1168
2097
  },
1169
2098
  {
1170
- "internalType": "uint32",
1171
- "name": "tradeoutInterval",
1172
- "type": "uint32",
2099
+ "name": "maxPrice",
2100
+ "type": "int256",
2101
+ "internalType": "int256",
1173
2102
  },
1174
- {"internalType": "uint8", "name": "tickSize", "type": "uint8"},
1175
2103
  {
1176
- "internalType": "string",
1177
- "name": "extendedMetadata",
1178
- "type": "string",
2104
+ "name": "minPrice",
2105
+ "type": "int256",
2106
+ "internalType": "int256",
1179
2107
  },
1180
2108
  ],
1181
- "internalType": "struct IProductRegistry.Product",
1182
- "name": "product",
1183
- "type": "tuple",
1184
- }
2109
+ },
2110
+ {
2111
+ "name": "initialBuilderStake",
2112
+ "type": "uint256",
2113
+ "internalType": "uint256",
2114
+ },
1185
2115
  ],
1186
- "name": "register",
1187
- "outputs": [],
2116
+ "outputs": [{"name": "", "type": "bytes32", "internalType": "bytes32"}],
1188
2117
  "stateMutability": "nonpayable",
1189
- "type": "function",
1190
2118
  },
1191
2119
  {
1192
- "inputs": [],
1193
- "name": "renounceOwnership",
2120
+ "type": "function",
2121
+ "name": "removeAllowed",
2122
+ "inputs": [{"name": "addr", "type": "address", "internalType": "address"}],
1194
2123
  "outputs": [],
1195
2124
  "stateMutability": "nonpayable",
1196
- "type": "function",
1197
2125
  },
1198
2126
  {
1199
- "inputs": [
1200
- {
1201
- "internalType": "contract IClearingSubset",
1202
- "name": "clearing_",
1203
- "type": "address",
1204
- }
1205
- ],
1206
- "name": "setClearing",
2127
+ "type": "function",
2128
+ "name": "renounceOwnership",
2129
+ "inputs": [],
1207
2130
  "outputs": [],
1208
2131
  "stateMutability": "nonpayable",
1209
- "type": "function",
1210
2132
  },
1211
2133
  {
2134
+ "type": "function",
2135
+ "name": "state",
1212
2136
  "inputs": [
1213
- {"internalType": "bytes32", "name": "productId", "type": "bytes32"}
2137
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
1214
2138
  ],
1215
- "name": "state",
1216
2139
  "outputs": [
1217
- {"internalType": "enum ProductState", "name": "", "type": "uint8"}
2140
+ {"name": "", "type": "uint8", "internalType": "enum ProductState"}
1218
2141
  ],
1219
2142
  "stateMutability": "view",
1220
- "type": "function",
1221
2143
  },
1222
2144
  {
2145
+ "type": "function",
2146
+ "name": "tickSize",
1223
2147
  "inputs": [
1224
- {"internalType": "bytes32", "name": "productId", "type": "bytes32"}
2148
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
1225
2149
  ],
1226
- "name": "tickSize",
1227
- "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
2150
+ "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}],
1228
2151
  "stateMutability": "view",
1229
- "type": "function",
1230
2152
  },
1231
2153
  {
2154
+ "type": "function",
2155
+ "name": "transferOwnership",
1232
2156
  "inputs": [
1233
- {"internalType": "address", "name": "newOwner", "type": "address"}
2157
+ {"name": "newOwner", "type": "address", "internalType": "address"}
1234
2158
  ],
1235
- "name": "transferOwnership",
1236
2159
  "outputs": [],
1237
2160
  "stateMutability": "nonpayable",
1238
- "type": "function",
1239
2161
  },
1240
2162
  {
2163
+ "type": "function",
2164
+ "name": "upgradeToAndCall",
1241
2165
  "inputs": [
1242
2166
  {
1243
- "internalType": "address",
1244
2167
  "name": "newImplementation",
1245
2168
  "type": "address",
2169
+ "internalType": "address",
1246
2170
  },
1247
- {"internalType": "bytes", "name": "data", "type": "bytes"},
2171
+ {"name": "data", "type": "bytes", "internalType": "bytes"},
1248
2172
  ],
1249
- "name": "upgradeToAndCall",
1250
2173
  "outputs": [],
1251
2174
  "stateMutability": "payable",
1252
- "type": "function",
2175
+ },
2176
+ {
2177
+ "type": "event",
2178
+ "name": "Initialized",
2179
+ "inputs": [
2180
+ {
2181
+ "name": "version",
2182
+ "type": "uint64",
2183
+ "indexed": False,
2184
+ "internalType": "uint64",
2185
+ }
2186
+ ],
2187
+ "anonymous": False,
2188
+ },
2189
+ {
2190
+ "type": "event",
2191
+ "name": "OwnershipTransferred",
2192
+ "inputs": [
2193
+ {
2194
+ "name": "previousOwner",
2195
+ "type": "address",
2196
+ "indexed": True,
2197
+ "internalType": "address",
2198
+ },
2199
+ {
2200
+ "name": "newOwner",
2201
+ "type": "address",
2202
+ "indexed": True,
2203
+ "internalType": "address",
2204
+ },
2205
+ ],
2206
+ "anonymous": False,
2207
+ },
2208
+ {
2209
+ "type": "event",
2210
+ "name": "ProductRegistered",
2211
+ "inputs": [
2212
+ {
2213
+ "name": "builder",
2214
+ "type": "address",
2215
+ "indexed": True,
2216
+ "internalType": "address",
2217
+ },
2218
+ {
2219
+ "name": "productId",
2220
+ "type": "bytes32",
2221
+ "indexed": False,
2222
+ "internalType": "bytes32",
2223
+ },
2224
+ ],
2225
+ "anonymous": False,
2226
+ },
2227
+ {
2228
+ "type": "event",
2229
+ "name": "Upgraded",
2230
+ "inputs": [
2231
+ {
2232
+ "name": "implementation",
2233
+ "type": "address",
2234
+ "indexed": True,
2235
+ "internalType": "address",
2236
+ }
2237
+ ],
2238
+ "anonymous": False,
2239
+ },
2240
+ {
2241
+ "type": "error",
2242
+ "name": "AddressEmptyCode",
2243
+ "inputs": [
2244
+ {"name": "target", "type": "address", "internalType": "address"}
2245
+ ],
2246
+ },
2247
+ {
2248
+ "type": "error",
2249
+ "name": "ERC1967InvalidImplementation",
2250
+ "inputs": [
2251
+ {"name": "implementation", "type": "address", "internalType": "address"}
2252
+ ],
2253
+ },
2254
+ {"type": "error", "name": "ERC1967NonPayable", "inputs": []},
2255
+ {"type": "error", "name": "FailedCall", "inputs": []},
2256
+ {"type": "error", "name": "InvalidInitialization", "inputs": []},
2257
+ {
2258
+ "type": "error",
2259
+ "name": "InvalidParameter",
2260
+ "inputs": [
2261
+ {"name": "paramName", "type": "string", "internalType": "string"}
2262
+ ],
2263
+ },
2264
+ {"type": "error", "name": "NotInitializing", "inputs": []},
2265
+ {
2266
+ "type": "error",
2267
+ "name": "OwnableInvalidOwner",
2268
+ "inputs": [{"name": "owner", "type": "address", "internalType": "address"}],
2269
+ },
2270
+ {
2271
+ "type": "error",
2272
+ "name": "OwnableUnauthorizedAccount",
2273
+ "inputs": [
2274
+ {"name": "account", "type": "address", "internalType": "address"}
2275
+ ],
2276
+ },
2277
+ {"type": "error", "name": "UUPSUnauthorizedCallContext", "inputs": []},
2278
+ {
2279
+ "type": "error",
2280
+ "name": "UUPSUnsupportedProxiableUUID",
2281
+ "inputs": [{"name": "slot", "type": "bytes32", "internalType": "bytes32"}],
2282
+ },
2283
+ {
2284
+ "type": "error",
2285
+ "name": "Unauthorized",
2286
+ "inputs": [
2287
+ {"name": "account", "type": "address", "internalType": "address"}
2288
+ ],
1253
2289
  },
1254
2290
  ],
1255
2291
  )