afp-sdk 0.5.4__py3-none-any.whl → 0.6.1__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.
- afp/__init__.py +4 -1
- afp/afp.py +11 -0
- afp/api/admin.py +1 -1
- afp/api/base.py +11 -2
- afp/api/margin_account.py +12 -148
- afp/api/product.py +302 -148
- afp/api/trading.py +10 -19
- afp/auth.py +14 -0
- afp/bindings/__init__.py +30 -16
- afp/bindings/admin_facet.py +890 -0
- afp/bindings/clearing_facet.py +356 -773
- afp/bindings/facade.py +9 -6
- afp/bindings/final_settlement_facet.py +258 -99
- afp/bindings/margin_account.py +524 -839
- afp/bindings/margin_account_facet.py +722 -0
- afp/bindings/margin_account_registry.py +184 -310
- afp/bindings/mark_price_tracker_facet.py +74 -16
- afp/bindings/product_registry.py +1577 -541
- afp/bindings/product_registry_facet.py +1467 -0
- afp/bindings/system_viewer.py +592 -369
- afp/bindings/types.py +223 -0
- afp/config.py +4 -0
- afp/constants.py +49 -6
- afp/decorators.py +25 -3
- afp/dtos.py +142 -0
- afp/exceptions.py +10 -0
- afp/exchange.py +10 -8
- afp/hashing.py +7 -5
- afp/ipfs.py +245 -0
- afp/json-schemas/bafyreiaw34o6l3rmatabzbds2i2myazdw2yolevcpsoyd2i2g3ms7wa2eq.json +1 -0
- afp/json-schemas/bafyreibnfg6nq74dvpkre5rakkccij7iadp5rxpim7omsatjnrpmj3y7v4.json +1 -0
- afp/json-schemas/bafyreicgr6dfo5yduixjkcifghiulskfegwojvuwodtouvivl362zndhxe.json +1 -0
- afp/json-schemas/bafyreicheoypx6synljushh7mq2572iyhlolf4nake2p5dwobgnj3r5eua.json +1 -0
- afp/json-schemas/bafyreid35a67db4sqh4fs6boddyt2xvscbqy6nqvsp5jjur56qhkw4ixre.json +1 -0
- afp/json-schemas/bafyreidzs7okcpqiss6ztftltyptqwnw5e5opsy5yntospekjha4kpykaa.json +1 -0
- afp/json-schemas/bafyreifcec2km7hxwq6oqzjlspni2mgipetjb7pqtaewh2efislzoctboi.json +1 -0
- afp/json-schemas/bafyreihn3oiaxffe4e2w7pwtreadpw3obfd7gqlogbcxm56jc2hzfvco74.json +1 -0
- afp/json-schemas/bafyreihur3dzwhja6uxsbcw6eeoj3xmmc4e3zkmyzpot5v5dleevxe5zam.json +1 -0
- afp/schemas.py +236 -177
- afp/types.py +169 -0
- afp/validators.py +218 -8
- {afp_sdk-0.5.4.dist-info → afp_sdk-0.6.1.dist-info}/METADATA +76 -11
- afp_sdk-0.6.1.dist-info/RECORD +50 -0
- afp/bindings/auctioneer_facet.py +0 -752
- afp/bindings/bankruptcy_facet.py +0 -391
- afp/bindings/trading_protocol.py +0 -1158
- afp_sdk-0.5.4.dist-info/RECORD +0 -37
- {afp_sdk-0.5.4.dist-info → afp_sdk-0.6.1.dist-info}/WHEEL +0 -0
- {afp_sdk-0.5.4.dist-info → afp_sdk-0.6.1.dist-info}/licenses/LICENSE +0 -0
afp/bindings/auctioneer_facet.py
DELETED
|
@@ -1,752 +0,0 @@
|
|
|
1
|
-
"""AuctioneerFacet contract binding and data structures."""
|
|
2
|
-
|
|
3
|
-
# This module has been generated using pyabigen v0.2.16
|
|
4
|
-
|
|
5
|
-
import typing
|
|
6
|
-
from dataclasses import dataclass
|
|
7
|
-
|
|
8
|
-
import eth_typing
|
|
9
|
-
import hexbytes
|
|
10
|
-
import web3
|
|
11
|
-
from web3.contract import contract
|
|
12
|
-
|
|
13
|
-
from .clearing_facet import Side
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@dataclass
|
|
17
|
-
class AuctionConfig:
|
|
18
|
-
"""Port of `struct AuctionConfig` on the IAuctioneer contract."""
|
|
19
|
-
|
|
20
|
-
restoration_buffer: int
|
|
21
|
-
liquidation_duration: int
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@dataclass
|
|
25
|
-
class AuctionData:
|
|
26
|
-
"""Port of `struct AuctionData` on the IAuctioneer contract."""
|
|
27
|
-
|
|
28
|
-
start_block: int
|
|
29
|
-
mae_at_initiation: int
|
|
30
|
-
mmu_at_initiation: int
|
|
31
|
-
mae_now: int
|
|
32
|
-
mmu_now: int
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
@dataclass
|
|
36
|
-
class BidData:
|
|
37
|
-
"""Port of `struct BidData` on the IAuctioneer contract."""
|
|
38
|
-
|
|
39
|
-
product_id: hexbytes.HexBytes
|
|
40
|
-
price: int
|
|
41
|
-
quantity: int
|
|
42
|
-
side: Side
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
class AuctioneerFacet:
|
|
46
|
-
"""AuctioneerFacet contract binding.
|
|
47
|
-
|
|
48
|
-
Parameters
|
|
49
|
-
----------
|
|
50
|
-
w3 : web3.Web3
|
|
51
|
-
address : eth_typing.ChecksumAddress
|
|
52
|
-
The address of a deployed AuctioneerFacet contract.
|
|
53
|
-
"""
|
|
54
|
-
|
|
55
|
-
_contract: contract.Contract
|
|
56
|
-
|
|
57
|
-
def __init__(
|
|
58
|
-
self,
|
|
59
|
-
w3: web3.Web3,
|
|
60
|
-
address: eth_typing.ChecksumAddress,
|
|
61
|
-
):
|
|
62
|
-
self._contract = w3.eth.contract(
|
|
63
|
-
address=address,
|
|
64
|
-
abi=ABI,
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
@property
|
|
68
|
-
def Auctioned(self) -> contract.ContractEvent:
|
|
69
|
-
"""Binding for `event Auctioned` on the AuctioneerFacet contract."""
|
|
70
|
-
return self._contract.events.Auctioned
|
|
71
|
-
|
|
72
|
-
@property
|
|
73
|
-
def LiquidationStarted(self) -> contract.ContractEvent:
|
|
74
|
-
"""Binding for `event LiquidationStarted` on the AuctioneerFacet contract."""
|
|
75
|
-
return self._contract.events.LiquidationStarted
|
|
76
|
-
|
|
77
|
-
@property
|
|
78
|
-
def LiquidationTerminated(self) -> contract.ContractEvent:
|
|
79
|
-
"""Binding for `event LiquidationTerminated` on the AuctioneerFacet contract."""
|
|
80
|
-
return self._contract.events.LiquidationTerminated
|
|
81
|
-
|
|
82
|
-
def auction_config(
|
|
83
|
-
self,
|
|
84
|
-
) -> AuctionConfig:
|
|
85
|
-
"""Binding for `auctionConfig` on the AuctioneerFacet contract.
|
|
86
|
-
|
|
87
|
-
Returns
|
|
88
|
-
-------
|
|
89
|
-
AuctionConfig
|
|
90
|
-
"""
|
|
91
|
-
return_value = self._contract.functions.auctionConfig().call()
|
|
92
|
-
return AuctionConfig(int(return_value[0]), int(return_value[1]))
|
|
93
|
-
|
|
94
|
-
def auction_data(
|
|
95
|
-
self,
|
|
96
|
-
margin_account_id: eth_typing.ChecksumAddress,
|
|
97
|
-
collateral: eth_typing.ChecksumAddress,
|
|
98
|
-
) -> AuctionData:
|
|
99
|
-
"""Binding for `auctionData` on the AuctioneerFacet contract.
|
|
100
|
-
|
|
101
|
-
Parameters
|
|
102
|
-
----------
|
|
103
|
-
margin_account_id : eth_typing.ChecksumAddress
|
|
104
|
-
collateral : eth_typing.ChecksumAddress
|
|
105
|
-
|
|
106
|
-
Returns
|
|
107
|
-
-------
|
|
108
|
-
AuctionData
|
|
109
|
-
"""
|
|
110
|
-
return_value = self._contract.functions.auctionData(
|
|
111
|
-
margin_account_id,
|
|
112
|
-
collateral,
|
|
113
|
-
).call()
|
|
114
|
-
return AuctionData(
|
|
115
|
-
int(return_value[0]),
|
|
116
|
-
int(return_value[1]),
|
|
117
|
-
int(return_value[2]),
|
|
118
|
-
int(return_value[3]),
|
|
119
|
-
int(return_value[4]),
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
def bid_auction(
|
|
123
|
-
self,
|
|
124
|
-
margin_account_id: eth_typing.ChecksumAddress,
|
|
125
|
-
collateral_token: eth_typing.ChecksumAddress,
|
|
126
|
-
bids: typing.List[BidData],
|
|
127
|
-
) -> contract.ContractFunction:
|
|
128
|
-
"""Binding for `bidAuction` on the AuctioneerFacet contract.
|
|
129
|
-
|
|
130
|
-
Parameters
|
|
131
|
-
----------
|
|
132
|
-
margin_account_id : eth_typing.ChecksumAddress
|
|
133
|
-
collateral_token : eth_typing.ChecksumAddress
|
|
134
|
-
bids : typing.List[BidData]
|
|
135
|
-
|
|
136
|
-
Returns
|
|
137
|
-
-------
|
|
138
|
-
web3.contract.contract.ContractFunction
|
|
139
|
-
A contract function instance to be sent in a transaction.
|
|
140
|
-
"""
|
|
141
|
-
return self._contract.functions.bidAuction(
|
|
142
|
-
margin_account_id,
|
|
143
|
-
collateral_token,
|
|
144
|
-
[
|
|
145
|
-
(item.product_id, item.price, item.quantity, int(item.side))
|
|
146
|
-
for item in bids
|
|
147
|
-
],
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
def can_terminate_auctions(
|
|
151
|
-
self,
|
|
152
|
-
margin_account_id: eth_typing.ChecksumAddress,
|
|
153
|
-
collateral: eth_typing.ChecksumAddress,
|
|
154
|
-
) -> bool:
|
|
155
|
-
"""Binding for `canTerminateAuctions` on the AuctioneerFacet contract.
|
|
156
|
-
|
|
157
|
-
Parameters
|
|
158
|
-
----------
|
|
159
|
-
margin_account_id : eth_typing.ChecksumAddress
|
|
160
|
-
collateral : eth_typing.ChecksumAddress
|
|
161
|
-
|
|
162
|
-
Returns
|
|
163
|
-
-------
|
|
164
|
-
bool
|
|
165
|
-
"""
|
|
166
|
-
return_value = self._contract.functions.canTerminateAuctions(
|
|
167
|
-
margin_account_id,
|
|
168
|
-
collateral,
|
|
169
|
-
).call()
|
|
170
|
-
return bool(return_value)
|
|
171
|
-
|
|
172
|
-
def is_liquidatable(
|
|
173
|
-
self,
|
|
174
|
-
margin_account_id: eth_typing.ChecksumAddress,
|
|
175
|
-
collateral_token: eth_typing.ChecksumAddress,
|
|
176
|
-
) -> bool:
|
|
177
|
-
"""Binding for `isLiquidatable` on the AuctioneerFacet contract.
|
|
178
|
-
|
|
179
|
-
Parameters
|
|
180
|
-
----------
|
|
181
|
-
margin_account_id : eth_typing.ChecksumAddress
|
|
182
|
-
collateral_token : eth_typing.ChecksumAddress
|
|
183
|
-
|
|
184
|
-
Returns
|
|
185
|
-
-------
|
|
186
|
-
bool
|
|
187
|
-
"""
|
|
188
|
-
return_value = self._contract.functions.isLiquidatable(
|
|
189
|
-
margin_account_id,
|
|
190
|
-
collateral_token,
|
|
191
|
-
).call()
|
|
192
|
-
return bool(return_value)
|
|
193
|
-
|
|
194
|
-
def is_liquidating(
|
|
195
|
-
self,
|
|
196
|
-
margin_account_id: eth_typing.ChecksumAddress,
|
|
197
|
-
collateral_token: eth_typing.ChecksumAddress,
|
|
198
|
-
) -> bool:
|
|
199
|
-
"""Binding for `isLiquidating` on the AuctioneerFacet contract.
|
|
200
|
-
|
|
201
|
-
Parameters
|
|
202
|
-
----------
|
|
203
|
-
margin_account_id : eth_typing.ChecksumAddress
|
|
204
|
-
collateral_token : eth_typing.ChecksumAddress
|
|
205
|
-
|
|
206
|
-
Returns
|
|
207
|
-
-------
|
|
208
|
-
bool
|
|
209
|
-
"""
|
|
210
|
-
return_value = self._contract.functions.isLiquidating(
|
|
211
|
-
margin_account_id,
|
|
212
|
-
collateral_token,
|
|
213
|
-
).call()
|
|
214
|
-
return bool(return_value)
|
|
215
|
-
|
|
216
|
-
def mae_check_on_bid(
|
|
217
|
-
self,
|
|
218
|
-
liquidator_margin_account_id: eth_typing.ChecksumAddress,
|
|
219
|
-
liquidating_margin_account_id: eth_typing.ChecksumAddress,
|
|
220
|
-
collateral: eth_typing.ChecksumAddress,
|
|
221
|
-
bids: typing.List[BidData],
|
|
222
|
-
) -> typing.Tuple[bool, bool]:
|
|
223
|
-
"""Binding for `maeCheckOnBid` on the AuctioneerFacet contract.
|
|
224
|
-
|
|
225
|
-
Parameters
|
|
226
|
-
----------
|
|
227
|
-
liquidator_margin_account_id : eth_typing.ChecksumAddress
|
|
228
|
-
liquidating_margin_account_id : eth_typing.ChecksumAddress
|
|
229
|
-
collateral : eth_typing.ChecksumAddress
|
|
230
|
-
bids : typing.List[BidData]
|
|
231
|
-
|
|
232
|
-
Returns
|
|
233
|
-
-------
|
|
234
|
-
bool
|
|
235
|
-
bool
|
|
236
|
-
"""
|
|
237
|
-
return_value = self._contract.functions.maeCheckOnBid(
|
|
238
|
-
liquidator_margin_account_id,
|
|
239
|
-
liquidating_margin_account_id,
|
|
240
|
-
collateral,
|
|
241
|
-
[
|
|
242
|
-
(item.product_id, item.price, item.quantity, int(item.side))
|
|
243
|
-
for item in bids
|
|
244
|
-
],
|
|
245
|
-
).call()
|
|
246
|
-
return (
|
|
247
|
-
bool(return_value[0]),
|
|
248
|
-
bool(return_value[1]),
|
|
249
|
-
)
|
|
250
|
-
|
|
251
|
-
def max_mae_offered(
|
|
252
|
-
self,
|
|
253
|
-
margin_account_id: eth_typing.ChecksumAddress,
|
|
254
|
-
collateral: eth_typing.ChecksumAddress,
|
|
255
|
-
mmu_decreased: int,
|
|
256
|
-
) -> int:
|
|
257
|
-
"""Binding for `maxMaeOffered` on the AuctioneerFacet contract.
|
|
258
|
-
|
|
259
|
-
Parameters
|
|
260
|
-
----------
|
|
261
|
-
margin_account_id : eth_typing.ChecksumAddress
|
|
262
|
-
collateral : eth_typing.ChecksumAddress
|
|
263
|
-
mmu_decreased : int
|
|
264
|
-
|
|
265
|
-
Returns
|
|
266
|
-
-------
|
|
267
|
-
int
|
|
268
|
-
"""
|
|
269
|
-
return_value = self._contract.functions.maxMaeOffered(
|
|
270
|
-
margin_account_id,
|
|
271
|
-
collateral,
|
|
272
|
-
mmu_decreased,
|
|
273
|
-
).call()
|
|
274
|
-
return int(return_value)
|
|
275
|
-
|
|
276
|
-
def request_liquidation(
|
|
277
|
-
self,
|
|
278
|
-
margin_account_id: eth_typing.ChecksumAddress,
|
|
279
|
-
collateral_token: eth_typing.ChecksumAddress,
|
|
280
|
-
) -> contract.ContractFunction:
|
|
281
|
-
"""Binding for `requestLiquidation` on the AuctioneerFacet contract.
|
|
282
|
-
|
|
283
|
-
Parameters
|
|
284
|
-
----------
|
|
285
|
-
margin_account_id : eth_typing.ChecksumAddress
|
|
286
|
-
collateral_token : eth_typing.ChecksumAddress
|
|
287
|
-
|
|
288
|
-
Returns
|
|
289
|
-
-------
|
|
290
|
-
web3.contract.contract.ContractFunction
|
|
291
|
-
A contract function instance to be sent in a transaction.
|
|
292
|
-
"""
|
|
293
|
-
return self._contract.functions.requestLiquidation(
|
|
294
|
-
margin_account_id,
|
|
295
|
-
collateral_token,
|
|
296
|
-
)
|
|
297
|
-
|
|
298
|
-
def terminate_auctions(
|
|
299
|
-
self,
|
|
300
|
-
margin_account_id: eth_typing.ChecksumAddress,
|
|
301
|
-
collateral: eth_typing.ChecksumAddress,
|
|
302
|
-
) -> contract.ContractFunction:
|
|
303
|
-
"""Binding for `terminateAuctions` on the AuctioneerFacet contract.
|
|
304
|
-
|
|
305
|
-
Parameters
|
|
306
|
-
----------
|
|
307
|
-
margin_account_id : eth_typing.ChecksumAddress
|
|
308
|
-
collateral : eth_typing.ChecksumAddress
|
|
309
|
-
|
|
310
|
-
Returns
|
|
311
|
-
-------
|
|
312
|
-
web3.contract.contract.ContractFunction
|
|
313
|
-
A contract function instance to be sent in a transaction.
|
|
314
|
-
"""
|
|
315
|
-
return self._contract.functions.terminateAuctions(
|
|
316
|
-
margin_account_id,
|
|
317
|
-
collateral,
|
|
318
|
-
)
|
|
319
|
-
|
|
320
|
-
def validate_auctions(
|
|
321
|
-
self,
|
|
322
|
-
margin_account_id: eth_typing.ChecksumAddress,
|
|
323
|
-
collateral_token: eth_typing.ChecksumAddress,
|
|
324
|
-
bids: typing.List[BidData],
|
|
325
|
-
) -> bool:
|
|
326
|
-
"""Binding for `validateAuctions` on the AuctioneerFacet contract.
|
|
327
|
-
|
|
328
|
-
Parameters
|
|
329
|
-
----------
|
|
330
|
-
margin_account_id : eth_typing.ChecksumAddress
|
|
331
|
-
collateral_token : eth_typing.ChecksumAddress
|
|
332
|
-
bids : typing.List[BidData]
|
|
333
|
-
|
|
334
|
-
Returns
|
|
335
|
-
-------
|
|
336
|
-
bool
|
|
337
|
-
"""
|
|
338
|
-
return_value = self._contract.functions.validateAuctions(
|
|
339
|
-
margin_account_id,
|
|
340
|
-
collateral_token,
|
|
341
|
-
[
|
|
342
|
-
(item.product_id, item.price, item.quantity, int(item.side))
|
|
343
|
-
for item in bids
|
|
344
|
-
],
|
|
345
|
-
).call()
|
|
346
|
-
return bool(return_value)
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
ABI = typing.cast(
|
|
350
|
-
eth_typing.ABI,
|
|
351
|
-
[
|
|
352
|
-
{"inputs": [], "name": "AuctionBidFailed", "type": "error"},
|
|
353
|
-
{"inputs": [], "name": "AuctionBountyFeeTooHigh", "type": "error"},
|
|
354
|
-
{
|
|
355
|
-
"inputs": [
|
|
356
|
-
{"internalType": "string", "name": "paramName", "type": "string"}
|
|
357
|
-
],
|
|
358
|
-
"name": "InvalidParameter",
|
|
359
|
-
"type": "error",
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
"inputs": [
|
|
363
|
-
{"internalType": "enum ProductState", "name": "state", "type": "uint8"}
|
|
364
|
-
],
|
|
365
|
-
"name": "InvalidProductState",
|
|
366
|
-
"type": "error",
|
|
367
|
-
},
|
|
368
|
-
{"inputs": [], "name": "Liquidating", "type": "error"},
|
|
369
|
-
{"inputs": [], "name": "LiquidationRequestFailed", "type": "error"},
|
|
370
|
-
{
|
|
371
|
-
"inputs": [
|
|
372
|
-
{"internalType": "address", "name": "marginAccount", "type": "address"}
|
|
373
|
-
],
|
|
374
|
-
"name": "MAECheckFailed",
|
|
375
|
-
"type": "error",
|
|
376
|
-
},
|
|
377
|
-
{"inputs": [], "name": "MaeOverMmuRateExceeded", "type": "error"},
|
|
378
|
-
{
|
|
379
|
-
"inputs": [
|
|
380
|
-
{"internalType": "bytes32", "name": "productId", "type": "bytes32"}
|
|
381
|
-
],
|
|
382
|
-
"name": "NoTradeData",
|
|
383
|
-
"type": "error",
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
"inputs": [
|
|
387
|
-
{"internalType": "address", "name": "account", "type": "address"}
|
|
388
|
-
],
|
|
389
|
-
"name": "Unauthorized",
|
|
390
|
-
"type": "error",
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
"anonymous": False,
|
|
394
|
-
"inputs": [
|
|
395
|
-
{
|
|
396
|
-
"indexed": True,
|
|
397
|
-
"internalType": "address",
|
|
398
|
-
"name": "liquidatingMarginAccountID",
|
|
399
|
-
"type": "address",
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
"indexed": True,
|
|
403
|
-
"internalType": "address",
|
|
404
|
-
"name": "liquidatorMarginAccountID",
|
|
405
|
-
"type": "address",
|
|
406
|
-
},
|
|
407
|
-
{
|
|
408
|
-
"indexed": False,
|
|
409
|
-
"internalType": "bytes32",
|
|
410
|
-
"name": "productId",
|
|
411
|
-
"type": "bytes32",
|
|
412
|
-
},
|
|
413
|
-
{
|
|
414
|
-
"indexed": False,
|
|
415
|
-
"internalType": "int256",
|
|
416
|
-
"name": "quantity",
|
|
417
|
-
"type": "int256",
|
|
418
|
-
},
|
|
419
|
-
{
|
|
420
|
-
"indexed": False,
|
|
421
|
-
"internalType": "uint256",
|
|
422
|
-
"name": "price",
|
|
423
|
-
"type": "uint256",
|
|
424
|
-
},
|
|
425
|
-
],
|
|
426
|
-
"name": "Auctioned",
|
|
427
|
-
"type": "event",
|
|
428
|
-
},
|
|
429
|
-
{
|
|
430
|
-
"anonymous": False,
|
|
431
|
-
"inputs": [
|
|
432
|
-
{
|
|
433
|
-
"indexed": True,
|
|
434
|
-
"internalType": "address",
|
|
435
|
-
"name": "marginAccountID",
|
|
436
|
-
"type": "address",
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
"indexed": True,
|
|
440
|
-
"internalType": "address",
|
|
441
|
-
"name": "collateralToken",
|
|
442
|
-
"type": "address",
|
|
443
|
-
},
|
|
444
|
-
],
|
|
445
|
-
"name": "LiquidationStarted",
|
|
446
|
-
"type": "event",
|
|
447
|
-
},
|
|
448
|
-
{
|
|
449
|
-
"anonymous": False,
|
|
450
|
-
"inputs": [
|
|
451
|
-
{
|
|
452
|
-
"indexed": True,
|
|
453
|
-
"internalType": "address",
|
|
454
|
-
"name": "marginAccountID",
|
|
455
|
-
"type": "address",
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
"indexed": True,
|
|
459
|
-
"internalType": "address",
|
|
460
|
-
"name": "collateralToken",
|
|
461
|
-
"type": "address",
|
|
462
|
-
},
|
|
463
|
-
],
|
|
464
|
-
"name": "LiquidationTerminated",
|
|
465
|
-
"type": "event",
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
"inputs": [],
|
|
469
|
-
"name": "auctionConfig",
|
|
470
|
-
"outputs": [
|
|
471
|
-
{
|
|
472
|
-
"components": [
|
|
473
|
-
{
|
|
474
|
-
"internalType": "uint64",
|
|
475
|
-
"name": "restorationBuffer",
|
|
476
|
-
"type": "uint64",
|
|
477
|
-
},
|
|
478
|
-
{
|
|
479
|
-
"internalType": "uint256",
|
|
480
|
-
"name": "liquidationDuration",
|
|
481
|
-
"type": "uint256",
|
|
482
|
-
},
|
|
483
|
-
],
|
|
484
|
-
"internalType": "struct IAuctioneer.AuctionConfig",
|
|
485
|
-
"name": "",
|
|
486
|
-
"type": "tuple",
|
|
487
|
-
}
|
|
488
|
-
],
|
|
489
|
-
"stateMutability": "view",
|
|
490
|
-
"type": "function",
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
"inputs": [
|
|
494
|
-
{
|
|
495
|
-
"internalType": "address",
|
|
496
|
-
"name": "marginAccountID",
|
|
497
|
-
"type": "address",
|
|
498
|
-
},
|
|
499
|
-
{"internalType": "address", "name": "collateral", "type": "address"},
|
|
500
|
-
],
|
|
501
|
-
"name": "auctionData",
|
|
502
|
-
"outputs": [
|
|
503
|
-
{
|
|
504
|
-
"components": [
|
|
505
|
-
{
|
|
506
|
-
"internalType": "uint256",
|
|
507
|
-
"name": "startBlock",
|
|
508
|
-
"type": "uint256",
|
|
509
|
-
},
|
|
510
|
-
{
|
|
511
|
-
"internalType": "uint256",
|
|
512
|
-
"name": "maeAtInitiation",
|
|
513
|
-
"type": "uint256",
|
|
514
|
-
},
|
|
515
|
-
{
|
|
516
|
-
"internalType": "uint256",
|
|
517
|
-
"name": "mmuAtInitiation",
|
|
518
|
-
"type": "uint256",
|
|
519
|
-
},
|
|
520
|
-
{"internalType": "int256", "name": "maeNow", "type": "int256"},
|
|
521
|
-
{
|
|
522
|
-
"internalType": "uint256",
|
|
523
|
-
"name": "mmuNow",
|
|
524
|
-
"type": "uint256",
|
|
525
|
-
},
|
|
526
|
-
],
|
|
527
|
-
"internalType": "struct IAuctioneer.AuctionData",
|
|
528
|
-
"name": "",
|
|
529
|
-
"type": "tuple",
|
|
530
|
-
}
|
|
531
|
-
],
|
|
532
|
-
"stateMutability": "view",
|
|
533
|
-
"type": "function",
|
|
534
|
-
},
|
|
535
|
-
{
|
|
536
|
-
"inputs": [
|
|
537
|
-
{
|
|
538
|
-
"internalType": "address",
|
|
539
|
-
"name": "marginAccountID",
|
|
540
|
-
"type": "address",
|
|
541
|
-
},
|
|
542
|
-
{
|
|
543
|
-
"internalType": "address",
|
|
544
|
-
"name": "collateralToken",
|
|
545
|
-
"type": "address",
|
|
546
|
-
},
|
|
547
|
-
{
|
|
548
|
-
"components": [
|
|
549
|
-
{
|
|
550
|
-
"internalType": "bytes32",
|
|
551
|
-
"name": "productID",
|
|
552
|
-
"type": "bytes32",
|
|
553
|
-
},
|
|
554
|
-
{"internalType": "uint256", "name": "price", "type": "uint256"},
|
|
555
|
-
{
|
|
556
|
-
"internalType": "uint256",
|
|
557
|
-
"name": "quantity",
|
|
558
|
-
"type": "uint256",
|
|
559
|
-
},
|
|
560
|
-
{"internalType": "enum Side", "name": "side", "type": "uint8"},
|
|
561
|
-
],
|
|
562
|
-
"internalType": "struct IAuctioneer.BidData[]",
|
|
563
|
-
"name": "bids",
|
|
564
|
-
"type": "tuple[]",
|
|
565
|
-
},
|
|
566
|
-
],
|
|
567
|
-
"name": "bidAuction",
|
|
568
|
-
"outputs": [],
|
|
569
|
-
"stateMutability": "nonpayable",
|
|
570
|
-
"type": "function",
|
|
571
|
-
},
|
|
572
|
-
{
|
|
573
|
-
"inputs": [
|
|
574
|
-
{
|
|
575
|
-
"internalType": "address",
|
|
576
|
-
"name": "marginAccountID",
|
|
577
|
-
"type": "address",
|
|
578
|
-
},
|
|
579
|
-
{"internalType": "address", "name": "collateral", "type": "address"},
|
|
580
|
-
],
|
|
581
|
-
"name": "canTerminateAuctions",
|
|
582
|
-
"outputs": [{"internalType": "bool", "name": "", "type": "bool"}],
|
|
583
|
-
"stateMutability": "view",
|
|
584
|
-
"type": "function",
|
|
585
|
-
},
|
|
586
|
-
{
|
|
587
|
-
"inputs": [
|
|
588
|
-
{
|
|
589
|
-
"internalType": "address",
|
|
590
|
-
"name": "marginAccountID",
|
|
591
|
-
"type": "address",
|
|
592
|
-
},
|
|
593
|
-
{
|
|
594
|
-
"internalType": "address",
|
|
595
|
-
"name": "collateralToken",
|
|
596
|
-
"type": "address",
|
|
597
|
-
},
|
|
598
|
-
],
|
|
599
|
-
"name": "isLiquidatable",
|
|
600
|
-
"outputs": [{"internalType": "bool", "name": "", "type": "bool"}],
|
|
601
|
-
"stateMutability": "view",
|
|
602
|
-
"type": "function",
|
|
603
|
-
},
|
|
604
|
-
{
|
|
605
|
-
"inputs": [
|
|
606
|
-
{
|
|
607
|
-
"internalType": "address",
|
|
608
|
-
"name": "marginAccountID",
|
|
609
|
-
"type": "address",
|
|
610
|
-
},
|
|
611
|
-
{
|
|
612
|
-
"internalType": "address",
|
|
613
|
-
"name": "collateralToken",
|
|
614
|
-
"type": "address",
|
|
615
|
-
},
|
|
616
|
-
],
|
|
617
|
-
"name": "isLiquidating",
|
|
618
|
-
"outputs": [{"internalType": "bool", "name": "", "type": "bool"}],
|
|
619
|
-
"stateMutability": "view",
|
|
620
|
-
"type": "function",
|
|
621
|
-
},
|
|
622
|
-
{
|
|
623
|
-
"inputs": [
|
|
624
|
-
{
|
|
625
|
-
"internalType": "address",
|
|
626
|
-
"name": "liquidatorMarginAccountID",
|
|
627
|
-
"type": "address",
|
|
628
|
-
},
|
|
629
|
-
{
|
|
630
|
-
"internalType": "address",
|
|
631
|
-
"name": "liquidatingMarginAccountID",
|
|
632
|
-
"type": "address",
|
|
633
|
-
},
|
|
634
|
-
{"internalType": "address", "name": "collateral", "type": "address"},
|
|
635
|
-
{
|
|
636
|
-
"components": [
|
|
637
|
-
{
|
|
638
|
-
"internalType": "bytes32",
|
|
639
|
-
"name": "productID",
|
|
640
|
-
"type": "bytes32",
|
|
641
|
-
},
|
|
642
|
-
{"internalType": "uint256", "name": "price", "type": "uint256"},
|
|
643
|
-
{
|
|
644
|
-
"internalType": "uint256",
|
|
645
|
-
"name": "quantity",
|
|
646
|
-
"type": "uint256",
|
|
647
|
-
},
|
|
648
|
-
{"internalType": "enum Side", "name": "side", "type": "uint8"},
|
|
649
|
-
],
|
|
650
|
-
"internalType": "struct IAuctioneer.BidData[]",
|
|
651
|
-
"name": "bids",
|
|
652
|
-
"type": "tuple[]",
|
|
653
|
-
},
|
|
654
|
-
],
|
|
655
|
-
"name": "maeCheckOnBid",
|
|
656
|
-
"outputs": [
|
|
657
|
-
{"internalType": "bool", "name": "maeCheckFailed", "type": "bool"},
|
|
658
|
-
{
|
|
659
|
-
"internalType": "bool",
|
|
660
|
-
"name": "maeOverMmuRateExceeded",
|
|
661
|
-
"type": "bool",
|
|
662
|
-
},
|
|
663
|
-
],
|
|
664
|
-
"stateMutability": "view",
|
|
665
|
-
"type": "function",
|
|
666
|
-
},
|
|
667
|
-
{
|
|
668
|
-
"inputs": [
|
|
669
|
-
{
|
|
670
|
-
"internalType": "address",
|
|
671
|
-
"name": "marginAccountID",
|
|
672
|
-
"type": "address",
|
|
673
|
-
},
|
|
674
|
-
{"internalType": "address", "name": "collateral", "type": "address"},
|
|
675
|
-
{"internalType": "uint256", "name": "mmuDecreased", "type": "uint256"},
|
|
676
|
-
],
|
|
677
|
-
"name": "maxMaeOffered",
|
|
678
|
-
"outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
|
|
679
|
-
"stateMutability": "view",
|
|
680
|
-
"type": "function",
|
|
681
|
-
},
|
|
682
|
-
{
|
|
683
|
-
"inputs": [
|
|
684
|
-
{
|
|
685
|
-
"internalType": "address",
|
|
686
|
-
"name": "marginAccountID",
|
|
687
|
-
"type": "address",
|
|
688
|
-
},
|
|
689
|
-
{
|
|
690
|
-
"internalType": "address",
|
|
691
|
-
"name": "collateralToken",
|
|
692
|
-
"type": "address",
|
|
693
|
-
},
|
|
694
|
-
],
|
|
695
|
-
"name": "requestLiquidation",
|
|
696
|
-
"outputs": [],
|
|
697
|
-
"stateMutability": "nonpayable",
|
|
698
|
-
"type": "function",
|
|
699
|
-
},
|
|
700
|
-
{
|
|
701
|
-
"inputs": [
|
|
702
|
-
{
|
|
703
|
-
"internalType": "address",
|
|
704
|
-
"name": "marginAccountID",
|
|
705
|
-
"type": "address",
|
|
706
|
-
},
|
|
707
|
-
{"internalType": "address", "name": "collateral", "type": "address"},
|
|
708
|
-
],
|
|
709
|
-
"name": "terminateAuctions",
|
|
710
|
-
"outputs": [],
|
|
711
|
-
"stateMutability": "nonpayable",
|
|
712
|
-
"type": "function",
|
|
713
|
-
},
|
|
714
|
-
{
|
|
715
|
-
"inputs": [
|
|
716
|
-
{
|
|
717
|
-
"internalType": "address",
|
|
718
|
-
"name": "marginAccountID",
|
|
719
|
-
"type": "address",
|
|
720
|
-
},
|
|
721
|
-
{
|
|
722
|
-
"internalType": "address",
|
|
723
|
-
"name": "collateralToken",
|
|
724
|
-
"type": "address",
|
|
725
|
-
},
|
|
726
|
-
{
|
|
727
|
-
"components": [
|
|
728
|
-
{
|
|
729
|
-
"internalType": "bytes32",
|
|
730
|
-
"name": "productID",
|
|
731
|
-
"type": "bytes32",
|
|
732
|
-
},
|
|
733
|
-
{"internalType": "uint256", "name": "price", "type": "uint256"},
|
|
734
|
-
{
|
|
735
|
-
"internalType": "uint256",
|
|
736
|
-
"name": "quantity",
|
|
737
|
-
"type": "uint256",
|
|
738
|
-
},
|
|
739
|
-
{"internalType": "enum Side", "name": "side", "type": "uint8"},
|
|
740
|
-
],
|
|
741
|
-
"internalType": "struct IAuctioneer.BidData[]",
|
|
742
|
-
"name": "bids",
|
|
743
|
-
"type": "tuple[]",
|
|
744
|
-
},
|
|
745
|
-
],
|
|
746
|
-
"name": "validateAuctions",
|
|
747
|
-
"outputs": [{"internalType": "bool", "name": "", "type": "bool"}],
|
|
748
|
-
"stateMutability": "view",
|
|
749
|
-
"type": "function",
|
|
750
|
-
},
|
|
751
|
-
],
|
|
752
|
-
)
|