-
Notifications
You must be signed in to change notification settings - Fork 1
/
betting_types.go
459 lines (405 loc) · 20.3 KB
/
betting_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
package betfair
type MarketFilter struct {
TextQuery *string `json:"textQuery,omitempty"`
ExchangeIDs []string `json:"exchangeIds,omitempty"`
EventTypeIDs []string `json:"eventTypeIds,omitempty"`
EventIDs []string `json:"eventIds,omitempty"`
CompetitionIDs []string `json:"competitionIds,omitempty"`
MarketIDs []string `json:"marketIds,omitempty"`
Venues []string `json:"venues,omitempty"`
BspOnly *bool `json:"bspOnly,omitempty"`
TurnInPlayEnabled *bool `json:"turnInPlayEnabled,omitempty"`
InPlayOnly *bool `json:"inPlayOnly,omitempty"`
MarketBettingTypes []EMarketBettingTypes `json:"marketBettingTypes,omitempty"`
MarketCountries []string `json:"marketCountries,omitempty"`
MarketTypeCodes []string `json:"marketTypeCodes,omitempty"`
MarketStartTime *TimeRange `json:"marketStartTime,omitempty"`
WithOrders []EOrderStatus `json:"withOrders,omitempty"`
RaceTypes []string `json:"raceTypes,omitempty"`
}
type MarketCatalogue struct {
MarketID string `json:"marketId"`
MarketName string `json:"marketName"`
MarketStartTime *Time `json:"marketStartTime,omitempty"`
Description *MarketDescription `json:"description,omitempty"`
TotalMatched *float64 `json:"totalMatched,omitempty"`
Runners []RunnerCatalog `json:"runners,omitempty"`
EventType *EventType `json:"eventType,omitempty"`
Competition *Competition `json:"competition,omitempty"`
Event *Event `json:"event,omitempty"`
}
type MarketBook struct {
MarketID string `json:"marketId"`
IsMarketDataDelayed bool `json:"isMarketDataDelayed"`
Status *EMarketStatus `json:"status,omitempty"`
BetDelay *int `json:"betDelay,omitempty"`
BspReconciled *bool `json:"bspReconciled,omitempty"`
Complete *bool `json:"complete,omitempty"`
Inplay *bool `json:"inplay,omitempty"`
NumberOfWinners *int `json:"numberOfWinners,omitempty"`
NumberOfRunners *int `json:"numberOfRunners,omitempty"`
NumberOfActiveRunners *int `json:"numberOfActiveRunners,omitempty"`
LastMatchTime *Time `json:"lastMatchTime,omitempty"`
TotalMatched *float64 `json:"totalMatched,omitempty"`
TotalAvailable *float64 `json:"totalAvailable,omitempty"`
CrossMatching *bool `json:"crossMatching,omitempty"`
RunnersVoidable *bool `json:"runnersVoidable,omitempty"`
Version *int64 `json:"version,omitempty"`
Runners []Runner `json:"runners,omitempty"`
KeyLineDescription *KeyLineDescription `json:"keyLineDescription,omitempty"`
}
type RunnerCatalog struct {
SelectionID int64 `json:"selectionId"`
RunnerName string `json:"runnerName"`
Handicap float64 `json:"handicap"`
SortPriority int `json:"sortPriority"`
Metadata map[string]string `json:"metadata,omitempty"`
}
type Runner struct {
SelectionID int64 `json:"selectionId"`
Handicap float64 `json:"handicap"`
Status ERunnerStatus `json:"status"`
AdjustmentFactor float64 `json:"adjustmentFactor"`
LastPriceTraded *float64 `json:"lastPriceTraded,omitempty"`
TotalMatched *float64 `json:"totalMatched,omitempty"`
RemovalDate *Time `json:"removalDate,omitempty"`
SP *StartingPrices `json:"sp,omitempty"`
EX *ExchangePrices `json:"ex,omitempty"`
Orders []Order `json:"orders,omitempty"`
Matches []Match `json:"matches,omitempty"`
MatchesByStrategy map[string][]Match `json:"matchesByStrategy,omitempty"`
}
type StartingPrices struct {
NearPrice *float64 `json:"nearPrice,omitempty"`
FarPrice *float64 `json:"farPrice,omitempty"`
BackStakeTaken []PriceSize `json:"backStakeTaken,omitempty"`
LayLiabilityTaken []PriceSize `json:"layLiabilityTaken,omitempty"`
ActualSP *float64 `json:"actualSP,omitempty"`
}
type ExchangePrices struct {
AvailableToBack []PriceSize `json:"availableToBack,omitempty"`
AvailableToLay []PriceSize `json:"availableToLay,omitempty"`
TradedVolume []PriceSize `json:"tradedVolume,omitempty"`
}
type Event struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
CountryCode *string `json:"countryCode,omitempty"`
Timezone *string `json:"timezone,omitempty"`
Venue *string `json:"venue,omitempty"`
OpenDate *Time `json:"openDate,omitempty"`
}
type EventResult struct {
Event *Event `json:"event,omitempty"`
MarketCount *int `json:"marketCount,omitempty"`
}
type Competition struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
}
type CompetitionResult struct {
Competition *Competition `json:"competition,omitempty"`
MarketCount *int `json:"marketCount,omitempty"`
CompetitionRegion *string `json:"competitionRegion,omitempty"`
}
type EventType struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
}
type EventTypeResult struct {
EventType *EventType `json:"eventType,omitempty"`
MarketCount *int `json:"marketCount,omitempty"`
}
type MarketTypeResult struct {
MarketType *string `json:"marketType,omitempty"`
MarketCount *int `json:"marketCount,omitempty"`
}
type CountryCodeResult struct {
CountryCode *string `json:"countryCode,omitempty"`
MarketCount *int `json:"marketCount,omitempty"`
}
type VenueResult struct {
Venue *string `json:"venue,omitempty"`
MarketCount *int `json:"marketCount,omitempty"`
}
type TimeRange struct {
From *Time `json:"from,omitempty"`
To *Time `json:"to,omitempty"`
}
type TimeRangeResult struct {
TimeRange *TimeRange `json:"timeRange,omitempty"`
MarketCount *int `json:"marketCount,omitempty"`
}
type Order struct {
BetID string `json:"betId"`
OrderType EOrderType `json:"orderType"`
Status EOrderStatus `json:"orderStatus"`
PersistenceType EPersistenceType `json:"persistenceType"`
Side ESide `json:"side"`
Price float64 `json:"price"`
Size float64 `json:"size"`
BspLiability float64 `json:"bspLiability"`
PlacedDate Time `json:"placedDate"`
AvgPriceMatched *float64 `json:"avgPriceMatched,omitempty"`
SizeMatched *float64 `json:"sizeMatched,omitempty"`
SizeRemaining *float64 `json:"sizeRemaining,omitempty"`
SizeLapsed *float64 `json:"sizeLapsed,omitempty"`
SizeCancelled *float64 `json:"sizeCancelled,omitempty"`
SizeVoided *float64 `json:"sizeVoided,omitempty"`
CustomerOrderRef *string `json:"customerOrderRef,omitempty"`
CustomerStrategyRef *string `json:"customerStrategyRef,omitempty"`
}
// An individual bet Match, or rollup by price or avg price. Rollup depends on the requested MatchProjection.
type Match struct {
BetID *string `json:"betId,omitempty"`
MatchID *string `json:"matchId,omitempty"`
Side ESide `json:"side"`
Price float64 `json:"price"`
Size float64 `json:"size"`
MatchDate *Time `json:"matchDate,omitempty"`
}
type MarketVersion struct {
Version *int64 `json:"version,omitempty"`
}
type MarketDescription struct {
PersistenceEnabled bool `json:"persistenceEnabled"`
BspMarket bool `json:"bspMarket"`
MarketTime Time `json:"marketTime"`
SuspendTime Time `json:"suspendTime"`
SettleTime *Time `json:"settleTime,omitempty"`
BettingType EMarketBettingType `json:"bettingType"`
TurnInPlayEnabled bool `json:"turnInPlayEnabled"`
MarketType string `json:"marketType"`
Regulator string `json:"regulator"`
MarketBaseRate float64 `json:"marketBaseRate"`
DiscountAllowed bool `json:"discountAllowed"`
Wallet *string `json:"wallet,omitempty"`
Rules *string `json:"rules,omitempty"`
RulesHasDate *bool `json:"rulesHasDate,omitempty"`
EachWayDivisor *float64 `json:"eachWayDivisor,omitempty"`
Clarifications *string `json:"clarifications,omitempty"`
LineRangeInfo *MarketLineRangeInfo `json:"lineRangeInfo,omitempty"`
RaceType *string `json:"raceType,omitempty"`
PriceLadderDescription *PriceLadderDescription `json:"priceLadderDescription,omitempty"`
}
type MarketRates struct {
MarketBaseRate float64 `json:"marketBaseRate"`
DiscountAllowed bool `json:"discountAllowed"`
}
type MarketLicence struct {
Wallet string `json:"wallet"`
Rules *string `json:"rules,omitempty"`
RulesHasDate *bool `json:"rulesHasDate,omitempty"`
Clarifications *string `json:"clarifications,omitempty"`
}
type MarketLineRangeInfo struct {
MaxUnitValue float64 `json:"maxUnitValue"`
MinUnitValue float64 `json:"minUnitValue"`
Interval float64 `json:"interval"`
MarketUnit string `json:"marketUnit"`
}
type PriceSize struct {
Price float64 `json:"price"`
Size float64 `json"size"`
}
type ClearedOrderSummary struct {
EventTypeID *string `json:"eventTypeId,omitempty"`
EventID *string `json:"eventId,omitempty"`
MarketID *string `json:"marketId,omitempty"`
SelectionID *int64 `json:"selectionId,omitempty"`
Handicap *float64 `json:"handicap,omitempty"`
BetID *string `json:"betId,omitempty"`
PlacedDate *Time `json:"placedDate,omitempty"`
PersistenceType *EPersistenceType `json:"persistenceType,omitempty"`
OrderType *EOrderType `json:"orderType,omitempty"`
Side *ESide `json:"side,omitempty"`
ItemDescription *ItemDescription `json:"itemDescription,omitempty"`
BetOutcome *string `json:"betOutcome,omitempty"`
PriceRequested *float64 `json:"priceRequested,omitempty"`
SettledDate *Time `json:"settledDate,omitempty"`
LastMatchedDate *Time `json:"lastMatchedDate,omitempty"`
BetCount *int `json:"betCount,omitempty"`
Commission *float64 `json:"commission,omitempty"`
PriceMatched *float64 `json:"priceMatched,omitempty"`
PriceReduced *bool `json:"priceReduced,omitempty"`
SizeSettled *float64 `json:"sizeSettled,omitempty"`
Profit *float64 `json:"profit,omitempty"`
SizeCancelled *float64 `json:"sizeCancelled,omitempty"`
CustomerOrderRef *string `json:"customerOrderRef,omitempty"`
CustomerStrategyRef *string `json:"customerStrategyRef,omitempty"`
}
type ClearedOrderSummaryReport struct {
ClearedOrders []ClearedOrderSummary `json:"clearedOrders"`
MoreAvailable bool `json:"moreAvailable"`
}
type ItemDescription struct {
EventTypeDesc *string `json:"eventTypeDesc,omitempty"`
EventDesc *string `json:"eventDesc,omitempty"`
MarketDesc *string `json:"marketDesc,omitempty"`
MarketType *string `json:"marketType,omitempty"`
MarketStartTime *Time `json:"marketStartTime,omitempty"`
RunnerDesc *string `json:"runnerDesc,omitempty"`
NumberOfWinners *int `json:"numberOfWinners,omitempty"`
EachWayDivisor *float64 `json:"eachWayDivisor,omitempty"`
}
type RunnerID struct {
MarketID *string `json:"marketId,omitempty"`
SelectionID *int64 `json:"selectionId,omitempty"`
Handicap *float64 `json:"handicap,omitempty"`
}
type CurrentOrderSummaryReport struct {
CurrentOrders []CurrentOrderSummary `json:"currentOrders"`
MoreAvailable bool `json:"moreAvailable"`
}
type CurrentOrderSummary struct {
BetID string `json:"betId"`
MarketID string `json:"marketId"`
SelectionID int64 `json:"selectionId"`
Handicap float64 `json:"handicap"`
PriceSize PriceSize `json:"priceSize"`
BspLiability float64 `json:"bspLiability"`
Side ESide `json:"side"`
Status EOrderStatus `json:"status"`
PersistenceType EPersistenceType `json:"persistenceType"`
OrderType EOrderType `json:"orderType"`
PlacedDate Time `json:"placedDate"`
MatchedDate Time `json:"matchedDate"`
AveragePriceMatched *float64 `json:"averagePriceMatched,omitempty"`
SizeMatched *float64 `json:"sizeMatched,omitempty"`
SizeRemaining *float64 `json:"sizeRemaining,omitempty"`
SizeLapsed *float64 `json:"sizeLapsed,omitempty"`
SizeCancelled *float64 `json:"sizeCancelled,omitempty"`
SizeVoided *float64 `json:"sizeVoided,omitempty"`
RegulatorAuthCode *string `json:"regulatorAuthCode,omitempty"`
RegulatorCode *string `json:"regulatorCode,omitempty"`
CustomerOrderRef *string `json:"customerOrderRef,omitempty"`
CustomerStrategyRef *string `json:"customerStrategyRef,omitempty"`
}
type PlaceInstruction struct {
OrderType EOrderType `json:"orderType"`
SelectionID int64 `json:"selectionId"`
Handicap *float64 `json:"handicap,omitempty"`
Side ESide `json:"side"`
LimitOrder *LimitOrder `json:"limitOrder,omitempty"`
LimitOnCloseOrder *LimitOnCloseOrder `json:"limitOnCloseOrder,omitempty"`
MarketOnCloseOrder *MarketOnCloseOrder `json:"marketOnCloseOrder,omitempty"`
CustomerOrderRef *string `json:"customerOrderRef,omitempty"`
}
type PlaceExecutionReport struct {
CustomerRef *string `json:"customerRef,omitempty"`
Status EExecutionReportStatus `json:"status"`
ErrorCode *EExecutionReportErrorCode `json:"errorCode,omitempty"`
MarketID *string `json:"marketId,omitempty"`
InstructionReports []PlaceInstructionReport `json:"instructionReports,omitempty"`
}
type LimitOrder struct {
Size float64 `json:"size"`
Price float64 `json:"price"`
PersistenceType EPersistenceType `json:"persistenceType"`
TimeInForce *ETimeInForce `json:"timeInForce,omitempty"`
MinFillSize *float64 `json:"minFillSize,omitempty"`
BetTargetType *EBetTargetType `json:"betTargetType,omitempty"`
BetTargetSize *float64 `json:"betTargetSize,omitempty"`
}
type LimitOnCloseOrder struct {
Liability float64 `json:"liability"`
Price float64 `json:"price"`
}
type MarketOnCloseOrder struct {
Liability float64 `json:"liability"`
}
type PlaceInstructionReport struct {
Status EInstructionReportStatus `json:"status"`
ErrorCode *EInstructionReportErrorCode `json:"errorCode,omitempty"`
OrderStatus *EOrderStatus `json:"orderStatus,omitempty"`
Instruction PlaceInstruction `json:"instruction"`
BetID *string `json:"betId,omitempty"`
PlacedDate *Time `json:"placedDate,omitempty"`
AveragePriceMatched *float64 `json:"averagePriceMatched,omitempty"`
SizeMatched *float64 `json:"sizeMatched,omitempty"`
}
type CancelInstruction struct {
BetId string `json:"betId"`
SizeReduction *float64 `json:"sizeReduction,omitempty"`
}
type CancelExecutionReport struct {
CustomerRef *string `json:"customerRef,omitempty"`
Status EExecutionReportStatus `json:"status"`
ErrorCode *EExecutionReportErrorCode `json:"errorCode,omitempty"`
MarketID *string `json:"marketId,omitempty"`
InstructionReports []CancelInstructionReport `json:"instructionReports,omitempty"`
}
type ReplaceInstruction struct {
BetId string `json:"betId"`
NewPrice float64 `json:"newPrice"`
}
type ReplaceExecutionReport struct {
CustomerRef *string `json:"customerRef,omitempty"`
Status EExecutionReportStatus `json:"status"`
ErrorCode *EExecutionReportErrorCode `json:"errorCode,omitempty"`
MarketID *string `json:"marketId,omitempty"`
InstructionReports []ReplaceInstructionReport `json:"instructionReports,omitempty"`
}
type ReplaceInstructionReport struct {
Status EInstructionReportStatus `json:"status"`
ErrorCode *EInstructionReportErrorCode `json:"errorCode,omitempty"`
CancelInstructionReport *CancelInstructionReport `json:"cancelInstructionReport,omitempty"`
PlaceInstructionReport *PlaceInstructionReport `json:"placeInstructionReport,omitempty"`
}
type CancelInstructionReport struct {
Status EInstructionReportStatus `json:"status"`
ErrorCode *EInstructionReportErrorCode `json:"errorCode,omitempty"`
Instruction *CancelInstruction `json:"instruction,omitempty"`
SizeCancelled float64 `json:"sizeCancelled"`
CancelledDate *Time `json:"cancelledDate,omitempty"`
}
type UpdateInstruction struct {
BetId string `json:"betId"`
NewPersistenceType EPersistenceType `json:"newPersistenceType"`
}
type UpdateExecutionReport struct {
CustomerRef *string `json:"customerRef,omitempty"`
Status EExecutionReportStatus `json:"status"`
ErrorCode *EExecutionReportErrorCode `json:"errorCode,omitempty"`
MarketID *string `json:"marketId,omitempty"`
InstructionReports []UpdateInstructionReport `json:"instructionReports,omitempty"`
}
type UpdateInstructionReport struct {
Status EInstructionReportStatus `json:"status"`
ErrorCode *EInstructionReportErrorCode `json:"errorCode,omitempty"`
Instruction UpdateInstruction `json:"instruction"`
}
type PriceProjection struct {
PriceData []EPriceData `json:"priceData,omitempty"`
EXBestOffersOverrides *EXBestOffersOverrides `json:"exBestOffersOverrides,omitempty"`
Virtualise *bool `json:"virtualise,omitempty"`
RolloverStakes *bool `json:"rolloverStakes,omitempty"`
}
type EXBestOffersOverrides struct {
BestPricesDepth *int `json:"bestPricesDepth,omitempty"`
RollupModel *ERollupModel `json:"rollupModel,omitempty"`
RollupLimit *int `json:"rollupLimit,omitempty"`
RollupLiabilityThreshold *float64 `json:"rollupLiabilityThreshold,omitempty"`
RollupLiabilityFactor *int `json:"rollupLiabilityFactor,omitempty"`
}
type MarketProfitAndLoss struct {
MarketID *string `json:"marketId,omitempty"`
CommissionApplied *float64 `json:"commissionApplied,omitempty"`
ProfitAndLosses []RunnerProfitAndLoss `json:"profitAndLosses,omitempty"`
}
type RunnerProfitAndLoss struct {
SelectionID *int64 `json:"selectionId,omitempty"`
IfWin *float64 `json:"ifWin,omitempty"`
IfLose *float64 `json:"ifLose,omitempty"`
IfPlace *float64 `json:"ifPlace,omitempty"`
}
type PriceLadderDescription struct {
Type *EPriceLadderType `json:"type,omitempty"`
}
type KeyLineSelection struct {
SelectionID *int64 `json:"selectionId,omitempty"`
Handicap *float64 `json:"handicap,omitempty"`
}
type KeyLineDescription struct {
KeyLine []KeyLineSelection `json:"keyLine,omitempty"`
}