forked from BitMEX/api-connectors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstrument.go
222 lines (123 loc) · 7.25 KB
/
instrument.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
/*
* BitMEX API
*
* ## REST API for the BitMEX Trading Platform [Changelog](/app/apiChangelog) #### Getting Started ##### Fetching Data All REST endpoints are documented below. You can try out any query right from this interface. Most table queries accept `count`, `start`, and `reverse` params. Set `reverse=true` to get rows newest-first. Additional documentation regarding filters, timestamps, and authentication is available in [the main API documentation](https://www.bitmex.com/app/restAPI). *All* table data is available via the [Websocket](/app/wsAPI). We highly recommend using the socket if you want to have the quickest possible data without being subject to ratelimits. ##### Return Types By default, all data is returned as JSON. Send `?_format=csv` to get CSV data or `?_format=xml` to get XML data. ##### Trade Data Queries *This is only a small subset of what is available, to get you started.* Fill in the parameters and click the `Try it out!` button to try any of these queries. * [Pricing Data](#!/Quote/Quote_get) * [Trade Data](#!/Trade/Trade_get) * [OrderBook Data](#!/OrderBook/OrderBook_getL2) * [Settlement Data](#!/Settlement/Settlement_get) * [Exchange Statistics](#!/Stats/Stats_history) Every function of the BitMEX.com platform is exposed here and documented. Many more functions are available. - ## All API Endpoints Click to expand a section.
*
* OpenAPI spec version: 1.2.0
* Contact: [email protected]
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package swagger
import (
"time"
)
type Instrument struct {
Symbol string `json:"symbol,omitempty"`
RootSymbol string `json:"rootSymbol,omitempty"`
State string `json:"state,omitempty"`
Typ string `json:"typ,omitempty"`
Listing time.Time `json:"listing,omitempty"`
Front time.Time `json:"front,omitempty"`
Expiry time.Time `json:"expiry,omitempty"`
Settle time.Time `json:"settle,omitempty"`
RelistInterval time.Time `json:"relistInterval,omitempty"`
InverseLeg string `json:"inverseLeg,omitempty"`
SellLeg string `json:"sellLeg,omitempty"`
BuyLeg string `json:"buyLeg,omitempty"`
PositionCurrency string `json:"positionCurrency,omitempty"`
Underlying string `json:"underlying,omitempty"`
QuoteCurrency string `json:"quoteCurrency,omitempty"`
UnderlyingSymbol string `json:"underlyingSymbol,omitempty"`
Reference string `json:"reference,omitempty"`
ReferenceSymbol string `json:"referenceSymbol,omitempty"`
CalcInterval time.Time `json:"calcInterval,omitempty"`
PublishInterval time.Time `json:"publishInterval,omitempty"`
PublishTime time.Time `json:"publishTime,omitempty"`
MaxOrderQty float32 `json:"maxOrderQty,omitempty"`
MaxPrice float64 `json:"maxPrice,omitempty"`
LotSize float32 `json:"lotSize,omitempty"`
TickSize float64 `json:"tickSize,omitempty"`
Multiplier float32 `json:"multiplier,omitempty"`
SettlCurrency string `json:"settlCurrency,omitempty"`
UnderlyingToPositionMultiplier float32 `json:"underlyingToPositionMultiplier,omitempty"`
UnderlyingToSettleMultiplier float32 `json:"underlyingToSettleMultiplier,omitempty"`
QuoteToSettleMultiplier float32 `json:"quoteToSettleMultiplier,omitempty"`
IsQuanto bool `json:"isQuanto,omitempty"`
IsInverse bool `json:"isInverse,omitempty"`
InitMargin float64 `json:"initMargin,omitempty"`
MaintMargin float64 `json:"maintMargin,omitempty"`
RiskLimit float32 `json:"riskLimit,omitempty"`
RiskStep float32 `json:"riskStep,omitempty"`
Limit float64 `json:"limit,omitempty"`
Capped bool `json:"capped,omitempty"`
Taxed bool `json:"taxed,omitempty"`
Deleverage bool `json:"deleverage,omitempty"`
MakerFee float64 `json:"makerFee,omitempty"`
TakerFee float64 `json:"takerFee,omitempty"`
SettlementFee float64 `json:"settlementFee,omitempty"`
InsuranceFee float64 `json:"insuranceFee,omitempty"`
FundingBaseSymbol string `json:"fundingBaseSymbol,omitempty"`
FundingQuoteSymbol string `json:"fundingQuoteSymbol,omitempty"`
FundingPremiumSymbol string `json:"fundingPremiumSymbol,omitempty"`
FundingTimestamp time.Time `json:"fundingTimestamp,omitempty"`
FundingInterval time.Time `json:"fundingInterval,omitempty"`
FundingRate float64 `json:"fundingRate,omitempty"`
IndicativeFundingRate float64 `json:"indicativeFundingRate,omitempty"`
RebalanceTimestamp time.Time `json:"rebalanceTimestamp,omitempty"`
RebalanceInterval time.Time `json:"rebalanceInterval,omitempty"`
OpeningTimestamp time.Time `json:"openingTimestamp,omitempty"`
ClosingTimestamp time.Time `json:"closingTimestamp,omitempty"`
SessionInterval time.Time `json:"sessionInterval,omitempty"`
PrevClosePrice float64 `json:"prevClosePrice,omitempty"`
LimitDownPrice float64 `json:"limitDownPrice,omitempty"`
LimitUpPrice float64 `json:"limitUpPrice,omitempty"`
BankruptLimitDownPrice float64 `json:"bankruptLimitDownPrice,omitempty"`
BankruptLimitUpPrice float64 `json:"bankruptLimitUpPrice,omitempty"`
PrevTotalVolume float32 `json:"prevTotalVolume,omitempty"`
TotalVolume float32 `json:"totalVolume,omitempty"`
Volume float32 `json:"volume,omitempty"`
Volume24h float32 `json:"volume24h,omitempty"`
PrevTotalTurnover float32 `json:"prevTotalTurnover,omitempty"`
TotalTurnover float32 `json:"totalTurnover,omitempty"`
Turnover float32 `json:"turnover,omitempty"`
Turnover24h float32 `json:"turnover24h,omitempty"`
PrevPrice24h float64 `json:"prevPrice24h,omitempty"`
Vwap float64 `json:"vwap,omitempty"`
HighPrice float64 `json:"highPrice,omitempty"`
LowPrice float64 `json:"lowPrice,omitempty"`
LastPrice float64 `json:"lastPrice,omitempty"`
LastPriceProtected float64 `json:"lastPriceProtected,omitempty"`
LastTickDirection string `json:"lastTickDirection,omitempty"`
LastChangePcnt float64 `json:"lastChangePcnt,omitempty"`
BidPrice float64 `json:"bidPrice,omitempty"`
MidPrice float64 `json:"midPrice,omitempty"`
AskPrice float64 `json:"askPrice,omitempty"`
ImpactBidPrice float64 `json:"impactBidPrice,omitempty"`
ImpactMidPrice float64 `json:"impactMidPrice,omitempty"`
ImpactAskPrice float64 `json:"impactAskPrice,omitempty"`
HasLiquidity bool `json:"hasLiquidity,omitempty"`
OpenInterest float32 `json:"openInterest,omitempty"`
OpenValue float32 `json:"openValue,omitempty"`
FairMethod string `json:"fairMethod,omitempty"`
FairBasisRate float64 `json:"fairBasisRate,omitempty"`
FairBasis float64 `json:"fairBasis,omitempty"`
FairPrice float64 `json:"fairPrice,omitempty"`
MarkMethod string `json:"markMethod,omitempty"`
MarkPrice float64 `json:"markPrice,omitempty"`
IndicativeTaxRate float64 `json:"indicativeTaxRate,omitempty"`
IndicativeSettlePrice float64 `json:"indicativeSettlePrice,omitempty"`
SettledPrice float64 `json:"settledPrice,omitempty"`
Timestamp time.Time `json:"timestamp,omitempty"`
}