-
Notifications
You must be signed in to change notification settings - Fork 6
/
enum.go
315 lines (267 loc) · 10.4 KB
/
enum.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
// Enums Definitions (https://bybit-exchange.github.io/docs/v5/enum)
package bybitv5
// accountType (https://bybit-exchange.github.io/docs/v5/enum#accounttype)
type AccountType string
const (
AccountContract AccountType = "CONTRACT"
AccountSpot AccountType = "SPOT"
AccountInvestment AccountType = "INVESTMENT"
AccountOption AccountType = "OPTION"
AccountUnified AccountType = "UNIFIED"
AccountFund AccountType = "FUND"
)
// category (https://bybit-exchange.github.io/docs/v5/enum#category)
type Category string
const (
Spot Category = "spot"
Linear Category = "linear"
Inverse Category = "inverse"
Option Category = "option"
)
// interval (https://bybit-exchange.github.io/docs/v5/enum#interval)
//
// 1 - 1 minute
// 3 - 3 minutes
// 5 - 5 minutes
// 15 - 15 minutes
// 30 - 30 minutes
// 60 - 1 hour
// 120 - 2 hours
// 240 - 4 hours
// 360 - 6 hours
// 720 - 12 hours
// D - 1 day
// W - 1 week
// M - 1 month
type Interval string
const (
Interval1m Interval = "1"
Interval3m Interval = "3"
Interval5m Interval = "5"
Interval15m Interval = "15"
Interval30m Interval = "30"
Interval1h Interval = "60"
Interval2h Interval = "120"
Interval4h Interval = "240"
Interval6h Interval = "360"
Interval12h Interval = "720"
Interval1d Interval = "D"
Interval1w Interval = "W"
Interval1M Interval = "M"
)
type IntervalTime string
const (
IntervalTime5min IntervalTime = "5min"
IntervalTime15min IntervalTime = "15min"
IntervalTime30min IntervalTime = "30min"
IntervalTime1h IntervalTime = "1h"
IntervalTime4h IntervalTime = "4h"
IntervalTime1d IntervalTime = "1d"
)
// period (https://bybit-exchange.github.io/docs/v5/enum#period)
type Period int
const (
Period7days Period = 7
Period14days Period = 14
Period21days Period = 21
Period30days Period = 30
Period60days Period = 60
Period90days Period = 90
Period180days Period = 180
Period270days Period = 270
)
// contractType (https://bybit-exchange.github.io/docs/v5/enum#contracttype)
type ContractType string
const (
InversePerpetual ContractType = "InversePerpetual"
LinearPerpetual ContractType = "LinearPerpetual"
LinearFutures ContractType = "LinearFutures"
InverseFutures ContractType = "InverseFutures"
)
// status (https://bybit-exchange.github.io/docs/v5/enum#status)
type Status string
const (
StatusPreLaunch Status = "PreLaunch"
StatusTrading Status = "Trading"
StatusSettling Status = "Settling"
StatusDelivering Status = "Delivering"
StatusClosed Status = "Closed"
)
type Type string
const (
TypeTransferIn Type = "TRANSFER_IN"
TypeTransferOut Type = "TRANSFER_OUT"
TypeTrade Type = "TRADE"
TypeSettlement Type = "SETTLEMENT"
TypeDelivery Type = "DELIVERY"
TypeLiquidation Type = "LIQUIDATION"
TypeBonus Type = "BONUS"
TypeFeeRefund Type = "FEE_REFUND"
TypeInterest Type = "INTEREST"
TypeCurrencyBuy Type = "CURRENCY_BUY"
TypeCurrencySell Type = "CURRENCY_SELL"
TypeBorrowedAmountInsLoan Type = "BORROWED_AMOUNT_INS_LOAN"
TypePrincipleRepaymentInsLoan Type = "PRINCIPLE_REPAYMENT_INS_LOAN"
TypeInterestRepaymentInsLoan Type = "INTEREST_REPAYMENT_INS_LOAN"
TypeAutoSoldCollateralInsLoan Type = "AUTO_SOLD_COLLATERAL_INS_LOAN"
TypeAutoBuyLiabilityInsLoan Type = "AUTO_BUY_LIABILITY_INS_LOAN"
TypeAutoPrincipleRepaymentInsLoan Type = "AUTO_PRINCIPLE_REPAYMENT_INS_LOAN"
TypeAutoInterestRepaymentInsLoan Type = "AUTO_INTEREST_REPAYMENT_INS_LOAN"
)
// triggerBy (https://bybit-exchange.github.io/docs/v5/enum#triggerby)
type TriggerBy string
const (
TriggerByLastPrice TriggerBy = "LastPrice"
TriggerByIndexPrice TriggerBy = "IndexPrice"
TriggerByMarkPrice TriggerBy = "MarkPrice"
)
// timeInForce (https://bybit-exchange.github.io/docs/v5/enum#timeinforce)
type TimeInForce string
const (
GoodTillCancel TimeInForce = "GTC"
ImmediateOrCancel TimeInForce = "IOC"
FillOrKill TimeInForce = "FOK"
)
// smpType (https://bybit-exchange.github.io/docs/v5/enum#smptype)
type SmpType string
const (
SmpTypeNone SmpType = "None"
CancelMaker SmpType = "CancelMaker"
CancelTaker SmpType = "CancelTaker"
CancelBoth SmpType = "CancelBoth"
)
// positionIdx (https://bybit-exchange.github.io/docs/v5/enum#positionidx)
type PositionIdx int
const (
OneWayMode PositionIdx = 0
BuySideOfHedgeMode PositionIdx = 1
SellSideOfHedgeMode PositionIdx = 2
)
// orderStatus https://bybit-exchange.github.io/docs/v5/enum#orderstatus
type OrderStatus string
const (
OrderStatusCreated OrderStatus = "Created"
OrderStatusNew OrderStatus = "New"
OrderStatusRejected OrderStatus = "Rejected"
OrderStatusPartiallyFilled OrderStatus = "PartiallyFilled"
OrderStatusPartiallyFilledCanceled OrderStatus = "PartiallyFilledCanceled"
OrderStatusFilled OrderStatus = "Filled"
OrderStatusCancelled OrderStatus = "Cancelled"
OrderStatusUntriggered OrderStatus = "Untriggered"
OrderStatusTriggered OrderStatus = "Triggered"
OrderStatusDeactivated OrderStatus = "Deactivated"
OrderStatusActive OrderStatus = "Active"
)
// cancelType https://bybit-exchange.github.io/docs/v5/enum#canceltype
type CancelType string
const (
CancelByUser CancelType = "CancelByUser"
CancelByReduceOnly CancelType = "CancelByReduceOnly"
CancelByPrepareLiq CancelType = "CancelByPrepareLiq"
CancelByPrepareAdl CancelType = "CancelByPrepareAdl"
CancelByAdmin CancelType = "CancelByAdmin"
CancelByTpSlTsClear CancelType = "CancelByTpSlTsClear"
CancelByPzSideCh CancelType = "CancelByPzSideCh"
CancelBySmp CancelType = "CancelBySmp"
CancelAllBeforeLiq CancelType = "CancelAllBeforeLiq"
CancelAllBeforeAdl CancelType = "CancelAllBeforeAdl"
CancelBySettle CancelType = "CancelBySettle"
CancelByCannotAffordOrderCost CancelType = "CancelByCannotAffordOrderCost"
CancelByPmTrialMmOverEquity CancelType = "CancelByPmTrialMmOverEquity"
CancelByAccountBlocking CancelType = "CancelByAccountBlocking"
CancelByDelivery CancelType = "CancelByDelivery"
CancelByMmpTriggered CancelType = "CancelByMmpTriggered"
CancelByCrossSelfMuch CancelType = "CancelByCrossSelfMuch"
CancelByCrossReachMaxTradeNum CancelType = "CancelByCrossReachMaxTradeNum"
CancelByDCP CancelType = "CancelByDCP"
)
// rejectReason https://bybit-exchange.github.io/docs/v5/enum#rejectreason
type RejectReason string
const (
RejectNoError RejectReason = "EC_NoError"
RejectOthers RejectReason = "EC_Others"
RejectUnknownMessageType RejectReason = "EC_UnknownMessageType"
RejectMissingClOrdID RejectReason = "EC_MissingClOrdID"
RejectMissingOrigClOrdID RejectReason = "EC_MissingOrigClOrdID"
RejectClOrdIDOrigClOrdIDAreTheSame RejectReason = "EC_ClOrdIDOrigClOrdIDAreTheSame"
RejectDuplicatedClOrdID RejectReason = "EC_DuplicatedClOrdID"
RejectOrigClOrdIDDoesNotExist RejectReason = "EC_OrigClOrdIDDoesNotExist"
RejectTooLateToCancel RejectReason = "EC_TooLateToCancel"
RejectUnknownOrderType RejectReason = "EC_UnknownOrderType"
RejectUnknownSide RejectReason = "EC_UnknownSide"
RejectUnknownTimeInForce RejectReason = "EC_UnknownTimeInForce"
RejectWronglyRouted RejectReason = "EC_WronglyRouted"
RejectMarketOrderPriceIsNotZero RejectReason = "EC_MarketOrderPriceIsNotZero"
RejectLimitOrderInvalidPrice RejectReason = "EC_LimitOrderInvalidPrice"
RejectNoEnoughQtyToFill RejectReason = "EC_NoEnoughQtyToFill"
RejectNoImmediateQtyToFill RejectReason = "EC_NoImmediateQtyToFill"
RejectPerCancelRequest RejectReason = "EC_PerCancelRequest"
RejectMarketOrderCannotBePostOnly RejectReason = "EC_MarketOrderCannotBePostOnly"
RejectPostOnlyWillTakeLiquidity RejectReason = "EC_PostOnlyWillTakeLiquidity"
RejectCancelReplaceOrder RejectReason = "EC_CancelReplaceOrder"
RejectInvalidSymbolStatus RejectReason = "EC_InvalidSymbolStatus"
)
// stopOrderType https://bybit-exchange.github.io/docs/v5/enum#stopordertype
type StopOrderType string
const (
StopOrderTakeProfit StopOrderType = "TakeProfit"
StopOrderStopLoss StopOrderType = "StopLoss"
StopOrderTrailingStop StopOrderType = "TrailingStop"
StopOrderStop StopOrderType = "Stop"
StopOrderPartialTakeProfit StopOrderType = "PartialTakeProfit"
StopOrderPartialStopLoss StopOrderType = "PartialStopLoss"
StopOrderTpslOrder StopOrderType = "TpslOrder"
)
// positionStatus https://bybit-exchange.github.io/docs/v5/enum#positionstatus
type PositionStatus string
const (
PositionStatusNormal PositionStatus = "Normal"
PositionStatusLiq PositionStatus = "Liq"
PositionStatusAdl PositionStatus = "Adl"
)
// tickDirection https://bybit-exchange.github.io/docs/v5/enum#tickdirection
type TickDirection string
const (
TickPlus TickDirection = "PlusTick"
TickZeroPlus TickDirection = "ZeroPlusTick"
TickMinus TickDirection = "MinusTick"
TickZeroMinus TickDirection = "ZeroMinusTick"
)
// execType https://bybit-exchange.github.io/docs/v5/enum#exectype
type ExecType string
const (
ExecTrade ExecType = "Trade"
ExecAdlTrade ExecType = "AdlTrade"
ExecFunding ExecType = "Funding"
ExecBustTrade ExecType = "BustTrade"
ExecDelivery ExecType = "Delivery"
ExecBlockTrade ExecType = "BlockTrade"
)
// marginTrading https://bybit-exchange.github.io/docs/v5/enum#margintrading
type MarginTrading string
const (
MarginTradingNone MarginTrading = "none"
MarginTradingBoth MarginTrading = "both"
MarginTradingUtaOnly MarginTrading = "utaOnly"
MarginTradingNormalSpotOnly MarginTrading = "normalSpotOnly"
)
type Side string
const (
Buy Side = "Buy"
Sell Side = "Sell"
)
type OrderType string
const (
Limit OrderType = "Limit"
Market OrderType = "Market"
)
type TpSlMode string
const (
TpSlModeFull TpSlMode = "Full"
TpSlModePartial TpSlMode = "Partial"
)
type TradeMode int
const (
TradeCrossMargin TradeMode = 0
TradeIsolatedMargin TradeMode = 1
)