forked from thrasher-corp/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cfutures_types.go
650 lines (602 loc) · 25.5 KB
/
cfutures_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
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
package binance
import (
"time"
"github.com/thrasher-corp/gocryptotrader/currency"
"github.com/thrasher-corp/gocryptotrader/exchanges/order"
)
// Response holds basic binance api response data
type Response struct {
Code int `json:"code"`
Msg string `json:"msg"`
}
// FuturesPublicTradesData stores recent public trades for futures
type FuturesPublicTradesData struct {
ID int64 `json:"id"`
Price float64 `json:"price,string"`
Qty float64 `json:"qty,string"`
QuoteQty float64 `json:"quoteQty,string"`
Time int64 `json:"time"`
IsBuyerMaker bool `json:"isBuyerMaker"`
}
// CompressedTradesData stores futures trades data in a compressed format
type CompressedTradesData struct {
TradeID int64 `json:"a"`
Price float64 `json:"p"`
Quantity float64 `json:"q"`
FirstTradeID int64 `json:"f"`
LastTradeID int64 `json:"l"`
Timestamp int64 `json:"t"`
BuyerMaker bool `json:"b"`
}
// MarkPriceData stores mark price data for futures
type MarkPriceData struct {
Symbol string `json:"symbol"`
MarkPrice float64 `json:"markPrice"`
LastFundingRate float64 `json:"lastFundingRate"`
NextFundingTime int64 `json:"nextFundingTime"`
Time int64 `json:"time"`
}
// SymbolPriceTicker stores ticker price stats
type SymbolPriceTicker struct {
Symbol string `json:"symbol"`
Price float64 `json:"price,string"`
Time int64 `json:"time"`
}
// SymbolOrderBookTicker stores orderbook ticker data
type SymbolOrderBookTicker struct {
Symbol string `json:"symbol"`
BidPrice float64 `json:"bidPrice,string"`
AskPrice float64 `json:"askPrice,string"`
BidQty float64 `json:"bidQty,string"`
AskQty float64 `json:"askQty,string"`
Time int64 `json:"time"`
}
// FuturesCandleStick holds kline data
type FuturesCandleStick struct {
OpenTime time.Time
Open float64
High float64
Low float64
Close float64
Volume float64
CloseTime time.Time
BaseAssetVolume float64
NumberOfTrades int64
TakerBuyVolume float64
TakerBuyBaseAssetVolume float64
}
// AllLiquidationOrders gets all liquidation orders
type AllLiquidationOrders struct {
Symbol string `json:"symbol"`
Price float64 `json:"price,string"`
OrigQty float64 `json:"origQty,string"`
ExecutedQty float64 `json:"executedQty,string"`
AveragePrice float64 `json:"averagePrice,string"`
Status string `json:"status"`
TimeInForce string `json:"timeInForce"`
OrderType string `json:"type"`
Side string `json:"side"`
Time int64 `json:"time"`
}
// OpenInterestData stores open interest data
type OpenInterestData struct {
Symbol string `json:"symbol"`
Pair string `json:"pair"`
OpenInterest float64 `json:"openInterest,string"`
ContractType string `json:"contractType"`
Time int64 `json:"time"`
}
// OpenInterestStats stores stats for open interest data
type OpenInterestStats struct {
Pair string `json:"pair"`
ContractType string `json:"contractType"`
SumOpenInterest float64 `json:"sumOpenInterest,string"`
SumOpenInterestValue float64 `json:"sumOpenInterestValue,string"`
Timestamp int64 `json:"timestamp"`
}
// TopTraderAccountRatio stores account ratio data for top traders
type TopTraderAccountRatio struct {
Pair string `json:"pair"`
LongShortRatio float64 `json:"longShortRatio,string"`
LongAccount float64 `json:"longAccount,string"`
ShortAccount float64 `json:"shortAccount,string"`
Timestamp int64 `json:"timestamp"`
}
// TopTraderPositionRatio stores position ratio for top trader accounts
type TopTraderPositionRatio struct {
Pair string `json:"pair"`
LongShortRatio float64 `json:"longShortRatio,string"`
LongPosition float64 `json:"longPosition,string"`
ShortPosition float64 `json:"shortPosition,string"`
Timestamp int64 `json:"timestamp"`
}
// GlobalLongShortRatio stores ratio data of all longs vs shorts
type GlobalLongShortRatio struct {
Symbol string `json:"symbol"`
LongShortRatio float64 `json:"longShortRatio"`
LongAccount float64 `json:"longAccount"`
ShortAccount float64 `json:"shortAccount"`
Timestamp string `json:"timestamp"`
}
// TakerBuySellVolume stores taker buy sell volume
type TakerBuySellVolume struct {
Pair string `json:"pair"`
ContractType string `json:"contractType"`
TakerBuyVolume float64 `json:"takerBuyVol,string"`
BuySellRatio float64 `json:"takerSellVol,string"`
BuyVol float64 `json:"takerBuyVolValue,string"`
SellVol float64 `json:"takerSellVolValue,string"`
Timestamp int64 `json:"timestamp"`
}
// FuturesBasisData gets futures basis data
type FuturesBasisData struct {
Pair string `json:"pair"`
ContractType string `json:"contractType"`
FuturesPrice float64 `json:"futuresPrice,string"`
IndexPrice float64 `json:"indexPrice,string"`
Basis float64 `json:"basis,string"`
BasisRate float64 `json:"basisRate,string"`
Timestamp int64 `json:"timestamp"`
}
// PlaceBatchOrderData stores batch order data for placing
type PlaceBatchOrderData struct {
Symbol string `json:"symbol"`
Side string `json:"side"`
PositionSide string `json:"positionSide,omitempty"`
OrderType string `json:"type"`
TimeInForce string `json:"timeInForce,omitempty"`
Quantity float64 `json:"quantity"`
ReduceOnly string `json:"reduceOnly,omitempty"`
Price float64 `json:"price"`
NewClientOrderID string `json:"newClientOrderId,omitempty"`
StopPrice float64 `json:"stopPrice,omitempty"`
ActivationPrice float64 `json:"activationPrice,omitempty"`
CallbackRate float64 `json:"callbackRate,omitempty"`
WorkingType string `json:"workingType,omitempty"`
PriceProtect string `json:"priceProtect,omitempty"`
NewOrderRespType string `json:"newOrderRespType,omitempty"`
}
// BatchCancelOrderData stores batch cancel order data
type BatchCancelOrderData struct {
ClientOrderID string `json:"clientOrderID"`
CumQty float64 `json:"cumQty,string"`
CumBase float64 `json:"cumBase,string"`
ExecuteQty float64 `json:"executeQty,string"`
OrderID int64 `json:"orderID,string"`
AvgPrice float64 `json:"avgPrice,string"`
OrigQty float64 `json:"origQty,string"`
Price float64 `json:"price,string"`
ReduceOnly bool `json:"reduceOnly"`
Side string `json:"side"`
PositionSide string `json:"positionSide"`
Status string `json:"status"`
StopPrice int64 `json:"stopPrice"`
ClosePosition bool `json:"closePosition"`
Symbol string `json:"symbol"`
Pair string `json:"pair"`
TimeInForce string `json:"TimeInForce"`
OrderType string `json:"type"`
OrigType string `json:"origType"`
ActivatePrice float64 `json:"activatePrice,string"`
PriceRate float64 `json:"priceRate,string"`
UpdateTime int64 `json:"updateTime"`
WorkingType string `json:"workingType"`
PriceProtect bool `json:"priceProtect"`
Code int64 `json:"code"`
Msg string `json:"msg"`
}
// FuturesNewOrderRequest stores all the data needed to submit a
// delivery/coin-margined-futures order.
type FuturesNewOrderRequest struct {
Symbol currency.Pair
Side string
PositionSide string
OrderType string
TimeInForce RequestParamsTimeForceType
NewClientOrderID string
ClosePosition string
WorkingType string
NewOrderRespType string
Quantity float64
Price float64
StopPrice float64
ActivationPrice float64
CallbackRate float64
ReduceOnly bool
PriceProtect bool
}
// FuturesOrderPlaceData stores futures order data
type FuturesOrderPlaceData struct {
ClientOrderID string `json:"clientOrderId"`
CumQty float64 `json:"cumQty,string"`
CumBase float64 `json:"cumBase,string"`
ExecuteQty float64 `json:"executedQty,string"`
OrderID int64 `json:"orderId"`
AvgPrice float64 `json:"avgPrice,string"`
OrigQty float64 `json:"origQty,string"`
Price float64 `json:"price,string"`
ReduceOnly bool `json:"reduceOnly"`
Side string `json:"side"`
PositionSide string `json:"positionSide"`
Status string `json:"status"`
StopPrice float64 `json:"stopPrice,string"`
ClosePosition bool `json:"closePosition"`
Symbol string `json:"symbol"`
Pair string `json:"pair"`
TimeInForce string `json:"TimeInForce"`
OrderType string `json:"type"`
OrigType string `json:"origType"`
ActivatePrice float64 `json:"activatePrice,string"`
PriceRate float64 `json:"priceRate,string"`
UpdateTime int64 `json:"updateTime"`
WorkingType string `json:"workingType"`
PriceProtect bool `json:"priceProtect"`
}
// FuturesOrderGetData stores futures order data for get requests
type FuturesOrderGetData struct {
AveragePrice float64 `json:"avgPrice,string"`
ClientOrderID string `json:"clientOrderID"`
CumulativeQuantity float64 `json:"cumQty,string"`
CumulativeBase float64 `json:"cumBase,string"`
ExecutedQuantity float64 `json:"executedQty,string"`
OrderID int64 `json:"orderId"`
OriginalQuantity float64 `json:"origQty,string"`
OriginalType string `json:"origType"`
Price float64 `json:"price,string"`
ReduceOnly bool `json:"reduceOnly"`
Side string `json:"buy"`
PositionSide string `json:"positionSide"`
Status string `json:"status"`
StopPrice float64 `json:"stopPrice,string"`
ClosePosition bool `json:"closePosition"`
Symbol string `json:"symbol"`
Pair string `json:"pair"`
TimeInForce string `json:"timeInForce"`
OrderType string `json:"type"`
ActivatePrice float64 `json:"activatePrice,string"`
PriceRate float64 `json:"priceRate,string"`
Time time.Time `json:"time"`
UpdateTime time.Time `json:"updateTime"`
WorkingType string `json:"workingType"`
PriceProtect bool `json:"priceProtect"`
}
// FuturesOrderData stores order data for futures
type FuturesOrderData struct {
AvgPrice float64 `json:"avgPrice,string"`
ClientOrderID string `json:"clientOrderId"`
CumBase string `json:"cumBase"`
ExecutedQty float64 `json:"executedQty,string"`
OrderID int64 `json:"orderId"`
OrigQty float64 `json:"origQty,string"`
OrigType string `json:"origType"`
Price float64 `json:"price,string"`
ReduceOnly bool `json:"reduceOnly"`
Side string `json:"side"`
PositionSide string `json:"positionSide"`
Status string `json:"status"`
StopPrice float64 `json:"stopPrice,string"`
ClosePosition bool `json:"closePosition"`
Symbol string `json:"symbol"`
Pair string `json:"pair"`
Time time.Time `json:"time"`
TimeInForce string `json:"timeInForce"`
OrderType string `json:"type"`
ActivatePrice float64 `json:"activatePrice,string"`
PriceRate float64 `json:"priceRate,string"`
UpdateTime time.Time `json:"updateTime"`
WorkingType string `json:"workingType"`
PriceProtect bool `json:"priceProtect"`
}
// OrderVars stores side, status and type for any order/trade
type OrderVars struct {
Side order.Side
Status order.Status
OrderType order.Type
Fee float64
}
// AutoCancelAllOrdersData gives data of auto cancelling all open orders
type AutoCancelAllOrdersData struct {
Symbol string `json:"symbol"`
CountdownTime int64 `json:"countdownTime,string"`
}
// LevelDetail stores level detail data
type LevelDetail struct {
Level string `json:"level"`
MaxBorrowable float64 `json:"maxBorrowable,string"`
InterestRate float64 `json:"interestRate,string"`
}
// MarginInfoData stores margin info data
type MarginInfoData struct {
Data []struct {
MarginRatio string `json:"marginRatio"`
Base struct {
AssetName string `json:"assetName"`
LevelDetails []LevelDetail `json:"levelDetails"`
} `json:"base"`
Quote struct {
AssetName string `json:"assetName"`
LevelDetails []LevelDetail `json:"levelDetails"`
} `json:"quote"`
} `json:"data"`
}
// FuturesAccountBalanceData stores account balance data for futures
type FuturesAccountBalanceData struct {
AccountAlias string `json:"accountAlias"`
Asset string `json:"asset"`
Balance float64 `json:"balance,string"`
WithdrawAvailable float64 `json:"withdrawAvailable,string"`
CrossWalletBalance float64 `json:"crossWalletBalance,string"`
CrossUnPNL float64 `json:"crossUnPNL,string"`
AvailableBalance float64 `json:"availableBalance,string"`
UpdateTime int64 `json:"updateTime"`
}
// FuturesAccountInformationPositions holds account position data
type FuturesAccountInformationPositions struct {
Symbol string `json:"symbol"`
Amount float64 `json:"positionAmt,string"`
InitialMargin float64 `json:"initialMargin,string"`
MaintMargin float64 `json:"maintMargin,string"`
UnrealizedProfit float64 `json:"unrealizedProfit,string"`
PositionInitialMargin float64 `json:"positionInitialMargin,string"`
OpenOrderInitialMargin float64 `json:"openOrderInitialMargin,string"`
Leverage float64 `json:"leverage,string"`
Isolated bool `json:"isolated"`
PositionSide string `json:"positionSide"`
EntryPrice float64 `json:"entryPrice,string"`
MaxQty float64 `json:"maxQty,string"`
UpdateTime time.Time `json:"updateTime"`
NotionalValue float64 `json:"notionalValue,string"`
IsolatedWallet float64 `json:"isolatedWallet,string"`
}
// FuturesAccountInformation stores account information for futures account
type FuturesAccountInformation struct {
Assets []struct {
Asset string `json:"asset"`
WalletBalance float64 `json:"walletBalance,string"`
UnrealizedProfit float64 `json:"unrealizedProfit,string"`
MarginBalance float64 `json:"marginBalance,string"`
MaintMargin float64 `json:"maintMargin,string"`
InitialMargin float64 `json:"initialMargin,string"`
PositionInitialMargin float64 `json:"positionInitialMargin,string"`
OpenOrderInitialMargin float64 `json:"openOrderInitialMargin,string"`
MaxWithdrawAmount float64 `json:"maxWithdrawAmount,string"`
CrossWalletBalance float64 `json:"crossWalletBalance,string"`
CrossUnPNL float64 `json:"crossUnPnl,string"`
AvailableBalance float64 `json:"availableBalance,string"`
} `json:"assets"`
Positions []FuturesAccountInformationPositions `json:"positions"`
CanDeposit bool `json:"canDeposit"`
CanTrade bool `json:"canTrade"`
CanWithdraw bool `json:"canWithdraw"`
FeeTier int64 `json:"feeTier"`
UpdateTime time.Time `json:"updateTime"`
}
// GenericAuthResponse is a general data response for a post auth request
type GenericAuthResponse struct {
Code int64 `json:"code"`
Msg string `json:"msg"`
}
// FuturesLeverageData stores leverage data for futures
type FuturesLeverageData struct {
Leverage int64 `json:"leverage"`
MaxQty float64 `json:"maxQty,string"`
Symbol string `json:"symbol"`
}
// ModifyIsolatedMarginData stores margin modification data
type ModifyIsolatedMarginData struct {
Amount float64 `json:"amount"`
Code int64 `json:"code"`
Msg string `json:"msg"`
ModType string `json:"modType"`
}
// GetPositionMarginChangeHistoryData gets margin change history for positions
type GetPositionMarginChangeHistoryData struct {
Amount float64 `json:"amount"`
Asset string `json:"asset"`
Symbol string `json:"symbol"`
Timestamp int64 `json:"time"`
MarginChangeType int64 `json:"type"`
PositionSide string `json:"positionSide"`
}
// FuturesPositionInformation stores futures position info
type FuturesPositionInformation struct {
Symbol string `json:"symbol"`
PositionAmount float64 `json:"positionAmt,string"`
EntryPrice float64 `json:"entryPrice,string"`
MarkPrice float64 `json:"markPrice,string"`
UnrealizedProfit float64 `json:"unRealizedProfit,string"`
LiquidationPrice float64 `json:"liquidation,string"`
Leverage int64 `json:"leverage,string"`
MaxQty float64 `json:"maxQty,string"`
MarginType string `json:"marginType"`
IsolatedMargin float64 `json:"isolatedMargin,string"`
IsAutoAddMargin bool `json:"isAutoAddMargin,string"`
PositionSide string `json:"positionSide"`
}
// FuturesAccountTradeList stores account trade list data
type FuturesAccountTradeList struct {
Symbol string `json:"symbol"`
ID int64 `json:"id"`
OrderID int64 `json:"orderID"`
Pair string `json:"pair"`
Side string `json:"side"`
Price string `json:"price"`
Qty float64 `json:"qty"`
RealizedPNL float64 `json:"realizedPNL"`
MarginAsset string `json:"marginAsset"`
BaseQty float64 `json:"baseQty"`
Commission float64 `json:"commission"`
CommissionAsset string `json:"commissionAsset"`
Timestamp int64 `json:"timestamp"`
PositionSide string `json:"positionSide"`
Buyer bool `json:"buyer"`
Maker bool `json:"maker"`
}
// FuturesIncomeHistoryData stores futures income history data
type FuturesIncomeHistoryData struct {
Symbol string `json:"symbol"`
IncomeType string `json:"incomeType"`
Income float64 `json:"income,string"`
Asset string `json:"asset"`
Info string `json:"info"`
Timestamp int64 `json:"time"`
}
// NotionalBracketData stores notional bracket data
type NotionalBracketData struct {
Pair string `json:"pair"`
Brackets []struct {
Bracket int64 `json:"bracket"`
InitialLeverage float64 `json:"initialLeverage"`
QtyCap float64 `json:"qtyCap"`
QtylFloor float64 `json:"qtyFloor"`
MaintMarginRatio float64 `json:"maintMarginRatio"`
}
}
// ForcedOrdersData stores forced orders data
type ForcedOrdersData struct {
OrderID int64 `json:"orderId"`
Symbol string `json:"symbol"`
Status string `json:"status"`
ClientOrderID string `json:"clientOrderId"`
Price float64 `json:"price,string"`
AvgPrice float64 `json:"avgPrice,string"`
OrigQty float64 `json:"origQty,string"`
ExecutedQty float64 `json:"executedQty,string"`
CumQuote float64 `json:"cumQuote,string"`
TimeInForce string `json:"timeInForce"`
OrderType string `json:"orderType"`
ReduceOnly bool `json:"reduceOnly"`
ClosePosition bool `json:"closePosition"`
Side string `json:"side"`
PositionSide string `json:"positionSide"`
StopPrice float64 `json:"stopPrice,string"`
WorkingType string `json:"workingType"`
PriceProtect float64 `json:"priceProtect,string"`
OrigType string `json:"origType"`
Time int64 `json:"time"`
UpdateTime int64 `json:"updateTime"`
}
// ADLEstimateData stores data for ADL estimates
type ADLEstimateData struct {
Symbol string `json:"symbol"`
ADLQuantile struct {
Long float64 `json:"LONG"`
Short float64 `json:"SHORT"`
Hedge float64 `json:"HEDGE"`
} `json:"adlQuantile"`
}
// InterestHistoryData gets interest history data
type InterestHistoryData struct {
Asset string `json:"asset"`
Interest float64 `json:"interest"`
LendingType string `json:"lendingType"`
ProductName string `json:"productName"`
Time string `json:"time"`
}
// FundingRateData stores funding rates data
type FundingRateData struct {
Symbol string `json:"symbol"`
FundingRate float64 `json:"fundingRate,string"`
FundingTime int64 `json:"fundingTime"`
}
// SymbolsData stores perp futures' symbols
type SymbolsData struct {
Symbol string `json:"symbol"`
}
// PerpsExchangeInfo stores data for perps
type PerpsExchangeInfo struct {
Symbols []SymbolsData `json:"symbols"`
}
// UFuturesExchangeInfo stores exchange info for ufutures
type UFuturesExchangeInfo struct {
RateLimits []struct {
Interval string `json:"interval"`
IntervalNum int64 `json:"intervalNum"`
Limit int64 `json:"limit"`
RateLimitType string `json:"rateLimitType"`
} `json:"rateLimits"`
ServerTime int64 `json:"serverTime"`
Symbols []UFuturesSymbolInfo `json:"symbols"`
Timezone string `json:"timezone"`
}
// UFuturesSymbolInfo contains details of a currency symbol
// for a usdt margined future contract
type UFuturesSymbolInfo struct {
Symbol string `json:"symbol"`
Pair string `json:"pair"`
ContractType string `json:"contractType"`
DeliveryDate time.Time `json:"deliveryDate"`
OnboardDate time.Time `json:"onboardDate"`
Status string `json:"status"`
MaintenanceMarginPercent float64 `json:"maintMarginPercent,string"`
RequiredMarginPercent float64 `json:"requiredMarginPercent,string"`
BaseAsset string `json:"baseAsset"`
QuoteAsset string `json:"quoteAsset"`
MarginAsset string `json:"marginAsset"`
PricePrecision int64 `json:"pricePrecision"`
QuantityPrecision int64 `json:"quantityPrecision"`
BaseAssetPrecision int64 `json:"baseAssetPrecision"`
QuotePrecision int64 `json:"quotePrecision"`
UnderlyingType string `json:"underlyingType"`
UnderlyingSubType []string `json:"underlyingSubType"`
SettlePlan float64 `json:"settlePlan"`
TriggerProtect float64 `json:"triggerProtect,string"`
Filters []UFuturesExchangeInfoFilters `json:"filters"`
OrderTypes []string `json:"OrderType"`
TimeInForce []string `json:"timeInForce"`
LiquidationFee float64 `json:"liquidationFee,string"`
MarketTakeBound float64 `json:"marketTakeBound,string"`
}
type UFuturesExchangeInfoFilters struct {
MinPrice float64 `json:"minPrice,string"`
MaxPrice float64 `json:"maxPrice,string"`
FilterType string `json:"filterType"`
TickSize float64 `json:"tickSize,string"`
StepSize float64 `json:"stepSize,string"`
MaxQty float64 `json:"maxQty,string"`
MinQty float64 `json:"minQty,string"`
Limit int64 `json:"limit"`
MultiplierDown float64 `json:"multiplierDown,string"`
MultiplierUp float64 `json:"multiplierUp,string"`
MultiplierDecimal float64 `json:"multiplierDecimal,string"`
Notional float64 `json:"notional,string"`
}
// CExchangeInfo stores exchange info for cfutures
type CExchangeInfo struct {
ExchangeFilters []interface{} `json:"exchangeFilters"`
RateLimits []struct {
Interval string `json:"interval"`
IntervalNum int64 `json:"intervalNul"`
Limit int64 `json:"limit"`
RateLimitType string `json:"rateLimitType"`
} `json:"rateLimits"`
ServerTime int64 `json:"serverTime"`
Symbols []struct {
Filters []UFuturesExchangeInfoFilters `json:"filters"`
OrderTypes []string `json:"orderType"`
TimeInForce []string `json:"timeInForce"`
Symbol string `json:"symbol"`
Pair string `json:"pair"`
ContractType string `json:"contractType"`
DeliveryDate int64 `json:"deliveryDate"`
OnboardDate int64 `json:"onboardDate"`
ContractStatus string `json:"contractStatus"`
ContractSize int64 `json:"contractSize"`
QuoteAsset string `json:"quoteAsset"`
BaseAsset string `json:"baseAsset"`
MarginAsset string `json:"marginAsset"`
PricePrecision int64 `json:"pricePrecision"`
QuantityPrecision int64 `json:"quantityPrecision"`
BaseAssetPrecision int64 `json:"baseAssetPrecision"`
QuotePrecision int64 `json:"quotePrecision"`
MaintMarginPercent float64 `json:"maintMarginPercent,string"`
RequiredMarginPercent float64 `json:"requiredMarginPercent,string"`
} `json:"symbols"`
Timezone string `json:"timezone"`
}
// CommissionRateData stores commission rate of account
type CommissionRateData struct {
Symbol string `json:"symbol"`
MakerCommissionRate float64 `json:"makerCommissionRate"`
TakerCommissionRate float64 `json:"takerCommissionRate"`
}