stx-python 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.
- stx/__init__.py +61 -0
- stx/_async_client.py +923 -0
- stx/_base.py +64 -0
- stx/_client.py +502 -0
- stx/_config.py +107 -0
- stx/_http.py +131 -0
- stx/_money.py +122 -0
- stx/_operations.py +259 -0
- stx/_paging.py +59 -0
- stx/_results.py +29 -0
- stx/_retry.py +80 -0
- stx/_settings.py +203 -0
- stx/_signing.py +229 -0
- stx/_version.py +12 -0
- stx/_ws.py +1016 -0
- stx/enums.py +13 -0
- stx/exceptions.py +156 -0
- stx/models.py +2034 -0
- stx/py.typed +0 -0
- stx_python-0.6.0.dist-info/METADATA +121 -0
- stx_python-0.6.0.dist-info/RECORD +24 -0
- stx_python-0.6.0.dist-info/WHEEL +5 -0
- stx_python-0.6.0.dist-info/licenses/LICENSE +21 -0
- stx_python-0.6.0.dist-info/top_level.txt +1 -0
stx/models.py
ADDED
|
@@ -0,0 +1,2034 @@
|
|
|
1
|
+
"""Response models for the STX REST API.
|
|
2
|
+
|
|
3
|
+
Generated by ``python -m tools.generate_models`` from
|
|
4
|
+
``spec/openapi.json`` (source commit ``6a6ca2731ac6870f65999f86c857a5e6a28b1f5b``).
|
|
5
|
+
Do not edit by hand; regenerate after refreshing the spec.
|
|
6
|
+
|
|
7
|
+
Money and quantity fields are ``str``, exactly as the API sends them.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from typing import Any, Dict, List, Optional
|
|
13
|
+
|
|
14
|
+
from pydantic import Field
|
|
15
|
+
|
|
16
|
+
from stx._base import STXModel
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
"Balance",
|
|
20
|
+
"BookLevel",
|
|
21
|
+
"Cancellation",
|
|
22
|
+
"Error",
|
|
23
|
+
"Event",
|
|
24
|
+
"FeeTransaction",
|
|
25
|
+
"Fill",
|
|
26
|
+
"Market",
|
|
27
|
+
"MarketFilter",
|
|
28
|
+
"MarketStat",
|
|
29
|
+
"Me",
|
|
30
|
+
"NewOrder",
|
|
31
|
+
"Order",
|
|
32
|
+
"PaymentTransaction",
|
|
33
|
+
"Position",
|
|
34
|
+
"RecentTrade",
|
|
35
|
+
"Settlement",
|
|
36
|
+
"StatDetail",
|
|
37
|
+
"Transaction",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class Balance(STXModel):
|
|
42
|
+
"""One account's balance and fee summary, in the dollar wire format."""
|
|
43
|
+
|
|
44
|
+
account_balance: Optional[str] = Field(
|
|
45
|
+
None,
|
|
46
|
+
description="The account's cash balance. Unaffected by placing an order - not all of it may be available. In dollars. Money as a decimal string, as sent by the API.",
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
account_id: Optional[str] = Field(
|
|
50
|
+
None,
|
|
51
|
+
description='The account this balance is for.',
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
available_balance: Optional[str] = Field(
|
|
55
|
+
None,
|
|
56
|
+
description='The balance available to withdraw or place further orders with. Rounded **down** to the cent, so it never overstates what is spendable. In dollars. Money as a decimal string, as sent by the API.',
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
base_fee_percent: Optional[float] = Field(
|
|
60
|
+
None,
|
|
61
|
+
description='The fee percentage on the `fixed_percent` schedule; `null` for any other schedule. A number, not a money string.',
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
buy_order_liability: Optional[str] = Field(
|
|
65
|
+
None,
|
|
66
|
+
description='Total liability from buy orders, including the potential trade-fee reserve. Rounded **up** to the cent. In dollars. Money as a decimal string, as sent by the API.',
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
escrow: Optional[str] = Field(
|
|
70
|
+
None,
|
|
71
|
+
description="The account's escrow balance. In dollars. Money as a decimal string, as sent by the API.",
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
fee_schedule: Optional[str] = Field(
|
|
75
|
+
None,
|
|
76
|
+
description="The account's fee schedule. One of: ``fixed_percent``, ``revenue_share``, ``loyalty_tier``, ``fixed_percent_market_group``, ``fixed_percent_event``, ``on_trade``, ``loyalty_tier_on_trade``.",
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
loyalty_tier: Optional[str] = Field(
|
|
80
|
+
None,
|
|
81
|
+
description="The account's loyalty tier. Every account has one; new accounts start at `rookie`. One of: ``rookie``, ``veteran``, ``all_star``, ``mvp``, ``hall_of_fame``.",
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
maker_factor: Optional[float] = Field(
|
|
85
|
+
None,
|
|
86
|
+
description='Per-trade maker fee factor, present only on the `on_trade` and `loyalty_tier_on_trade` schedules; `null` otherwise. A number, not a money string.',
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
points: Optional[int] = Field(
|
|
90
|
+
None,
|
|
91
|
+
description='Loyalty points the account has accumulated. A whole number, not a money string.',
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
position_premium_liability: Optional[str] = Field(
|
|
95
|
+
None,
|
|
96
|
+
description='Total liability from position premiums. Routinely negative. Rounded **up** to the cent in both signs. In dollars. Money as a decimal string, as sent by the API.',
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
sell_order_liability: Optional[str] = Field(
|
|
100
|
+
None,
|
|
101
|
+
description='Total liability from sell orders, including the potential trade-fee reserve. Rounded **up** to the cent. In dollars. Money as a decimal string, as sent by the API.',
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
taker_factor: Optional[float] = Field(
|
|
105
|
+
None,
|
|
106
|
+
description='Per-trade taker fee factor, present only on the `on_trade` and `loyalty_tier_on_trade` schedules; `null` otherwise. A number, not a money string.',
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
total_adjustments: Optional[str] = Field(
|
|
110
|
+
None,
|
|
111
|
+
description='Lifetime total balance adjustments. In dollars. Money as a decimal string, as sent by the API.',
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
total_deposits: Optional[str] = Field(
|
|
115
|
+
None,
|
|
116
|
+
description='Lifetime total deposits. In dollars. Money as a decimal string, as sent by the API.',
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
total_fees: Optional[str] = Field(
|
|
120
|
+
None,
|
|
121
|
+
description='Total fees from all settlements and other fees. In dollars. Money as a decimal string, as sent by the API.',
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
total_settlement_pnl: Optional[str] = Field(
|
|
125
|
+
None,
|
|
126
|
+
description='Total gross profit and loss from all settlements. In dollars. Money as a decimal string, as sent by the API.',
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
total_trade_count: Optional[int] = Field(
|
|
130
|
+
None,
|
|
131
|
+
description='The number of trades the account has made across every market.',
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
total_traded: Optional[str] = Field(
|
|
135
|
+
None,
|
|
136
|
+
description='The risk the account has committed across every market. In dollars. Money as a decimal string, as sent by the API.',
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
total_withdrawals: Optional[str] = Field(
|
|
140
|
+
None,
|
|
141
|
+
description='Lifetime total withdrawals. In dollars. Money as a decimal string, as sent by the API.',
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
user_id: Optional[str] = Field(
|
|
145
|
+
None,
|
|
146
|
+
description='The user that owns the account.',
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class BookLevel(STXModel):
|
|
151
|
+
"""One price level of resting size on the book."""
|
|
152
|
+
|
|
153
|
+
price: Optional[str] = Field(
|
|
154
|
+
None,
|
|
155
|
+
description='The price of this level. In dollars. Money as a decimal string, as sent by the API.',
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
quantity: Optional[str] = Field(
|
|
159
|
+
None,
|
|
160
|
+
description='Contracts resting at this price. Quantity as a decimal string, as sent by the API.',
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
class Cancellation(STXModel):
|
|
165
|
+
"""The outcome of cancelling one order."""
|
|
166
|
+
|
|
167
|
+
order_id: Optional[str] = Field(
|
|
168
|
+
None,
|
|
169
|
+
description='The order this outcome relates to.',
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
status: Optional[str] = Field(
|
|
173
|
+
None,
|
|
174
|
+
description='The order status after cancelling, or a reason it was not cancelled - "Order not found" for an unknown id.',
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
class Error(STXModel):
|
|
179
|
+
"""The failure envelope returned by every non-2xx response."""
|
|
180
|
+
|
|
181
|
+
error: Optional[str] = Field(
|
|
182
|
+
None,
|
|
183
|
+
description='Human-readable failure reason, e.g. "Missing or invalid API key credentials" or "The order\'s price must be lower than 1.00".',
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
class Event(STXModel):
|
|
188
|
+
"""A sporting event that markets hang off."""
|
|
189
|
+
|
|
190
|
+
archived: Optional[bool] = Field(
|
|
191
|
+
None,
|
|
192
|
+
description='Is this event archived or not',
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
competition: Optional[str] = Field(
|
|
196
|
+
None,
|
|
197
|
+
description='The competition for this event',
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
event_id: Optional[str] = Field(
|
|
201
|
+
None,
|
|
202
|
+
description='The event the market belongs to.',
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
event_type: Optional[str] = Field(
|
|
206
|
+
None,
|
|
207
|
+
description='The event_type of this event - ad_hoc, baseball_game, basketball_game etc',
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
participants: Optional[List[Dict[str, Any]]] = Field(
|
|
211
|
+
None,
|
|
212
|
+
description='The map of participants in the event.',
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
promoted: Optional[bool] = Field(
|
|
216
|
+
None,
|
|
217
|
+
description='Is this event promoted or not',
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
short_title: Optional[str] = Field(
|
|
221
|
+
None,
|
|
222
|
+
description='The short title for this event',
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
sport: Optional[str] = Field(
|
|
226
|
+
None,
|
|
227
|
+
description='The sport for this event',
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
start_time: Optional[int] = Field(
|
|
231
|
+
None,
|
|
232
|
+
description='Start time of this event UNIX microseconds.',
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
start_time_iso: Optional[str] = Field(
|
|
236
|
+
None,
|
|
237
|
+
description='Start time of this event',
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
status: Optional[str] = Field(
|
|
241
|
+
None,
|
|
242
|
+
description='The status of this event One of: ``scheduled``, ``in_progress``, ``completed``, ``cancelled``.',
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
symbol: Optional[str] = Field(
|
|
246
|
+
None,
|
|
247
|
+
description='The STX symbol for this event',
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
title: Optional[str] = Field(
|
|
251
|
+
None,
|
|
252
|
+
description='The title of this event',
|
|
253
|
+
)
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
class FeeTransaction(STXModel):
|
|
257
|
+
"""One fee charged against the account, or a refund of one."""
|
|
258
|
+
|
|
259
|
+
account_id: Optional[str] = Field(
|
|
260
|
+
None,
|
|
261
|
+
description='The account the record belongs to.',
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
amount: Optional[str] = Field(
|
|
265
|
+
None,
|
|
266
|
+
description='The monetary value the entry was calculated from. In dollars. Money as a decimal string, as sent by the API.',
|
|
267
|
+
)
|
|
268
|
+
|
|
269
|
+
event_id: Optional[str] = Field(
|
|
270
|
+
None,
|
|
271
|
+
description='The event the market belongs to.',
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
fee_id: Optional[str] = Field(
|
|
275
|
+
None,
|
|
276
|
+
description='The fee that generated this entry, when it came from one.',
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
id: Optional[str] = Field(
|
|
280
|
+
None,
|
|
281
|
+
description='Unique identifier for the record.',
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
inserted_at: Optional[int] = Field(
|
|
285
|
+
None,
|
|
286
|
+
description='Creation time, as UNIX microseconds.',
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
market_id: Optional[str] = Field(
|
|
290
|
+
None,
|
|
291
|
+
description='The market this record relates to.',
|
|
292
|
+
)
|
|
293
|
+
|
|
294
|
+
payment_id: Optional[str] = Field(
|
|
295
|
+
None,
|
|
296
|
+
description='The payment that generated this entry, when it came from one.',
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
points: Optional[float] = Field(
|
|
300
|
+
None,
|
|
301
|
+
description='Points added by this entry. Negative when points were spent.',
|
|
302
|
+
)
|
|
303
|
+
|
|
304
|
+
settlement_id: Optional[str] = Field(
|
|
305
|
+
None,
|
|
306
|
+
description='The settlement that generated this entry, when it came from one.',
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
time: Optional[str] = Field(
|
|
310
|
+
None,
|
|
311
|
+
description='When the entry was recorded.',
|
|
312
|
+
)
|
|
313
|
+
|
|
314
|
+
type: Optional[str] = Field(
|
|
315
|
+
None,
|
|
316
|
+
description='What moved the money or the points - for example a deposit, a trade fee, a referral, or a manual adjustment. Each endpoint returns only its own subset of these. One of: ``deposit``, ``withdrawal``, ``settlement``, ``fee``, ``fee_refund``, ``casino``, ``adjustment``, ``loyalty``, ``loyalty_points_rollup``, ``loyalty_points_referral``.',
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
class Fill(STXModel):
|
|
321
|
+
"""One fill against one of your orders."""
|
|
322
|
+
|
|
323
|
+
account_id: Optional[str] = Field(
|
|
324
|
+
None,
|
|
325
|
+
description='The account the record belongs to.',
|
|
326
|
+
)
|
|
327
|
+
|
|
328
|
+
action: Optional[str] = Field(
|
|
329
|
+
None,
|
|
330
|
+
description='The action of the trade relative to the user. One of: ``buy``, ``sell``.',
|
|
331
|
+
)
|
|
332
|
+
|
|
333
|
+
admin_log: Optional[Dict[str, Any]] = Field(
|
|
334
|
+
None,
|
|
335
|
+
description='Internal. Operator audit trail, not part of the supported contract - do not depend on it.',
|
|
336
|
+
)
|
|
337
|
+
|
|
338
|
+
amended: Optional[bool] = Field(
|
|
339
|
+
None,
|
|
340
|
+
description='True if an operator has amended this trade. When true, compare `original_price` and `original_filled` against the current values.',
|
|
341
|
+
)
|
|
342
|
+
|
|
343
|
+
client_order_id: Optional[str] = Field(
|
|
344
|
+
None,
|
|
345
|
+
description='The client order id of the order that produced this trade, when one was supplied.',
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
closed_contracts: Optional[str] = Field(
|
|
349
|
+
None,
|
|
350
|
+
description='The number of contracts closed on this trade. Quantity as a decimal string, as sent by the API.',
|
|
351
|
+
)
|
|
352
|
+
|
|
353
|
+
closed_fee: Optional[str] = Field(
|
|
354
|
+
None,
|
|
355
|
+
description='The fee the user paid when closing the trade. In dollars. Money as a decimal string, as sent by the API.',
|
|
356
|
+
)
|
|
357
|
+
|
|
358
|
+
closed_net_pnl: Optional[str] = Field(
|
|
359
|
+
None,
|
|
360
|
+
description='Realised profit or loss on the closed portion. Negative for a loss. In dollars. Money as a decimal string, as sent by the API.',
|
|
361
|
+
)
|
|
362
|
+
|
|
363
|
+
closed_pnl: Optional[str] = Field(
|
|
364
|
+
None,
|
|
365
|
+
description='The profit or loss the user made by closing the trade. In dollars. Money as a decimal string, as sent by the API.',
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
closing: Optional[str] = Field(
|
|
369
|
+
None,
|
|
370
|
+
description='The amount of contracts (in position) that the trade is closing. Quantity as a decimal string, as sent by the API.',
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
device_id: Optional[str] = Field(
|
|
374
|
+
None,
|
|
375
|
+
description="The player's device associated with this trade",
|
|
376
|
+
)
|
|
377
|
+
|
|
378
|
+
expired_contracts: Optional[str] = Field(
|
|
379
|
+
None,
|
|
380
|
+
description='Number of contracts settled when market expired. Quantity as a decimal string, as sent by the API.',
|
|
381
|
+
)
|
|
382
|
+
|
|
383
|
+
expired_fee: Optional[str] = Field(
|
|
384
|
+
None,
|
|
385
|
+
description='The fee paid by the user when the market expired. In dollars. Money as a decimal string, as sent by the API.',
|
|
386
|
+
)
|
|
387
|
+
|
|
388
|
+
expired_net_pnl: Optional[str] = Field(
|
|
389
|
+
None,
|
|
390
|
+
description='Realised profit or loss on the expired portion. In dollars. Money as a decimal string, as sent by the API.',
|
|
391
|
+
)
|
|
392
|
+
|
|
393
|
+
expired_pnl: Optional[str] = Field(
|
|
394
|
+
None,
|
|
395
|
+
description='The profit or loss the user make on the trade when the market expired. In dollars. Money as a decimal string, as sent by the API.',
|
|
396
|
+
)
|
|
397
|
+
|
|
398
|
+
expires_at: Optional[int] = Field(
|
|
399
|
+
None,
|
|
400
|
+
description='When the trade expires if the market has not settled, as UNIX microseconds.',
|
|
401
|
+
)
|
|
402
|
+
|
|
403
|
+
filled: Optional[str] = Field(
|
|
404
|
+
None,
|
|
405
|
+
description='The number of contracts that were traded. Quantity as a decimal string, as sent by the API.',
|
|
406
|
+
)
|
|
407
|
+
|
|
408
|
+
gross_pnl: Optional[str] = Field(
|
|
409
|
+
None,
|
|
410
|
+
description='The gross PNL as a result of the trade. In dollars. Money as a decimal string, as sent by the API.',
|
|
411
|
+
)
|
|
412
|
+
|
|
413
|
+
inserted_at: Optional[int] = Field(
|
|
414
|
+
None,
|
|
415
|
+
description='Creation time, as UNIX microseconds.',
|
|
416
|
+
)
|
|
417
|
+
|
|
418
|
+
ip_address: Optional[str] = Field(
|
|
419
|
+
None,
|
|
420
|
+
description='The IP address associated with this trade',
|
|
421
|
+
)
|
|
422
|
+
|
|
423
|
+
last_modified_at: Optional[int] = Field(
|
|
424
|
+
None,
|
|
425
|
+
description='When an operator last amended this trade, as UNIX microseconds. Null unless `amended` is true.',
|
|
426
|
+
)
|
|
427
|
+
|
|
428
|
+
last_modified_by_admin_id: Optional[str] = Field(
|
|
429
|
+
None,
|
|
430
|
+
description='Internal. Operator audit field, not part of the supported contract - do not depend on it.',
|
|
431
|
+
)
|
|
432
|
+
|
|
433
|
+
liquidity_action: Optional[str] = Field(
|
|
434
|
+
None,
|
|
435
|
+
description='Whether the associated order was the `provider` or the `taker` of the liquidity. One of: ``provider``, ``taker``.',
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
market_id: Optional[str] = Field(
|
|
439
|
+
None,
|
|
440
|
+
description='The market this record relates to.',
|
|
441
|
+
)
|
|
442
|
+
|
|
443
|
+
opened_at: Optional[int] = Field(
|
|
444
|
+
None,
|
|
445
|
+
description='When the position opened, as UNIX microseconds.',
|
|
446
|
+
)
|
|
447
|
+
|
|
448
|
+
order_id: Optional[str] = Field(
|
|
449
|
+
None,
|
|
450
|
+
description='The ID of the order that caused the trade.',
|
|
451
|
+
)
|
|
452
|
+
|
|
453
|
+
original_filled: Optional[str] = Field(
|
|
454
|
+
None,
|
|
455
|
+
description='Contracts filled at execution, before any amendment. Quantity as a decimal string, as sent by the API.',
|
|
456
|
+
)
|
|
457
|
+
|
|
458
|
+
original_premium: Optional[str] = Field(
|
|
459
|
+
None,
|
|
460
|
+
description='The amount of premium received for the original trade. In dollars. Money as a decimal string, as sent by the API.',
|
|
461
|
+
)
|
|
462
|
+
|
|
463
|
+
original_price: Optional[str] = Field(
|
|
464
|
+
None,
|
|
465
|
+
description='Fill price at execution. Unchanged by later amendments. In dollars. Money as a decimal string, as sent by the API.',
|
|
466
|
+
)
|
|
467
|
+
|
|
468
|
+
original_risk: Optional[str] = Field(
|
|
469
|
+
None,
|
|
470
|
+
description='The original risk introduced for the original trade excluding `closed`. In dollars. Money as a decimal string, as sent by the API.',
|
|
471
|
+
)
|
|
472
|
+
|
|
473
|
+
original_to_win: Optional[str] = Field(
|
|
474
|
+
None,
|
|
475
|
+
description='The original to win introduced for the original trade excluding `closed`. In dollars. Money as a decimal string, as sent by the API.',
|
|
476
|
+
)
|
|
477
|
+
|
|
478
|
+
pc_premium: Optional[str] = Field(
|
|
479
|
+
None,
|
|
480
|
+
description='The amount of premium per contract. In dollars. Money as a decimal string, as sent by the API.',
|
|
481
|
+
)
|
|
482
|
+
|
|
483
|
+
pc_risk: Optional[str] = Field(
|
|
484
|
+
None,
|
|
485
|
+
description='The amount of risk per contract. In dollars. Money as a decimal string, as sent by the API.',
|
|
486
|
+
)
|
|
487
|
+
|
|
488
|
+
pc_to_win: Optional[str] = Field(
|
|
489
|
+
None,
|
|
490
|
+
description='The amount to win per contract. In dollars. Money as a decimal string, as sent by the API.',
|
|
491
|
+
)
|
|
492
|
+
|
|
493
|
+
placed_pre_start: Optional[bool] = Field(
|
|
494
|
+
None,
|
|
495
|
+
description='True if the order was placed before the event started.',
|
|
496
|
+
)
|
|
497
|
+
|
|
498
|
+
points: Optional[float] = Field(
|
|
499
|
+
None,
|
|
500
|
+
description='The total number of loyalty points awarded as a result of making the trade.',
|
|
501
|
+
)
|
|
502
|
+
|
|
503
|
+
pre_start: Optional[bool] = Field(
|
|
504
|
+
None,
|
|
505
|
+
description='Whether the trade was based on pre-start activity.',
|
|
506
|
+
)
|
|
507
|
+
|
|
508
|
+
price: Optional[str] = Field(
|
|
509
|
+
None,
|
|
510
|
+
description='The price that the trade was executed at. In dollars. Money as a decimal string, as sent by the API.',
|
|
511
|
+
)
|
|
512
|
+
|
|
513
|
+
remaining: Optional[str] = Field(
|
|
514
|
+
None,
|
|
515
|
+
description='The number of unsettled contracts in the trade. Quantity as a decimal string, as sent by the API.',
|
|
516
|
+
)
|
|
517
|
+
|
|
518
|
+
remaining_potential_fee: Optional[str] = Field(
|
|
519
|
+
None,
|
|
520
|
+
description='The potential fee from unsettled contracts. In dollars. Money as a decimal string, as sent by the API.',
|
|
521
|
+
)
|
|
522
|
+
|
|
523
|
+
remaining_premium: Optional[str] = Field(
|
|
524
|
+
None,
|
|
525
|
+
description='Premium as yet unsettled. In dollars. Money as a decimal string, as sent by the API.',
|
|
526
|
+
)
|
|
527
|
+
|
|
528
|
+
remaining_risk: Optional[str] = Field(
|
|
529
|
+
None,
|
|
530
|
+
description='The total current risk for the trade. In dollars. Money as a decimal string, as sent by the API.',
|
|
531
|
+
)
|
|
532
|
+
|
|
533
|
+
remaining_to_win: Optional[str] = Field(
|
|
534
|
+
None,
|
|
535
|
+
description='The remaining amount that the trade can win. In dollars. Money as a decimal string, as sent by the API.',
|
|
536
|
+
)
|
|
537
|
+
|
|
538
|
+
settled_at: Optional[str] = Field(
|
|
539
|
+
None,
|
|
540
|
+
description="The timestamp when this trade's status was set to `settled`",
|
|
541
|
+
)
|
|
542
|
+
|
|
543
|
+
settled_contracts: Optional[str] = Field(
|
|
544
|
+
None,
|
|
545
|
+
description='Contracts already settled. Below `traded_contracts` on a partial settlement. Quantity as a decimal string, as sent by the API.',
|
|
546
|
+
)
|
|
547
|
+
|
|
548
|
+
settlements_count: Optional[int] = Field(
|
|
549
|
+
None,
|
|
550
|
+
description='The number of settlements where this `AccountTrade` is an opening trade.',
|
|
551
|
+
)
|
|
552
|
+
|
|
553
|
+
status: Optional[str] = Field(
|
|
554
|
+
None,
|
|
555
|
+
description='Fill state. `created` once the matching engine has written the fill, `open` while the position is live, `settled` once it no longer contributes to a position, and `cancelled` if an admin reversed it. One of: ``created``, ``open``, ``settled``, ``cancelled``.',
|
|
556
|
+
)
|
|
557
|
+
|
|
558
|
+
time: Optional[str] = Field(
|
|
559
|
+
None,
|
|
560
|
+
description='The ISO-8601 Date time the trade was created.',
|
|
561
|
+
)
|
|
562
|
+
|
|
563
|
+
total_fee: Optional[str] = Field(
|
|
564
|
+
None,
|
|
565
|
+
description='Sum of on-trade fee plus fees paid from settlements linked with the trade. In dollars. Money as a decimal string, as sent by the API.',
|
|
566
|
+
)
|
|
567
|
+
|
|
568
|
+
trade_fee: Optional[str] = Field(
|
|
569
|
+
None,
|
|
570
|
+
description='Per-trade fee (on-trade fee schedule). Included in total_fee. In dollars. Money as a decimal string, as sent by the API.',
|
|
571
|
+
)
|
|
572
|
+
|
|
573
|
+
trade_id: Optional[str] = Field(
|
|
574
|
+
None,
|
|
575
|
+
description='Unique identifier for the trade.',
|
|
576
|
+
)
|
|
577
|
+
|
|
578
|
+
traded_contracts: Optional[str] = Field(
|
|
579
|
+
None,
|
|
580
|
+
description='Number of contracts in this trade. Quantity as a decimal string, as sent by the API.',
|
|
581
|
+
)
|
|
582
|
+
|
|
583
|
+
unrounded_trade_fee: Optional[str] = Field(
|
|
584
|
+
None,
|
|
585
|
+
description='Fee before rounding. Use the rounded fee for reconciliation. In dollars. Carries up to 9 decimal places - parse money with a variable-scale decimal type, not a fixed-width one. Money as a decimal string, as sent by the API.',
|
|
586
|
+
)
|
|
587
|
+
|
|
588
|
+
updated_at: Optional[int] = Field(
|
|
589
|
+
None,
|
|
590
|
+
description='Time of the last change, as UNIX microseconds.',
|
|
591
|
+
)
|
|
592
|
+
|
|
593
|
+
virtual_remaining: Optional[str] = Field(
|
|
594
|
+
None,
|
|
595
|
+
description='Remaining contracts including unsettled exposure. Quantity as a decimal string, as sent by the API.',
|
|
596
|
+
)
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
class Market(STXModel):
|
|
600
|
+
"""A market you can trade, with its book and event context."""
|
|
601
|
+
|
|
602
|
+
archived: Optional[bool] = Field(
|
|
603
|
+
None,
|
|
604
|
+
description='Is the market archived or not.',
|
|
605
|
+
)
|
|
606
|
+
|
|
607
|
+
bids: Optional[List[BookLevel]] = Field(
|
|
608
|
+
None,
|
|
609
|
+
description='The available bids on the market, best first.',
|
|
610
|
+
)
|
|
611
|
+
|
|
612
|
+
competition: Optional[str] = Field(
|
|
613
|
+
None,
|
|
614
|
+
description='The text to use in describing the competition, e.g. NBA.',
|
|
615
|
+
)
|
|
616
|
+
|
|
617
|
+
description: Optional[str] = Field(
|
|
618
|
+
None,
|
|
619
|
+
description='The description of the market.',
|
|
620
|
+
)
|
|
621
|
+
|
|
622
|
+
event_id: Optional[str] = Field(
|
|
623
|
+
None,
|
|
624
|
+
description='The event the market belongs to.',
|
|
625
|
+
)
|
|
626
|
+
|
|
627
|
+
event_short_title: Optional[str] = Field(
|
|
628
|
+
None,
|
|
629
|
+
description='The short title of the event associated with the market.',
|
|
630
|
+
)
|
|
631
|
+
|
|
632
|
+
event_start: Optional[str] = Field(
|
|
633
|
+
None,
|
|
634
|
+
description='The UTC start date and time of the event.',
|
|
635
|
+
)
|
|
636
|
+
|
|
637
|
+
event_status: Optional[str] = Field(
|
|
638
|
+
None,
|
|
639
|
+
description='The status of the event that the market is attached to.',
|
|
640
|
+
)
|
|
641
|
+
|
|
642
|
+
event_title: Optional[str] = Field(
|
|
643
|
+
None,
|
|
644
|
+
description='The title of the event associated with the market.',
|
|
645
|
+
)
|
|
646
|
+
|
|
647
|
+
event_type: Optional[str] = Field(
|
|
648
|
+
None,
|
|
649
|
+
description='The type of event associated with the market.',
|
|
650
|
+
)
|
|
651
|
+
|
|
652
|
+
featured: Optional[bool] = Field(
|
|
653
|
+
None,
|
|
654
|
+
description='Is the market featured or not.',
|
|
655
|
+
)
|
|
656
|
+
|
|
657
|
+
featured_home: Optional[bool] = Field(
|
|
658
|
+
None,
|
|
659
|
+
description='Is the market featured on home page.',
|
|
660
|
+
)
|
|
661
|
+
|
|
662
|
+
filters: Optional[List[MarketFilter]] = Field(
|
|
663
|
+
None,
|
|
664
|
+
description='The categorisations under which the market appears. A list, not an object.',
|
|
665
|
+
)
|
|
666
|
+
|
|
667
|
+
group_title: Optional[str] = Field(
|
|
668
|
+
None,
|
|
669
|
+
description='The human readable group title for the market.',
|
|
670
|
+
)
|
|
671
|
+
|
|
672
|
+
grouping_id: Optional[str] = Field(
|
|
673
|
+
None,
|
|
674
|
+
description="Identity of the set of mutually exclusive outcomes this market prices against - the 30 World Series contracts, the 4 AFC East contracts, one fixture's moneyline pair. Opaque: compare for equality, never parse. Stable for the life of the market, and present in every status, so it is the field to map market data on. Unlike `symbol`, it does not move when a fixture is rescheduled.",
|
|
675
|
+
)
|
|
676
|
+
|
|
677
|
+
grouping_name: Optional[str] = Field(
|
|
678
|
+
None,
|
|
679
|
+
description='The grouping in words, e.g. `AL East Division`, `Spread - 1st Quarter`. Descriptive rather than stable - for a tournament it is the event title, which can be renamed. Display it; join on `grouping_id`.',
|
|
680
|
+
)
|
|
681
|
+
|
|
682
|
+
home_category: Optional[str] = Field(
|
|
683
|
+
None,
|
|
684
|
+
description='The category in which the market appears: `Upcoming`, `Live` or `nil`.',
|
|
685
|
+
)
|
|
686
|
+
|
|
687
|
+
in_play_delay_sec: Optional[int] = Field(
|
|
688
|
+
None,
|
|
689
|
+
description='The order delay (in seconds) when the event is in progress.',
|
|
690
|
+
)
|
|
691
|
+
|
|
692
|
+
keywords: Optional[List[str]] = Field(
|
|
693
|
+
None,
|
|
694
|
+
description='The keywords that are set for the market.',
|
|
695
|
+
)
|
|
696
|
+
|
|
697
|
+
last_probability_at: Optional[int] = Field(
|
|
698
|
+
None,
|
|
699
|
+
description='The time that the last probability update was received by the server. UNIX microseconds.',
|
|
700
|
+
)
|
|
701
|
+
|
|
702
|
+
last_traded_price: Optional[str] = Field(
|
|
703
|
+
None,
|
|
704
|
+
description='The price of the last executed trade. In dollars. Money as a decimal string, as sent by the API.',
|
|
705
|
+
)
|
|
706
|
+
|
|
707
|
+
manual_probability: Optional[bool] = Field(
|
|
708
|
+
None,
|
|
709
|
+
description='`true` when the probability was set by hand, `false` when it came from the odds provider. A flag, not a probability figure.',
|
|
710
|
+
)
|
|
711
|
+
|
|
712
|
+
market_id: Optional[str] = Field(
|
|
713
|
+
None,
|
|
714
|
+
description='The market this record relates to.',
|
|
715
|
+
)
|
|
716
|
+
|
|
717
|
+
max_price: Optional[str] = Field(
|
|
718
|
+
None,
|
|
719
|
+
description='The highest price an order in this market may take, and the settlement value of one winning contract. Orders must price strictly below it. In dollars. Money as a decimal string, as sent by the API.',
|
|
720
|
+
)
|
|
721
|
+
|
|
722
|
+
offers: Optional[List[BookLevel]] = Field(
|
|
723
|
+
None,
|
|
724
|
+
description='The available offers on the market, best first.',
|
|
725
|
+
)
|
|
726
|
+
|
|
727
|
+
open_interest: Optional[str] = Field(
|
|
728
|
+
None,
|
|
729
|
+
description='Current open interest in the market. In contracts. Quantity as a decimal string, as sent by the API.',
|
|
730
|
+
)
|
|
731
|
+
|
|
732
|
+
participants: Optional[List[Dict[str, Any]]] = Field(
|
|
733
|
+
None,
|
|
734
|
+
description='The map of participants in the market.',
|
|
735
|
+
)
|
|
736
|
+
|
|
737
|
+
points_cost: Optional[int] = Field(
|
|
738
|
+
None,
|
|
739
|
+
description='The cost of each loyalty point for amount risked by the user.',
|
|
740
|
+
)
|
|
741
|
+
|
|
742
|
+
position: Optional[str] = Field(
|
|
743
|
+
None,
|
|
744
|
+
description='Text describing the position this market takes, e.g. a participant name. A label, not a numeric ordering.',
|
|
745
|
+
)
|
|
746
|
+
|
|
747
|
+
powered_by: Optional[Dict[str, Any]] = Field(
|
|
748
|
+
None,
|
|
749
|
+
description='Powered by - provider used to result this market.',
|
|
750
|
+
)
|
|
751
|
+
|
|
752
|
+
price: Optional[str] = Field(
|
|
753
|
+
None,
|
|
754
|
+
description='The market price that the market is trading at. In dollars. Money as a decimal string, as sent by the API.',
|
|
755
|
+
)
|
|
756
|
+
|
|
757
|
+
price_change24h: Optional[int] = Field(
|
|
758
|
+
None,
|
|
759
|
+
description='The change in price over the last 24 hours, as a percentage. Not money - it stays a number and must not be divided by 100.',
|
|
760
|
+
)
|
|
761
|
+
|
|
762
|
+
probability: Optional[float] = Field(
|
|
763
|
+
None,
|
|
764
|
+
description='What is the probability for the market',
|
|
765
|
+
)
|
|
766
|
+
|
|
767
|
+
question: Optional[str] = Field(
|
|
768
|
+
None,
|
|
769
|
+
description='The question that the market is asking.',
|
|
770
|
+
)
|
|
771
|
+
|
|
772
|
+
recent_trades: Optional[List[RecentTrade]] = Field(
|
|
773
|
+
None,
|
|
774
|
+
description='The last 15 trades on the market.',
|
|
775
|
+
)
|
|
776
|
+
|
|
777
|
+
result: Optional[str] = Field(
|
|
778
|
+
None,
|
|
779
|
+
description='The result of the market.',
|
|
780
|
+
)
|
|
781
|
+
|
|
782
|
+
rules: Optional[str] = Field(
|
|
783
|
+
None,
|
|
784
|
+
description='The rules for this market.',
|
|
785
|
+
)
|
|
786
|
+
|
|
787
|
+
settled_at: Optional[int] = Field(
|
|
788
|
+
None,
|
|
789
|
+
description='When the market was resulted or voided. A raw microsecond integer, unlike the ISO-8601 `timestamp` and `event_start` beside it. UNIX microseconds.',
|
|
790
|
+
)
|
|
791
|
+
|
|
792
|
+
short_title: Optional[str] = Field(
|
|
793
|
+
None,
|
|
794
|
+
description='The human readable short title for the market.',
|
|
795
|
+
)
|
|
796
|
+
|
|
797
|
+
specifier: Optional[str] = Field(
|
|
798
|
+
None,
|
|
799
|
+
description='The specifier for the rules to properly determine the market.',
|
|
800
|
+
)
|
|
801
|
+
|
|
802
|
+
sport: Optional[str] = Field(
|
|
803
|
+
None,
|
|
804
|
+
description='The text to use in describing the sport, e.g. Basketball.',
|
|
805
|
+
)
|
|
806
|
+
|
|
807
|
+
stat_detail: Optional[StatDetail] = Field(
|
|
808
|
+
None,
|
|
809
|
+
description='The stat line this market is derived from, or `null` for a market that is not a stat-line prop.',
|
|
810
|
+
)
|
|
811
|
+
|
|
812
|
+
status: Optional[str] = Field(
|
|
813
|
+
None,
|
|
814
|
+
description='Market state. See [Market and order status](/concepts/market-status/) - note that a market with `status: open` may still report as suspended when trading is halted. One of: ``scheduled``, ``pre_open``, ``open``, ``suspended``, ``closed``, ``resulted``, ``cancelled``, ``voided``.',
|
|
815
|
+
)
|
|
816
|
+
|
|
817
|
+
symbol: Optional[str] = Field(
|
|
818
|
+
None,
|
|
819
|
+
description='A unique symbol for this market.',
|
|
820
|
+
)
|
|
821
|
+
|
|
822
|
+
timestamp: Optional[str] = Field(
|
|
823
|
+
None,
|
|
824
|
+
description='Server time when this payload was generated, as an ISO-8601 string. The `timestamp_int` sibling carries the same instant as UNIX microseconds.',
|
|
825
|
+
)
|
|
826
|
+
|
|
827
|
+
timestamp_int: Optional[int] = Field(
|
|
828
|
+
None,
|
|
829
|
+
description='The UNIX microseconds timestamp of when this market info was created.',
|
|
830
|
+
)
|
|
831
|
+
|
|
832
|
+
title: Optional[str] = Field(
|
|
833
|
+
None,
|
|
834
|
+
description='The human readable title for the market.',
|
|
835
|
+
)
|
|
836
|
+
|
|
837
|
+
total_volume: Optional[str] = Field(
|
|
838
|
+
None,
|
|
839
|
+
description='Contracts traded on this market across its lifetime. Quantity as a decimal string, as sent by the API.',
|
|
840
|
+
)
|
|
841
|
+
|
|
842
|
+
trading: Optional[bool] = Field(
|
|
843
|
+
None,
|
|
844
|
+
description='Trading flag - if the market is open for trading or not',
|
|
845
|
+
)
|
|
846
|
+
|
|
847
|
+
trading_filters: Optional[List[MarketFilter]] = Field(
|
|
848
|
+
None,
|
|
849
|
+
description='The categorisations used for organising trades, settlements and related items. A list, not an object.',
|
|
850
|
+
)
|
|
851
|
+
|
|
852
|
+
volume24h: Optional[str] = Field(
|
|
853
|
+
None,
|
|
854
|
+
description='Trade volume this market has had in the last 24 hours. In contracts. Quantity as a decimal string, as sent by the API.',
|
|
855
|
+
)
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
class MarketFilter(STXModel):
|
|
859
|
+
"""One categorisation this market appears under."""
|
|
860
|
+
|
|
861
|
+
category: Optional[str] = Field(
|
|
862
|
+
None,
|
|
863
|
+
description='Top-level category, e.g. a sport or a promotional section.',
|
|
864
|
+
)
|
|
865
|
+
|
|
866
|
+
grouping: Optional[str] = Field(
|
|
867
|
+
None,
|
|
868
|
+
description='Grouping within the section.',
|
|
869
|
+
)
|
|
870
|
+
|
|
871
|
+
manual: Optional[bool] = Field(
|
|
872
|
+
None,
|
|
873
|
+
description='Whether the categorisation was assigned by hand.',
|
|
874
|
+
)
|
|
875
|
+
|
|
876
|
+
section: Optional[str] = Field(
|
|
877
|
+
None,
|
|
878
|
+
description='Section heading this market groups under.',
|
|
879
|
+
)
|
|
880
|
+
|
|
881
|
+
subcategory: Optional[str] = Field(
|
|
882
|
+
None,
|
|
883
|
+
description='Category within `category`, e.g. a competition.',
|
|
884
|
+
)
|
|
885
|
+
|
|
886
|
+
subgrouping: Optional[str] = Field(
|
|
887
|
+
None,
|
|
888
|
+
description='Grouping within `grouping`.',
|
|
889
|
+
)
|
|
890
|
+
|
|
891
|
+
|
|
892
|
+
class MarketStat(STXModel):
|
|
893
|
+
"""Your exposure and realised result in one market."""
|
|
894
|
+
|
|
895
|
+
account_id: Optional[str] = Field(
|
|
896
|
+
None,
|
|
897
|
+
description='The account the record belongs to.',
|
|
898
|
+
)
|
|
899
|
+
|
|
900
|
+
archived_at: Optional[int] = Field(
|
|
901
|
+
None,
|
|
902
|
+
description='DateTime at which the record is marked as archived. It will be `nil` until the market is archived. UNIX microseconds.',
|
|
903
|
+
)
|
|
904
|
+
|
|
905
|
+
available_position: Optional[str] = Field(
|
|
906
|
+
None,
|
|
907
|
+
description='The amount of the `position` that is not reserved for pending orders. In contracts. Quantity as a decimal string, as sent by the API.',
|
|
908
|
+
)
|
|
909
|
+
|
|
910
|
+
average_open_premium: Optional[str] = Field(
|
|
911
|
+
None,
|
|
912
|
+
description='The average premium of all open contracts. In dollars. Money as a decimal string, as sent by the API.',
|
|
913
|
+
)
|
|
914
|
+
|
|
915
|
+
buy_contracts_closed: Optional[str] = Field(
|
|
916
|
+
None,
|
|
917
|
+
description='The total number of buy contracts that were closed. Quantity as a decimal string, as sent by the API.',
|
|
918
|
+
)
|
|
919
|
+
|
|
920
|
+
buy_contracts_expired: Optional[str] = Field(
|
|
921
|
+
None,
|
|
922
|
+
description='The total number of buy contracts that were expired. Quantity as a decimal string, as sent by the API.',
|
|
923
|
+
)
|
|
924
|
+
|
|
925
|
+
buy_contracts_settled: Optional[str] = Field(
|
|
926
|
+
None,
|
|
927
|
+
description='The total number of buy contracts settled in the position. Quantity as a decimal string, as sent by the API.',
|
|
928
|
+
)
|
|
929
|
+
|
|
930
|
+
buy_contracts_traded: Optional[str] = Field(
|
|
931
|
+
None,
|
|
932
|
+
description="The total number of buy contracts the account has traded. Only opening trade's contracts are included. Quantity as a decimal string, as sent by the API.",
|
|
933
|
+
)
|
|
934
|
+
|
|
935
|
+
buy_order_liability: Optional[str] = Field(
|
|
936
|
+
None,
|
|
937
|
+
description='The order liability on this position from buy orders. In dollars. Money as a decimal string, as sent by the API.',
|
|
938
|
+
)
|
|
939
|
+
|
|
940
|
+
buy_orders: Optional[int] = Field(
|
|
941
|
+
None,
|
|
942
|
+
description='Count of all buy orders.',
|
|
943
|
+
)
|
|
944
|
+
|
|
945
|
+
buy_original_risk: Optional[str] = Field(
|
|
946
|
+
None,
|
|
947
|
+
description='The original risk incurred by buy trades. In dollars. Money as a decimal string, as sent by the API.',
|
|
948
|
+
)
|
|
949
|
+
|
|
950
|
+
buy_settlements: Optional[int] = Field(
|
|
951
|
+
None,
|
|
952
|
+
description='Count of all settlements from buy trades.',
|
|
953
|
+
)
|
|
954
|
+
|
|
955
|
+
buy_trade_count: Optional[int] = Field(
|
|
956
|
+
None,
|
|
957
|
+
description='The total number of buy trades the account has made on the market.',
|
|
958
|
+
)
|
|
959
|
+
|
|
960
|
+
cancelled_buy_contracts: Optional[str] = Field(
|
|
961
|
+
None,
|
|
962
|
+
description='Sum of all not matched contracts in buy cancelled orders. Quantity as a decimal string, as sent by the API.',
|
|
963
|
+
)
|
|
964
|
+
|
|
965
|
+
cancelled_buy_orders: Optional[int] = Field(
|
|
966
|
+
None,
|
|
967
|
+
description='Number of buy orders that were cancelled.',
|
|
968
|
+
)
|
|
969
|
+
|
|
970
|
+
cancelled_contracts: Optional[str] = Field(
|
|
971
|
+
None,
|
|
972
|
+
description='Sum of all not matched contracts in all cancelled orders. Quantity as a decimal string, as sent by the API.',
|
|
973
|
+
)
|
|
974
|
+
|
|
975
|
+
cancelled_orders: Optional[int] = Field(
|
|
976
|
+
None,
|
|
977
|
+
description='Number of orders that were cancelled.',
|
|
978
|
+
)
|
|
979
|
+
|
|
980
|
+
cancelled_sell_contracts: Optional[str] = Field(
|
|
981
|
+
None,
|
|
982
|
+
description='Sum of all not matched contracts in sell cancelled orders. Quantity as a decimal string, as sent by the API.',
|
|
983
|
+
)
|
|
984
|
+
|
|
985
|
+
cancelled_sell_orders: Optional[int] = Field(
|
|
986
|
+
None,
|
|
987
|
+
description='Number of sell orders that were cancelled.',
|
|
988
|
+
)
|
|
989
|
+
|
|
990
|
+
closed_buy_premium: Optional[str] = Field(
|
|
991
|
+
None,
|
|
992
|
+
description='Total premium from closed buy trade contracts. In dollars. Money as a decimal string, as sent by the API.',
|
|
993
|
+
)
|
|
994
|
+
|
|
995
|
+
closed_fees: Optional[str] = Field(
|
|
996
|
+
None,
|
|
997
|
+
description='The total value of fees from closed settlements. In dollars. Money as a decimal string, as sent by the API.',
|
|
998
|
+
)
|
|
999
|
+
|
|
1000
|
+
closed_gross_pnl: Optional[str] = Field(
|
|
1001
|
+
None,
|
|
1002
|
+
description='The profit or loss the account has made in `closed` settlements. In dollars. Money as a decimal string, as sent by the API.',
|
|
1003
|
+
)
|
|
1004
|
+
|
|
1005
|
+
closed_net_pnl: Optional[str] = Field(
|
|
1006
|
+
None,
|
|
1007
|
+
description='The net profit or loss after subtracting `closed_fees`. In dollars. Money as a decimal string, as sent by the API.',
|
|
1008
|
+
)
|
|
1009
|
+
|
|
1010
|
+
closed_premium: Optional[str] = Field(
|
|
1011
|
+
None,
|
|
1012
|
+
description='Total premium from closed contracts. In dollars. Money as a decimal string, as sent by the API.',
|
|
1013
|
+
)
|
|
1014
|
+
|
|
1015
|
+
closed_sell_premium: Optional[str] = Field(
|
|
1016
|
+
None,
|
|
1017
|
+
description='Total premium from closed sell trade contracts. In dollars. Money as a decimal string, as sent by the API.',
|
|
1018
|
+
)
|
|
1019
|
+
|
|
1020
|
+
competition: Optional[str] = Field(
|
|
1021
|
+
None,
|
|
1022
|
+
description='The competition of this market',
|
|
1023
|
+
)
|
|
1024
|
+
|
|
1025
|
+
contracts_closed: Optional[str] = Field(
|
|
1026
|
+
None,
|
|
1027
|
+
description='The total number of all contracts that were closed. Quantity as a decimal string, as sent by the API.',
|
|
1028
|
+
)
|
|
1029
|
+
|
|
1030
|
+
contracts_expired: Optional[str] = Field(
|
|
1031
|
+
None,
|
|
1032
|
+
description='The total number of all contracts that were expired. Quantity as a decimal string, as sent by the API.',
|
|
1033
|
+
)
|
|
1034
|
+
|
|
1035
|
+
contracts_in_buy_orders: Optional[str] = Field(
|
|
1036
|
+
None,
|
|
1037
|
+
description='Sum of all not matched contracts in buy orders. Quantity as a decimal string, as sent by the API.',
|
|
1038
|
+
)
|
|
1039
|
+
|
|
1040
|
+
contracts_in_orders: Optional[str] = Field(
|
|
1041
|
+
None,
|
|
1042
|
+
description='Sum of all not matched contracts in all orders. Order.quanity - Order.filled. Quantity as a decimal string, as sent by the API.',
|
|
1043
|
+
)
|
|
1044
|
+
|
|
1045
|
+
contracts_in_sell_orders: Optional[str] = Field(
|
|
1046
|
+
None,
|
|
1047
|
+
description='Sum of all not matched contracts in sell orders. Quantity as a decimal string, as sent by the API.',
|
|
1048
|
+
)
|
|
1049
|
+
|
|
1050
|
+
contracts_settled: Optional[str] = Field(
|
|
1051
|
+
None,
|
|
1052
|
+
description='The number of contracts that have been settled. Quantity as a decimal string, as sent by the API.',
|
|
1053
|
+
)
|
|
1054
|
+
|
|
1055
|
+
contracts_traded: Optional[str] = Field(
|
|
1056
|
+
None,
|
|
1057
|
+
description="The total number of all contracts (AccountTrade.filled). Only opening trade contracts are counted. Doesn't include contracts closing other trades. Quantity as a decimal string, as sent by the API.",
|
|
1058
|
+
)
|
|
1059
|
+
|
|
1060
|
+
event_id: Optional[str] = Field(
|
|
1061
|
+
None,
|
|
1062
|
+
description='The event the market belongs to.',
|
|
1063
|
+
)
|
|
1064
|
+
|
|
1065
|
+
event_start_time: Optional[int] = Field(
|
|
1066
|
+
None,
|
|
1067
|
+
description='The start time of the event. UNIX microseconds.',
|
|
1068
|
+
)
|
|
1069
|
+
|
|
1070
|
+
expired_buy_premium: Optional[str] = Field(
|
|
1071
|
+
None,
|
|
1072
|
+
description='Total premium from expired buy trade contracts. In dollars. Money as a decimal string, as sent by the API.',
|
|
1073
|
+
)
|
|
1074
|
+
|
|
1075
|
+
expired_fees: Optional[str] = Field(
|
|
1076
|
+
None,
|
|
1077
|
+
description='The total value of fees from expired settlements. In dollars. Money as a decimal string, as sent by the API.',
|
|
1078
|
+
)
|
|
1079
|
+
|
|
1080
|
+
expired_gross_pnl: Optional[str] = Field(
|
|
1081
|
+
None,
|
|
1082
|
+
description='The profit or loss the account has made in `expired` settlements. In dollars. Money as a decimal string, as sent by the API.',
|
|
1083
|
+
)
|
|
1084
|
+
|
|
1085
|
+
expired_net_pnl: Optional[str] = Field(
|
|
1086
|
+
None,
|
|
1087
|
+
description='The net profit or loss after subtracting `expired_fees`. In dollars. Money as a decimal string, as sent by the API.',
|
|
1088
|
+
)
|
|
1089
|
+
|
|
1090
|
+
expired_premium: Optional[str] = Field(
|
|
1091
|
+
None,
|
|
1092
|
+
description='Total premium from expired contracts. In dollars. Money as a decimal string, as sent by the API.',
|
|
1093
|
+
)
|
|
1094
|
+
|
|
1095
|
+
expired_sell_premium: Optional[str] = Field(
|
|
1096
|
+
None,
|
|
1097
|
+
description='Total premium from expired sell trade contracts. In dollars. Money as a decimal string, as sent by the API.',
|
|
1098
|
+
)
|
|
1099
|
+
|
|
1100
|
+
fee_plugin: Optional[str] = Field(
|
|
1101
|
+
None,
|
|
1102
|
+
description='Internal. Virtual field naming the fee module in use, not part of the supported contract.',
|
|
1103
|
+
)
|
|
1104
|
+
|
|
1105
|
+
inserted_at: Optional[int] = Field(
|
|
1106
|
+
None,
|
|
1107
|
+
description='Creation time, as UNIX microseconds.',
|
|
1108
|
+
)
|
|
1109
|
+
|
|
1110
|
+
last_settled_at: Optional[int] = Field(
|
|
1111
|
+
None,
|
|
1112
|
+
description='DateTime at which the last settlement was created. UNIX microseconds.',
|
|
1113
|
+
)
|
|
1114
|
+
|
|
1115
|
+
market_id: Optional[str] = Field(
|
|
1116
|
+
None,
|
|
1117
|
+
description='The market this record relates to.',
|
|
1118
|
+
)
|
|
1119
|
+
|
|
1120
|
+
market_max_price: Optional[str] = Field(
|
|
1121
|
+
None,
|
|
1122
|
+
description="The market's maximum price - the settlement value of one winning contract. In dollars. Money as a decimal string, as sent by the API.",
|
|
1123
|
+
)
|
|
1124
|
+
|
|
1125
|
+
max_liability_loss: Optional[str] = Field(
|
|
1126
|
+
None,
|
|
1127
|
+
description='Worst-case loss if this market settles against the position you hold. In dollars. Money as a decimal string, as sent by the API.',
|
|
1128
|
+
)
|
|
1129
|
+
|
|
1130
|
+
max_liability_win: Optional[str] = Field(
|
|
1131
|
+
None,
|
|
1132
|
+
description='Worst-case loss if this market settles in favour of the position you hold. In dollars. Money as a decimal string, as sent by the API.',
|
|
1133
|
+
)
|
|
1134
|
+
|
|
1135
|
+
max_potential_fee: Optional[str] = Field(
|
|
1136
|
+
None,
|
|
1137
|
+
description='The maximum potential fees including all actual fees paid. In dollars. Money as a decimal string, as sent by the API.',
|
|
1138
|
+
)
|
|
1139
|
+
|
|
1140
|
+
max_potential_profit: Optional[str] = Field(
|
|
1141
|
+
None,
|
|
1142
|
+
description='The maximum potential profit, including all actual profit. In dollars. Money as a decimal string, as sent by the API.',
|
|
1143
|
+
)
|
|
1144
|
+
|
|
1145
|
+
max_risk: Optional[str] = Field(
|
|
1146
|
+
None,
|
|
1147
|
+
description='The total amount of risk on unsettled contracts. In dollars. Money as a decimal string, as sent by the API.',
|
|
1148
|
+
)
|
|
1149
|
+
|
|
1150
|
+
needs_rebuild: Optional[bool] = Field(
|
|
1151
|
+
None,
|
|
1152
|
+
description='Internal. Consistency flag used by position rebuilds, not part of the supported contract.',
|
|
1153
|
+
)
|
|
1154
|
+
|
|
1155
|
+
open_order_count: Optional[int] = Field(
|
|
1156
|
+
None,
|
|
1157
|
+
description='The number of open orders the account has on the market.',
|
|
1158
|
+
)
|
|
1159
|
+
|
|
1160
|
+
open_potential_fee: Optional[str] = Field(
|
|
1161
|
+
None,
|
|
1162
|
+
description='The amount of potential fee that is related to unsettled contracts. In dollars. Money as a decimal string, as sent by the API.',
|
|
1163
|
+
)
|
|
1164
|
+
|
|
1165
|
+
open_potential_profit: Optional[str] = Field(
|
|
1166
|
+
None,
|
|
1167
|
+
description='The potential profit from the outstanding contracts. In dollars. Money as a decimal string, as sent by the API.',
|
|
1168
|
+
)
|
|
1169
|
+
|
|
1170
|
+
open_premium: Optional[str] = Field(
|
|
1171
|
+
None,
|
|
1172
|
+
description="Total premium on the user's current position in the market. In dollars. Money as a decimal string, as sent by the API.",
|
|
1173
|
+
)
|
|
1174
|
+
|
|
1175
|
+
open_risk: Optional[str] = Field(
|
|
1176
|
+
None,
|
|
1177
|
+
description='The amount of risk associated with outstanding contracts. In dollars. Money as a decimal string, as sent by the API.',
|
|
1178
|
+
)
|
|
1179
|
+
|
|
1180
|
+
open_trade_count: Optional[int] = Field(
|
|
1181
|
+
None,
|
|
1182
|
+
description='The number of open trades the account has on the market.',
|
|
1183
|
+
)
|
|
1184
|
+
|
|
1185
|
+
order_liability: Optional[str] = Field(
|
|
1186
|
+
None,
|
|
1187
|
+
description='The order liability on this position from all orders. In dollars. Money as a decimal string, as sent by the API.',
|
|
1188
|
+
)
|
|
1189
|
+
|
|
1190
|
+
orders: Optional[int] = Field(
|
|
1191
|
+
None,
|
|
1192
|
+
description='Count of all orders.',
|
|
1193
|
+
)
|
|
1194
|
+
|
|
1195
|
+
original_risk: Optional[str] = Field(
|
|
1196
|
+
None,
|
|
1197
|
+
description='The original risk incurred by all trades. In dollars. Money as a decimal string, as sent by the API.',
|
|
1198
|
+
)
|
|
1199
|
+
|
|
1200
|
+
pending_close_fee: Optional[str] = Field(
|
|
1201
|
+
None,
|
|
1202
|
+
description='Fees that would be charged if the resting close orders all filled. In dollars. Money as a decimal string, as sent by the API.',
|
|
1203
|
+
)
|
|
1204
|
+
|
|
1205
|
+
pending_close_pnl: Optional[str] = Field(
|
|
1206
|
+
None,
|
|
1207
|
+
description='Profit or loss that would be realised if the resting close orders all filled. In dollars. Money as a decimal string, as sent by the API.',
|
|
1208
|
+
)
|
|
1209
|
+
|
|
1210
|
+
position: Optional[str] = Field(
|
|
1211
|
+
None,
|
|
1212
|
+
description='The numerical position of the account in the market. In contracts. Quantity as a decimal string, as sent by the API.',
|
|
1213
|
+
)
|
|
1214
|
+
|
|
1215
|
+
position_accountability_alert_id: Optional[str] = Field(
|
|
1216
|
+
None,
|
|
1217
|
+
description='Internal. Links to a position-accountability alert, not part of the supported contract.',
|
|
1218
|
+
)
|
|
1219
|
+
|
|
1220
|
+
position_premium_liability: Optional[str] = Field(
|
|
1221
|
+
None,
|
|
1222
|
+
description='The liability of the position that affects available balance. In dollars. Money as a decimal string, as sent by the API.',
|
|
1223
|
+
)
|
|
1224
|
+
|
|
1225
|
+
potential_order_trade_fee: Optional[str] = Field(
|
|
1226
|
+
None,
|
|
1227
|
+
description='Fees that would be charged if every open order on this market filled. In dollars. Money as a decimal string, as sent by the API.',
|
|
1228
|
+
)
|
|
1229
|
+
|
|
1230
|
+
rejected_buy_orders: Optional[int] = Field(
|
|
1231
|
+
None,
|
|
1232
|
+
description='Number of buy orders that were rejected.',
|
|
1233
|
+
)
|
|
1234
|
+
|
|
1235
|
+
rejected_orders: Optional[int] = Field(
|
|
1236
|
+
None,
|
|
1237
|
+
description='Number of orders that were rejected.',
|
|
1238
|
+
)
|
|
1239
|
+
|
|
1240
|
+
rejected_sell_orders: Optional[int] = Field(
|
|
1241
|
+
None,
|
|
1242
|
+
description='Number of sell orders that were rejected.',
|
|
1243
|
+
)
|
|
1244
|
+
|
|
1245
|
+
sell_contracts_closed: Optional[str] = Field(
|
|
1246
|
+
None,
|
|
1247
|
+
description='The total number of buy contracts that were closed. Quantity as a decimal string, as sent by the API.',
|
|
1248
|
+
)
|
|
1249
|
+
|
|
1250
|
+
sell_contracts_expired: Optional[str] = Field(
|
|
1251
|
+
None,
|
|
1252
|
+
description='The total number of sell contracts that were expired. Quantity as a decimal string, as sent by the API.',
|
|
1253
|
+
)
|
|
1254
|
+
|
|
1255
|
+
sell_contracts_settled: Optional[str] = Field(
|
|
1256
|
+
None,
|
|
1257
|
+
description='The total number of sell contracts settled in the position. Quantity as a decimal string, as sent by the API.',
|
|
1258
|
+
)
|
|
1259
|
+
|
|
1260
|
+
sell_contracts_traded: Optional[str] = Field(
|
|
1261
|
+
None,
|
|
1262
|
+
description="The total number of sell contracts the account has traded in the market. Only opening trade's contracts are included. Quantity as a decimal string, as sent by the API.",
|
|
1263
|
+
)
|
|
1264
|
+
|
|
1265
|
+
sell_order_liability: Optional[str] = Field(
|
|
1266
|
+
None,
|
|
1267
|
+
description='The order liability on this position from sell orders. In dollars. Money as a decimal string, as sent by the API.',
|
|
1268
|
+
)
|
|
1269
|
+
|
|
1270
|
+
sell_orders: Optional[int] = Field(
|
|
1271
|
+
None,
|
|
1272
|
+
description='Count of all sell orders.',
|
|
1273
|
+
)
|
|
1274
|
+
|
|
1275
|
+
sell_original_risk: Optional[str] = Field(
|
|
1276
|
+
None,
|
|
1277
|
+
description='The original risk incurred by sell trades. In dollars. Money as a decimal string, as sent by the API.',
|
|
1278
|
+
)
|
|
1279
|
+
|
|
1280
|
+
sell_settlements: Optional[int] = Field(
|
|
1281
|
+
None,
|
|
1282
|
+
description='Count of all settlements from sell trades.',
|
|
1283
|
+
)
|
|
1284
|
+
|
|
1285
|
+
sell_trade_count: Optional[int] = Field(
|
|
1286
|
+
None,
|
|
1287
|
+
description='The total number of sell trades the account has made on the market.',
|
|
1288
|
+
)
|
|
1289
|
+
|
|
1290
|
+
settled_at: Optional[int] = Field(
|
|
1291
|
+
None,
|
|
1292
|
+
description='DateTime at which the expired settlements were recorded which will be `nil` if the market has not resulted or voided yet. UNIX microseconds.',
|
|
1293
|
+
)
|
|
1294
|
+
|
|
1295
|
+
settlements: Optional[int] = Field(
|
|
1296
|
+
None,
|
|
1297
|
+
description='Count of all settlements from all trades.',
|
|
1298
|
+
)
|
|
1299
|
+
|
|
1300
|
+
sport: Optional[str] = Field(
|
|
1301
|
+
None,
|
|
1302
|
+
description='The sport of this market',
|
|
1303
|
+
)
|
|
1304
|
+
|
|
1305
|
+
status: Optional[str] = Field(
|
|
1306
|
+
None,
|
|
1307
|
+
description='The status of the **market** this record covers, merged in from the live market index. `null` when the market is no longer held there.',
|
|
1308
|
+
)
|
|
1309
|
+
|
|
1310
|
+
title: Optional[str] = Field(
|
|
1311
|
+
None,
|
|
1312
|
+
description='The title of the **market** this record covers, merged in from the live market index. `null` when the market is no longer held there.',
|
|
1313
|
+
)
|
|
1314
|
+
|
|
1315
|
+
total_fees: Optional[str] = Field(
|
|
1316
|
+
None,
|
|
1317
|
+
description='The total fees that have been collected on the settlements. In dollars. Money as a decimal string, as sent by the API.',
|
|
1318
|
+
)
|
|
1319
|
+
|
|
1320
|
+
total_liability: Optional[str] = Field(
|
|
1321
|
+
None,
|
|
1322
|
+
description='The liability affecting avail. balance from open orders and position. In dollars. Money as a decimal string, as sent by the API.',
|
|
1323
|
+
)
|
|
1324
|
+
|
|
1325
|
+
total_net_pnl: Optional[str] = Field(
|
|
1326
|
+
None,
|
|
1327
|
+
description='The net profit or loss after subtracting `total_fees`. In dollars. Money as a decimal string, as sent by the API.',
|
|
1328
|
+
)
|
|
1329
|
+
|
|
1330
|
+
total_settlement_pnl: Optional[str] = Field(
|
|
1331
|
+
None,
|
|
1332
|
+
description='The total Profit or Loss on all settlements. In dollars. Money as a decimal string, as sent by the API.',
|
|
1333
|
+
)
|
|
1334
|
+
|
|
1335
|
+
trade_count: Optional[int] = Field(
|
|
1336
|
+
None,
|
|
1337
|
+
description='The total number of trades the account has made on the market.',
|
|
1338
|
+
)
|
|
1339
|
+
|
|
1340
|
+
updated_at: Optional[int] = Field(
|
|
1341
|
+
None,
|
|
1342
|
+
description='Time of the last change, as UNIX microseconds.',
|
|
1343
|
+
)
|
|
1344
|
+
|
|
1345
|
+
|
|
1346
|
+
class Me(STXModel):
|
|
1347
|
+
"""The account behind the API key."""
|
|
1348
|
+
|
|
1349
|
+
account_id: Optional[str] = Field(
|
|
1350
|
+
None,
|
|
1351
|
+
description='Your account id. Trades, settlements and balances are scoped to it.',
|
|
1352
|
+
)
|
|
1353
|
+
|
|
1354
|
+
first_name: Optional[str] = Field(
|
|
1355
|
+
None,
|
|
1356
|
+
description='First name on the account, or `null` if no profile is loaded.',
|
|
1357
|
+
)
|
|
1358
|
+
|
|
1359
|
+
key_id: Optional[str] = Field(
|
|
1360
|
+
None,
|
|
1361
|
+
description='The id of the API key that signed this request - the value sent in the access-key header.',
|
|
1362
|
+
)
|
|
1363
|
+
|
|
1364
|
+
last_name: Optional[str] = Field(
|
|
1365
|
+
None,
|
|
1366
|
+
description='Last name on the account, or `null` if no profile is loaded.',
|
|
1367
|
+
)
|
|
1368
|
+
|
|
1369
|
+
method: Optional[str] = Field(
|
|
1370
|
+
None,
|
|
1371
|
+
description='How this request authenticated. `api_key` for signed requests.',
|
|
1372
|
+
)
|
|
1373
|
+
|
|
1374
|
+
scope: Optional[str] = Field(
|
|
1375
|
+
None,
|
|
1376
|
+
description='Access level granted to this key: `read_only`, or `read_write` for keys that may place and cancel orders. One of: ``read_only``, ``read_write``.',
|
|
1377
|
+
)
|
|
1378
|
+
|
|
1379
|
+
user_id: Optional[str] = Field(
|
|
1380
|
+
None,
|
|
1381
|
+
description='Your user id. Substitute this into private channel topics such as `orders:{user_id}`.',
|
|
1382
|
+
)
|
|
1383
|
+
|
|
1384
|
+
|
|
1385
|
+
class NewOrder(STXModel):
|
|
1386
|
+
"""A new order to place on the exchange."""
|
|
1387
|
+
|
|
1388
|
+
action: Optional[str] = Field(
|
|
1389
|
+
None,
|
|
1390
|
+
description='Which side of the book the order takes. One of: ``buy``, ``sell``.',
|
|
1391
|
+
)
|
|
1392
|
+
|
|
1393
|
+
cancel_on_disconnect: Optional[bool] = Field(
|
|
1394
|
+
None,
|
|
1395
|
+
description='Cancel this order if the `orders` channel stops heartbeating. See the cancel_on_disconnect guide.',
|
|
1396
|
+
)
|
|
1397
|
+
|
|
1398
|
+
client_order_id: Optional[str] = Field(
|
|
1399
|
+
None,
|
|
1400
|
+
description='Your own reference, echoed back unchanged. A free-form string, not a UUID - FIX clients routinely send ids like `my-order-001`.',
|
|
1401
|
+
)
|
|
1402
|
+
|
|
1403
|
+
device_id: Optional[str] = Field(
|
|
1404
|
+
None,
|
|
1405
|
+
description='Identifier for the device placing the order.',
|
|
1406
|
+
)
|
|
1407
|
+
|
|
1408
|
+
expiration: Optional[str] = Field(
|
|
1409
|
+
None,
|
|
1410
|
+
description='When the order should stop resting. One of: ``good_till_start``, ``good_till_time``.',
|
|
1411
|
+
)
|
|
1412
|
+
|
|
1413
|
+
expiration_time: Optional[int] = Field(
|
|
1414
|
+
None,
|
|
1415
|
+
description='The moment a `good_till_time` order expires. Required when `expiration` is `good_till_time`. UNIX microseconds.',
|
|
1416
|
+
)
|
|
1417
|
+
|
|
1418
|
+
market_id: Optional[str] = Field(
|
|
1419
|
+
None,
|
|
1420
|
+
description='The market to place the order on.',
|
|
1421
|
+
)
|
|
1422
|
+
|
|
1423
|
+
order_type: Optional[str] = Field(
|
|
1424
|
+
None,
|
|
1425
|
+
description='Whether the order takes a price or rests on the book. One of: ``limit``, ``market``.',
|
|
1426
|
+
)
|
|
1427
|
+
|
|
1428
|
+
price: Optional[str] = Field(
|
|
1429
|
+
None,
|
|
1430
|
+
description='Limit price in dollars, as a string - `"0.42"` is 42 cents and `"42.00"` is $42. A number is rejected outright rather than reinterpreted, because a bare `3000` is ambiguous between subunits and dollars and the wrong reading is a 100x overprice that still passes range validation. Must be strictly less than the market\'s `max_price`; read that from the market rather than assuming a fixed ceiling. Required for `limit` orders and unused by `market` orders, but validated whenever it is present: a malformed or sub-cent price is a 400 on a `market` order too, rather than being quietly dropped. An explicit `null` is accepted there, exactly as omitting the key is. Must be greater than zero and a whole number of cents - at most two decimal places, not counting trailing zeros. So "0.42" and "0.4200" are the same accepted value, and "0.001" is rejected. Money as a decimal string, as sent by the API.',
|
|
1431
|
+
)
|
|
1432
|
+
|
|
1433
|
+
quantity: Optional[str] = Field(
|
|
1434
|
+
None,
|
|
1435
|
+
description='Number of contracts, greater than zero, as a decimal string: `"10"` and `"10.00"` are read the same. A number is rejected rather than converted, the same rule `price` follows, though for a different reason - a float arrives as a binary double, so the size that rests on the book would not always be the size that was sent. More than nine decimal places is rounded. Responses always return it as a string.',
|
|
1436
|
+
)
|
|
1437
|
+
|
|
1438
|
+
|
|
1439
|
+
class Order(STXModel):
|
|
1440
|
+
"""An order resting on, or already matched against, the exchange book."""
|
|
1441
|
+
|
|
1442
|
+
accepted_at: Optional[int] = Field(
|
|
1443
|
+
None,
|
|
1444
|
+
description='When the matching engine accepted the order. `null` while the order is still pending. UNIX microseconds.',
|
|
1445
|
+
)
|
|
1446
|
+
|
|
1447
|
+
action: Optional[str] = Field(
|
|
1448
|
+
None,
|
|
1449
|
+
description='The action of the order, either `buy` or `sell`. One of: ``buy``, ``sell``.',
|
|
1450
|
+
)
|
|
1451
|
+
|
|
1452
|
+
amount: Optional[str] = Field(
|
|
1453
|
+
None,
|
|
1454
|
+
description='Order size expressed as stake, for orders placed by amount rather than quantity. In dollars. Money as a decimal string, as sent by the API.',
|
|
1455
|
+
)
|
|
1456
|
+
|
|
1457
|
+
avg_price: Optional[str] = Field(
|
|
1458
|
+
None,
|
|
1459
|
+
description='Volume-weighted average fill price. `null` until the order has its first fill. In dollars. Money as a decimal string, as sent by the API.',
|
|
1460
|
+
)
|
|
1461
|
+
|
|
1462
|
+
cancellation_reason: Optional[str] = Field(
|
|
1463
|
+
None,
|
|
1464
|
+
description='The cancellation reason, if the order was cancelled.',
|
|
1465
|
+
)
|
|
1466
|
+
|
|
1467
|
+
client_order_id: Optional[str] = Field(
|
|
1468
|
+
None,
|
|
1469
|
+
description='Your own identifier, echoed back unchanged, or `null` if you sent none. A free-form string, not a UUID, and set by REST and FIX callers alike.',
|
|
1470
|
+
)
|
|
1471
|
+
|
|
1472
|
+
delayed_until: Optional[int] = Field(
|
|
1473
|
+
None,
|
|
1474
|
+
description='The extended deadline for a delayed order. UNIX microseconds.',
|
|
1475
|
+
)
|
|
1476
|
+
|
|
1477
|
+
device_id: Optional[str] = Field(
|
|
1478
|
+
None,
|
|
1479
|
+
description='The device from which this order was placed.',
|
|
1480
|
+
)
|
|
1481
|
+
|
|
1482
|
+
expiration: Optional[str] = Field(
|
|
1483
|
+
None,
|
|
1484
|
+
description='The expiration condition for the order. One of: ``good_till_start``, ``good_till_time``.',
|
|
1485
|
+
)
|
|
1486
|
+
|
|
1487
|
+
expiration_time: Optional[int] = Field(
|
|
1488
|
+
None,
|
|
1489
|
+
description='The expiration time for time-based expiration. UNIX microseconds.',
|
|
1490
|
+
)
|
|
1491
|
+
|
|
1492
|
+
filled: Optional[str] = Field(
|
|
1493
|
+
None,
|
|
1494
|
+
description='Contracts filled so far. Compare with `quantity` to get remaining size. Quantity as a decimal string, as sent by the API.',
|
|
1495
|
+
)
|
|
1496
|
+
|
|
1497
|
+
filled_amount: Optional[str] = Field(
|
|
1498
|
+
None,
|
|
1499
|
+
description='The portion of `amount` that has been filled. In dollars. Money as a decimal string, as sent by the API.',
|
|
1500
|
+
)
|
|
1501
|
+
|
|
1502
|
+
filled_percentage: Optional[int] = Field(
|
|
1503
|
+
None,
|
|
1504
|
+
description='The percentage of the contracts on the order that have been filled. A percentage, not money.',
|
|
1505
|
+
)
|
|
1506
|
+
|
|
1507
|
+
fix_order: Optional[bool] = Field(
|
|
1508
|
+
None,
|
|
1509
|
+
description='True if the order arrived over FIX rather than REST.',
|
|
1510
|
+
)
|
|
1511
|
+
|
|
1512
|
+
id: Optional[str] = Field(
|
|
1513
|
+
None,
|
|
1514
|
+
description='Unique identifier for the record.',
|
|
1515
|
+
)
|
|
1516
|
+
|
|
1517
|
+
inserted_at: Optional[int] = Field(
|
|
1518
|
+
None,
|
|
1519
|
+
description='Creation time, as UNIX microseconds.',
|
|
1520
|
+
)
|
|
1521
|
+
|
|
1522
|
+
ip_address: Optional[str] = Field(
|
|
1523
|
+
None,
|
|
1524
|
+
description='The IP address from which this order was placed.',
|
|
1525
|
+
)
|
|
1526
|
+
|
|
1527
|
+
market_id: Optional[str] = Field(
|
|
1528
|
+
None,
|
|
1529
|
+
description='The market this record relates to.',
|
|
1530
|
+
)
|
|
1531
|
+
|
|
1532
|
+
odds_type: Optional[str] = Field(
|
|
1533
|
+
None,
|
|
1534
|
+
description='The odds type used when placing the order.',
|
|
1535
|
+
)
|
|
1536
|
+
|
|
1537
|
+
odds_value: Optional[str] = Field(
|
|
1538
|
+
None,
|
|
1539
|
+
description='The odds value used when placing the order.',
|
|
1540
|
+
)
|
|
1541
|
+
|
|
1542
|
+
order_type: Optional[str] = Field(
|
|
1543
|
+
None,
|
|
1544
|
+
description='The type of order, either `limit` or `market`. One of: ``limit``, ``market``.',
|
|
1545
|
+
)
|
|
1546
|
+
|
|
1547
|
+
placed_pre_start: Optional[bool] = Field(
|
|
1548
|
+
None,
|
|
1549
|
+
description='Whether the order was placed before the event started.',
|
|
1550
|
+
)
|
|
1551
|
+
|
|
1552
|
+
price: Optional[str] = Field(
|
|
1553
|
+
None,
|
|
1554
|
+
description="Limit price. The ceiling is the market's `max_price`, not a fixed 99 - read it from the market. Absent for market orders. In dollars. Carries up to 7 decimal places - parse money with a variable-scale decimal type, not a fixed-width one. Money as a decimal string, as sent by the API.",
|
|
1555
|
+
)
|
|
1556
|
+
|
|
1557
|
+
quantity: Optional[str] = Field(
|
|
1558
|
+
None,
|
|
1559
|
+
description='Order size in contracts. Quantity as a decimal string, as sent by the API.',
|
|
1560
|
+
)
|
|
1561
|
+
|
|
1562
|
+
rejection_reason: Optional[str] = Field(
|
|
1563
|
+
None,
|
|
1564
|
+
description='The rejection reason, if the order was rejected.',
|
|
1565
|
+
)
|
|
1566
|
+
|
|
1567
|
+
status: Optional[str] = Field(
|
|
1568
|
+
None,
|
|
1569
|
+
description='Order state - one of nine. See [Market and order status](/concepts/market-status/#order-statuses) for the full set and which are terminal. One of: ``created``, ``requested``, ``accepted``, ``delayed``, ``open``, ``filled``, ``rejected``, ``cancelled``, ``partially_cancelled``.',
|
|
1570
|
+
)
|
|
1571
|
+
|
|
1572
|
+
time: Optional[str] = Field(
|
|
1573
|
+
None,
|
|
1574
|
+
description='The ISO-8601 timestamp of the time the order was placed.',
|
|
1575
|
+
)
|
|
1576
|
+
|
|
1577
|
+
total_value: Optional[str] = Field(
|
|
1578
|
+
None,
|
|
1579
|
+
description='Total premium across all fills on this order. In dollars. Money as a decimal string, as sent by the API.',
|
|
1580
|
+
)
|
|
1581
|
+
|
|
1582
|
+
|
|
1583
|
+
class PaymentTransaction(STXModel):
|
|
1584
|
+
"""One deposit, withdrawal or balance adjustment, enriched with its payment method."""
|
|
1585
|
+
|
|
1586
|
+
account_id: Optional[str] = Field(
|
|
1587
|
+
None,
|
|
1588
|
+
description='The account the record belongs to.',
|
|
1589
|
+
)
|
|
1590
|
+
|
|
1591
|
+
amount: Optional[str] = Field(
|
|
1592
|
+
None,
|
|
1593
|
+
description='The monetary value the entry was calculated from. In dollars. Money as a decimal string, as sent by the API.',
|
|
1594
|
+
)
|
|
1595
|
+
|
|
1596
|
+
event_id: Optional[str] = Field(
|
|
1597
|
+
None,
|
|
1598
|
+
description='The event the market belongs to.',
|
|
1599
|
+
)
|
|
1600
|
+
|
|
1601
|
+
fee_id: Optional[str] = Field(
|
|
1602
|
+
None,
|
|
1603
|
+
description='The fee that generated this entry, when it came from one.',
|
|
1604
|
+
)
|
|
1605
|
+
|
|
1606
|
+
id: Optional[str] = Field(
|
|
1607
|
+
None,
|
|
1608
|
+
description='Unique identifier for the record.',
|
|
1609
|
+
)
|
|
1610
|
+
|
|
1611
|
+
inserted_at: Optional[int] = Field(
|
|
1612
|
+
None,
|
|
1613
|
+
description='Creation time, as UNIX microseconds.',
|
|
1614
|
+
)
|
|
1615
|
+
|
|
1616
|
+
market_id: Optional[str] = Field(
|
|
1617
|
+
None,
|
|
1618
|
+
description='The market this record relates to.',
|
|
1619
|
+
)
|
|
1620
|
+
|
|
1621
|
+
method: Optional[str] = Field(
|
|
1622
|
+
None,
|
|
1623
|
+
description='The payment method the provider reports for this transaction.',
|
|
1624
|
+
)
|
|
1625
|
+
|
|
1626
|
+
payment_id: Optional[str] = Field(
|
|
1627
|
+
None,
|
|
1628
|
+
description='The payment that generated this entry, when it came from one.',
|
|
1629
|
+
)
|
|
1630
|
+
|
|
1631
|
+
points: Optional[float] = Field(
|
|
1632
|
+
None,
|
|
1633
|
+
description='Points added by this entry. Negative when points were spent.',
|
|
1634
|
+
)
|
|
1635
|
+
|
|
1636
|
+
reason: Optional[str] = Field(
|
|
1637
|
+
None,
|
|
1638
|
+
description="The provider's reason or description for the transaction.",
|
|
1639
|
+
)
|
|
1640
|
+
|
|
1641
|
+
settlement_id: Optional[str] = Field(
|
|
1642
|
+
None,
|
|
1643
|
+
description='The settlement that generated this entry, when it came from one.',
|
|
1644
|
+
)
|
|
1645
|
+
|
|
1646
|
+
sub_method: Optional[str] = Field(
|
|
1647
|
+
None,
|
|
1648
|
+
description='For Interac, whether the transfer was a `Send` or a `Request`.',
|
|
1649
|
+
)
|
|
1650
|
+
|
|
1651
|
+
time: Optional[str] = Field(
|
|
1652
|
+
None,
|
|
1653
|
+
description='When the entry was recorded.',
|
|
1654
|
+
)
|
|
1655
|
+
|
|
1656
|
+
type: Optional[str] = Field(
|
|
1657
|
+
None,
|
|
1658
|
+
description='What moved the money or the points - for example a deposit, a trade fee, a referral, or a manual adjustment. Each endpoint returns only its own subset of these. One of: ``deposit``, ``withdrawal``, ``settlement``, ``fee``, ``fee_refund``, ``casino``, ``adjustment``, ``loyalty``, ``loyalty_points_rollup``, ``loyalty_points_referral``.',
|
|
1659
|
+
)
|
|
1660
|
+
|
|
1661
|
+
|
|
1662
|
+
class Position(STXModel):
|
|
1663
|
+
"""Your position in one market."""
|
|
1664
|
+
|
|
1665
|
+
account_id: Optional[str] = Field(
|
|
1666
|
+
None,
|
|
1667
|
+
description='The account the position belongs to.',
|
|
1668
|
+
)
|
|
1669
|
+
|
|
1670
|
+
average_open_premium: Optional[str] = Field(
|
|
1671
|
+
None,
|
|
1672
|
+
description='Average premium per contract for the open portion. In dollars. Money as a decimal string, as sent by the API.',
|
|
1673
|
+
)
|
|
1674
|
+
|
|
1675
|
+
buy_order_liability: Optional[str] = Field(
|
|
1676
|
+
None,
|
|
1677
|
+
description='Liability from your open buy orders on this market. In dollars. Money as a decimal string, as sent by the API.',
|
|
1678
|
+
)
|
|
1679
|
+
|
|
1680
|
+
contracts_settled: Optional[str] = Field(
|
|
1681
|
+
None,
|
|
1682
|
+
description='Contracts settled in the position so far. Quantity as a decimal string, as sent by the API.',
|
|
1683
|
+
)
|
|
1684
|
+
|
|
1685
|
+
event_id: Optional[str] = Field(
|
|
1686
|
+
None,
|
|
1687
|
+
description='The event the market belongs to.',
|
|
1688
|
+
)
|
|
1689
|
+
|
|
1690
|
+
gross_pnl: Optional[str] = Field(
|
|
1691
|
+
None,
|
|
1692
|
+
description='`total_settlement_pnl` plus any pending-close profit or loss that has not settled yet. In dollars. Money as a decimal string, as sent by the API.',
|
|
1693
|
+
)
|
|
1694
|
+
|
|
1695
|
+
id: Optional[str] = Field(
|
|
1696
|
+
None,
|
|
1697
|
+
description='The unique id of the position record.',
|
|
1698
|
+
)
|
|
1699
|
+
|
|
1700
|
+
market_id: Optional[str] = Field(
|
|
1701
|
+
None,
|
|
1702
|
+
description='The market the position is on.',
|
|
1703
|
+
)
|
|
1704
|
+
|
|
1705
|
+
max_potential_fee: Optional[str] = Field(
|
|
1706
|
+
None,
|
|
1707
|
+
description="Total potential fee across the position's settlements. In dollars. Money as a decimal string, as sent by the API.",
|
|
1708
|
+
)
|
|
1709
|
+
|
|
1710
|
+
max_potential_profit: Optional[str] = Field(
|
|
1711
|
+
None,
|
|
1712
|
+
description='Total possible profit for the position if everything settles favourably. In dollars. Money as a decimal string, as sent by the API.',
|
|
1713
|
+
)
|
|
1714
|
+
|
|
1715
|
+
max_risk: Optional[str] = Field(
|
|
1716
|
+
None,
|
|
1717
|
+
description='Account-level risk on the position, netting in already settled profit and loss. In dollars. Money as a decimal string, as sent by the API.',
|
|
1718
|
+
)
|
|
1719
|
+
|
|
1720
|
+
open_potential_fee: Optional[str] = Field(
|
|
1721
|
+
None,
|
|
1722
|
+
description='Potential fee on the open contracts when they settle. In dollars. Money as a decimal string, as sent by the API.',
|
|
1723
|
+
)
|
|
1724
|
+
|
|
1725
|
+
open_potential_profit: Optional[str] = Field(
|
|
1726
|
+
None,
|
|
1727
|
+
description="Possible profit on the position's open contracts. In dollars. Money as a decimal string, as sent by the API.",
|
|
1728
|
+
)
|
|
1729
|
+
|
|
1730
|
+
open_risk: Optional[str] = Field(
|
|
1731
|
+
None,
|
|
1732
|
+
description="Risk on the position's open (unsettled) contracts. In dollars. Money as a decimal string, as sent by the API.",
|
|
1733
|
+
)
|
|
1734
|
+
|
|
1735
|
+
position: Optional[str] = Field(
|
|
1736
|
+
None,
|
|
1737
|
+
description='Net position in the market: positive if long (bought), negative if short (sold). Can be `"0.00"` for a market you have traded and closed out that has not settled yet. In contracts. Quantity as a decimal string, as sent by the API.',
|
|
1738
|
+
)
|
|
1739
|
+
|
|
1740
|
+
position_premium_liability: Optional[str] = Field(
|
|
1741
|
+
None,
|
|
1742
|
+
description="Liability from the position's premium that counts against available balance. Routinely negative. In dollars. Money as a decimal string, as sent by the API.",
|
|
1743
|
+
)
|
|
1744
|
+
|
|
1745
|
+
premium: Optional[str] = Field(
|
|
1746
|
+
None,
|
|
1747
|
+
description='Total premium paid or received for the open portion of the position. In dollars. Money as a decimal string, as sent by the API.',
|
|
1748
|
+
)
|
|
1749
|
+
|
|
1750
|
+
sell_order_liability: Optional[str] = Field(
|
|
1751
|
+
None,
|
|
1752
|
+
description='Liability from your open sell orders on this market. In dollars. Money as a decimal string, as sent by the API.',
|
|
1753
|
+
)
|
|
1754
|
+
|
|
1755
|
+
total_fee: Optional[str] = Field(
|
|
1756
|
+
None,
|
|
1757
|
+
description="Total fees paid across the position's settlements. In dollars. Money as a decimal string, as sent by the API.",
|
|
1758
|
+
)
|
|
1759
|
+
|
|
1760
|
+
total_settlement_pnl: Optional[str] = Field(
|
|
1761
|
+
None,
|
|
1762
|
+
description='Profit or loss realised from settlements so far. In dollars. Money as a decimal string, as sent by the API.',
|
|
1763
|
+
)
|
|
1764
|
+
|
|
1765
|
+
|
|
1766
|
+
class RecentTrade(STXModel):
|
|
1767
|
+
"""One recent public trade on the market."""
|
|
1768
|
+
|
|
1769
|
+
liquidity_taker: Optional[str] = Field(
|
|
1770
|
+
None,
|
|
1771
|
+
description="Which side took liquidity. `Trade.liquidity_taker/1` derives this from the resting side, so the values are `buyer` and `seller` - not `buy`/`sell` as on an order's `action`. One of: ``buyer``, ``seller``.",
|
|
1772
|
+
)
|
|
1773
|
+
|
|
1774
|
+
price: Optional[str] = Field(
|
|
1775
|
+
None,
|
|
1776
|
+
description='The price the trade executed at. In dollars. Money as a decimal string, as sent by the API.',
|
|
1777
|
+
)
|
|
1778
|
+
|
|
1779
|
+
quantity: Optional[str] = Field(
|
|
1780
|
+
None,
|
|
1781
|
+
description='Contracts traded. Quantity as a decimal string, as sent by the API.',
|
|
1782
|
+
)
|
|
1783
|
+
|
|
1784
|
+
timestamp: Optional[str] = Field(
|
|
1785
|
+
None,
|
|
1786
|
+
description='When the trade executed.',
|
|
1787
|
+
)
|
|
1788
|
+
|
|
1789
|
+
timestamp_us: Optional[int] = Field(
|
|
1790
|
+
None,
|
|
1791
|
+
description='When the trade executed, as UNIX microseconds.',
|
|
1792
|
+
)
|
|
1793
|
+
|
|
1794
|
+
|
|
1795
|
+
class Settlement(STXModel):
|
|
1796
|
+
"""One closed or expired position."""
|
|
1797
|
+
|
|
1798
|
+
account_id: Optional[str] = Field(
|
|
1799
|
+
None,
|
|
1800
|
+
description='The account the record belongs to.',
|
|
1801
|
+
)
|
|
1802
|
+
|
|
1803
|
+
closing_placed_pre_start: Optional[bool] = Field(
|
|
1804
|
+
None,
|
|
1805
|
+
description="Whether the closing trade's order was placed before the event started.",
|
|
1806
|
+
)
|
|
1807
|
+
|
|
1808
|
+
closing_price: Optional[str] = Field(
|
|
1809
|
+
None,
|
|
1810
|
+
description='The price of the contracts when the position was closed. In dollars. Money as a decimal string, as sent by the API.',
|
|
1811
|
+
)
|
|
1812
|
+
|
|
1813
|
+
closing_trade_id: Optional[str] = Field(
|
|
1814
|
+
None,
|
|
1815
|
+
description='The id of the trade that closed this settlement, if any.',
|
|
1816
|
+
)
|
|
1817
|
+
|
|
1818
|
+
closing_traded_pre_start: Optional[bool] = Field(
|
|
1819
|
+
None,
|
|
1820
|
+
description='Whether the closing trade was placed before the event started.',
|
|
1821
|
+
)
|
|
1822
|
+
|
|
1823
|
+
fee: Optional[str] = Field(
|
|
1824
|
+
None,
|
|
1825
|
+
description='The fee charged for the settlement. In dollars. Money as a decimal string, as sent by the API.',
|
|
1826
|
+
)
|
|
1827
|
+
|
|
1828
|
+
gross_pnl: Optional[str] = Field(
|
|
1829
|
+
None,
|
|
1830
|
+
description='The profit or loss associated with the position. In dollars. Money as a decimal string, as sent by the API.',
|
|
1831
|
+
)
|
|
1832
|
+
|
|
1833
|
+
id: Optional[str] = Field(
|
|
1834
|
+
None,
|
|
1835
|
+
description='Unique identifier for the record.',
|
|
1836
|
+
)
|
|
1837
|
+
|
|
1838
|
+
inserted_at: Optional[int] = Field(
|
|
1839
|
+
None,
|
|
1840
|
+
description='Creation time, as UNIX microseconds.',
|
|
1841
|
+
)
|
|
1842
|
+
|
|
1843
|
+
market_id: Optional[str] = Field(
|
|
1844
|
+
None,
|
|
1845
|
+
description='The market this record relates to.',
|
|
1846
|
+
)
|
|
1847
|
+
|
|
1848
|
+
opening_placed_pre_start: Optional[bool] = Field(
|
|
1849
|
+
None,
|
|
1850
|
+
description="Whether the opening trade's order was placed before the event started.",
|
|
1851
|
+
)
|
|
1852
|
+
|
|
1853
|
+
opening_price: Optional[str] = Field(
|
|
1854
|
+
None,
|
|
1855
|
+
description='The price of the contracts when the position was opened. In dollars. Money as a decimal string, as sent by the API.',
|
|
1856
|
+
)
|
|
1857
|
+
|
|
1858
|
+
opening_trade_id: Optional[str] = Field(
|
|
1859
|
+
None,
|
|
1860
|
+
description='The id of the trade that opened this settlement.',
|
|
1861
|
+
)
|
|
1862
|
+
|
|
1863
|
+
opening_traded_pre_start: Optional[bool] = Field(
|
|
1864
|
+
None,
|
|
1865
|
+
description='Whether the opening trade was placed before the event started.',
|
|
1866
|
+
)
|
|
1867
|
+
|
|
1868
|
+
pre_start: Optional[bool] = Field(
|
|
1869
|
+
None,
|
|
1870
|
+
description='Whether the settlement was placed before the event started.',
|
|
1871
|
+
)
|
|
1872
|
+
|
|
1873
|
+
quantity: Optional[str] = Field(
|
|
1874
|
+
None,
|
|
1875
|
+
description='The number of contracts that were settled. Quantity as a decimal string, as sent by the API.',
|
|
1876
|
+
)
|
|
1877
|
+
|
|
1878
|
+
realized_pnl: Optional[str] = Field(
|
|
1879
|
+
None,
|
|
1880
|
+
description='The net profit or loss minus fees. In dollars. Money as a decimal string, as sent by the API.',
|
|
1881
|
+
)
|
|
1882
|
+
|
|
1883
|
+
settled_premium: Optional[str] = Field(
|
|
1884
|
+
None,
|
|
1885
|
+
description='The amount of premium that was settled by the trade. In dollars. Money as a decimal string, as sent by the API.',
|
|
1886
|
+
)
|
|
1887
|
+
|
|
1888
|
+
settled_risk: Optional[str] = Field(
|
|
1889
|
+
None,
|
|
1890
|
+
description='The amount of risk that was settled by the trade. In dollars. Money as a decimal string, as sent by the API.',
|
|
1891
|
+
)
|
|
1892
|
+
|
|
1893
|
+
time: Optional[str] = Field(
|
|
1894
|
+
None,
|
|
1895
|
+
description='ISO-8601 timestamp of when the settlement was created. Same instant as `inserted_at`, which carries it as UNIX microseconds.',
|
|
1896
|
+
)
|
|
1897
|
+
|
|
1898
|
+
type: Optional[str] = Field(
|
|
1899
|
+
None,
|
|
1900
|
+
description='The type of settlement. One of: ``closed_short``, ``closed_long``, ``expired_short``, ``expired_long``.',
|
|
1901
|
+
)
|
|
1902
|
+
|
|
1903
|
+
|
|
1904
|
+
class StatDetail(STXModel):
|
|
1905
|
+
"""The stat line a prop market is derived from."""
|
|
1906
|
+
|
|
1907
|
+
jersey: Optional[str] = Field(
|
|
1908
|
+
None,
|
|
1909
|
+
description="The player's jersey number, when known.",
|
|
1910
|
+
)
|
|
1911
|
+
|
|
1912
|
+
line: Optional[float] = Field(
|
|
1913
|
+
None,
|
|
1914
|
+
description='The line value the market sits at, when the prop carries one.',
|
|
1915
|
+
)
|
|
1916
|
+
|
|
1917
|
+
participant: Optional[str] = Field(
|
|
1918
|
+
None,
|
|
1919
|
+
description='The participant the line belongs to, when applicable.',
|
|
1920
|
+
)
|
|
1921
|
+
|
|
1922
|
+
player: Optional[str] = Field(
|
|
1923
|
+
None,
|
|
1924
|
+
description='The player the line belongs to, or `null` for a team line.',
|
|
1925
|
+
)
|
|
1926
|
+
|
|
1927
|
+
prop_type: Optional[str] = Field(
|
|
1928
|
+
None,
|
|
1929
|
+
description='The shape of the prop. One of: ``ou``, ``yn``, ``1v2``, ``field``.',
|
|
1930
|
+
)
|
|
1931
|
+
|
|
1932
|
+
stat: Optional[str] = Field(
|
|
1933
|
+
None,
|
|
1934
|
+
description='The stat being wagered on, e.g. `passingYards`.',
|
|
1935
|
+
)
|
|
1936
|
+
|
|
1937
|
+
stat_display_name: Optional[str] = Field(
|
|
1938
|
+
None,
|
|
1939
|
+
description='Human-readable name for `stat`.',
|
|
1940
|
+
)
|
|
1941
|
+
|
|
1942
|
+
|
|
1943
|
+
class Transaction(STXModel):
|
|
1944
|
+
"""One ledger entry on the account."""
|
|
1945
|
+
|
|
1946
|
+
account_id: Optional[str] = Field(
|
|
1947
|
+
None,
|
|
1948
|
+
description='The account the record belongs to.',
|
|
1949
|
+
)
|
|
1950
|
+
|
|
1951
|
+
amount: Optional[str] = Field(
|
|
1952
|
+
None,
|
|
1953
|
+
description='The monetary value the entry was calculated from. In dollars. Money as a decimal string, as sent by the API.',
|
|
1954
|
+
)
|
|
1955
|
+
|
|
1956
|
+
event_id: Optional[str] = Field(
|
|
1957
|
+
None,
|
|
1958
|
+
description='The event the market belongs to.',
|
|
1959
|
+
)
|
|
1960
|
+
|
|
1961
|
+
fee_id: Optional[str] = Field(
|
|
1962
|
+
None,
|
|
1963
|
+
description='The fee that generated this entry, when it came from one.',
|
|
1964
|
+
)
|
|
1965
|
+
|
|
1966
|
+
id: Optional[str] = Field(
|
|
1967
|
+
None,
|
|
1968
|
+
description='Unique identifier for the record.',
|
|
1969
|
+
)
|
|
1970
|
+
|
|
1971
|
+
inserted_at: Optional[int] = Field(
|
|
1972
|
+
None,
|
|
1973
|
+
description='Creation time, as UNIX microseconds.',
|
|
1974
|
+
)
|
|
1975
|
+
|
|
1976
|
+
market_id: Optional[str] = Field(
|
|
1977
|
+
None,
|
|
1978
|
+
description='The market this record relates to.',
|
|
1979
|
+
)
|
|
1980
|
+
|
|
1981
|
+
payment_id: Optional[str] = Field(
|
|
1982
|
+
None,
|
|
1983
|
+
description='The payment that generated this entry, when it came from one.',
|
|
1984
|
+
)
|
|
1985
|
+
|
|
1986
|
+
points: Optional[float] = Field(
|
|
1987
|
+
None,
|
|
1988
|
+
description='Points added by this entry. Negative when points were spent.',
|
|
1989
|
+
)
|
|
1990
|
+
|
|
1991
|
+
referee_account_id: Optional[str] = Field(
|
|
1992
|
+
None,
|
|
1993
|
+
description='For referral entries, the account that was referred.',
|
|
1994
|
+
)
|
|
1995
|
+
|
|
1996
|
+
referrer_account_id: Optional[str] = Field(
|
|
1997
|
+
None,
|
|
1998
|
+
description='For referral entries, the account that referred.',
|
|
1999
|
+
)
|
|
2000
|
+
|
|
2001
|
+
settlement_id: Optional[str] = Field(
|
|
2002
|
+
None,
|
|
2003
|
+
description='The settlement that generated this entry, when it came from one.',
|
|
2004
|
+
)
|
|
2005
|
+
|
|
2006
|
+
time: Optional[str] = Field(
|
|
2007
|
+
None,
|
|
2008
|
+
description='When the entry was recorded.',
|
|
2009
|
+
)
|
|
2010
|
+
|
|
2011
|
+
type: Optional[str] = Field(
|
|
2012
|
+
None,
|
|
2013
|
+
description='What moved the money or the points - for example a deposit, a trade fee, a referral, or a manual adjustment. Each endpoint returns only its own subset of these. One of: ``deposit``, ``withdrawal``, ``settlement``, ``fee``, ``fee_refund``, ``casino``, ``adjustment``, ``loyalty``, ``loyalty_points_rollup``, ``loyalty_points_referral``.',
|
|
2014
|
+
)
|
|
2015
|
+
|
|
2016
|
+
Balance.model_rebuild()
|
|
2017
|
+
BookLevel.model_rebuild()
|
|
2018
|
+
Cancellation.model_rebuild()
|
|
2019
|
+
Error.model_rebuild()
|
|
2020
|
+
Event.model_rebuild()
|
|
2021
|
+
FeeTransaction.model_rebuild()
|
|
2022
|
+
Fill.model_rebuild()
|
|
2023
|
+
Market.model_rebuild()
|
|
2024
|
+
MarketFilter.model_rebuild()
|
|
2025
|
+
MarketStat.model_rebuild()
|
|
2026
|
+
Me.model_rebuild()
|
|
2027
|
+
NewOrder.model_rebuild()
|
|
2028
|
+
Order.model_rebuild()
|
|
2029
|
+
PaymentTransaction.model_rebuild()
|
|
2030
|
+
Position.model_rebuild()
|
|
2031
|
+
RecentTrade.model_rebuild()
|
|
2032
|
+
Settlement.model_rebuild()
|
|
2033
|
+
StatDetail.model_rebuild()
|
|
2034
|
+
Transaction.model_rebuild()
|