forked from gateio/gateapi-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontract_stat.py
More file actions
487 lines (365 loc) · 14.6 KB
/
contract_stat.py
File metadata and controls
487 lines (365 loc) · 14.6 KB
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
# coding: utf-8
"""
Gate API
Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501
Contact: support@mail.gate.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from gate_api.configuration import Configuration
class ContractStat(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
openapi_types = {
'time': 'int',
'lsr_taker': 'float',
'lsr_account': 'float',
'long_liq_size': 'int',
'long_liq_amount': 'float',
'long_liq_usd': 'float',
'short_liq_size': 'int',
'short_liq_amount': 'float',
'short_liq_usd': 'float',
'open_interest': 'int',
'open_interest_usd': 'float',
'top_lsr_account': 'float',
'top_lsr_size': 'float',
'mark_price': 'float'
}
attribute_map = {
'time': 'time',
'lsr_taker': 'lsr_taker',
'lsr_account': 'lsr_account',
'long_liq_size': 'long_liq_size',
'long_liq_amount': 'long_liq_amount',
'long_liq_usd': 'long_liq_usd',
'short_liq_size': 'short_liq_size',
'short_liq_amount': 'short_liq_amount',
'short_liq_usd': 'short_liq_usd',
'open_interest': 'open_interest',
'open_interest_usd': 'open_interest_usd',
'top_lsr_account': 'top_lsr_account',
'top_lsr_size': 'top_lsr_size',
'mark_price': 'mark_price'
}
def __init__(self, time=None, lsr_taker=None, lsr_account=None, long_liq_size=None, long_liq_amount=None, long_liq_usd=None, short_liq_size=None, short_liq_amount=None, short_liq_usd=None, open_interest=None, open_interest_usd=None, top_lsr_account=None, top_lsr_size=None, mark_price=None, local_vars_configuration=None): # noqa: E501
# type: (int, float, float, int, float, float, int, float, float, int, float, float, float, float, Configuration) -> None
"""ContractStat - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self._time = None
self._lsr_taker = None
self._lsr_account = None
self._long_liq_size = None
self._long_liq_amount = None
self._long_liq_usd = None
self._short_liq_size = None
self._short_liq_amount = None
self._short_liq_usd = None
self._open_interest = None
self._open_interest_usd = None
self._top_lsr_account = None
self._top_lsr_size = None
self._mark_price = None
self.discriminator = None
if time is not None:
self.time = time
if lsr_taker is not None:
self.lsr_taker = lsr_taker
if lsr_account is not None:
self.lsr_account = lsr_account
if long_liq_size is not None:
self.long_liq_size = long_liq_size
if long_liq_amount is not None:
self.long_liq_amount = long_liq_amount
if long_liq_usd is not None:
self.long_liq_usd = long_liq_usd
if short_liq_size is not None:
self.short_liq_size = short_liq_size
if short_liq_amount is not None:
self.short_liq_amount = short_liq_amount
if short_liq_usd is not None:
self.short_liq_usd = short_liq_usd
if open_interest is not None:
self.open_interest = open_interest
if open_interest_usd is not None:
self.open_interest_usd = open_interest_usd
if top_lsr_account is not None:
self.top_lsr_account = top_lsr_account
if top_lsr_size is not None:
self.top_lsr_size = top_lsr_size
if mark_price is not None:
self.mark_price = mark_price
@property
def time(self):
"""Gets the time of this ContractStat. # noqa: E501
Stat timestamp # noqa: E501
:return: The time of this ContractStat. # noqa: E501
:rtype: int
"""
return self._time
@time.setter
def time(self, time):
"""Sets the time of this ContractStat.
Stat timestamp # noqa: E501
:param time: The time of this ContractStat. # noqa: E501
:type: int
"""
self._time = time
@property
def lsr_taker(self):
"""Gets the lsr_taker of this ContractStat. # noqa: E501
Long/short taker ratio # noqa: E501
:return: The lsr_taker of this ContractStat. # noqa: E501
:rtype: float
"""
return self._lsr_taker
@lsr_taker.setter
def lsr_taker(self, lsr_taker):
"""Sets the lsr_taker of this ContractStat.
Long/short taker ratio # noqa: E501
:param lsr_taker: The lsr_taker of this ContractStat. # noqa: E501
:type: float
"""
self._lsr_taker = lsr_taker
@property
def lsr_account(self):
"""Gets the lsr_account of this ContractStat. # noqa: E501
Long/short position user ratio # noqa: E501
:return: The lsr_account of this ContractStat. # noqa: E501
:rtype: float
"""
return self._lsr_account
@lsr_account.setter
def lsr_account(self, lsr_account):
"""Sets the lsr_account of this ContractStat.
Long/short position user ratio # noqa: E501
:param lsr_account: The lsr_account of this ContractStat. # noqa: E501
:type: float
"""
self._lsr_account = lsr_account
@property
def long_liq_size(self):
"""Gets the long_liq_size of this ContractStat. # noqa: E501
Long liquidation size (contracts) # noqa: E501
:return: The long_liq_size of this ContractStat. # noqa: E501
:rtype: int
"""
return self._long_liq_size
@long_liq_size.setter
def long_liq_size(self, long_liq_size):
"""Sets the long_liq_size of this ContractStat.
Long liquidation size (contracts) # noqa: E501
:param long_liq_size: The long_liq_size of this ContractStat. # noqa: E501
:type: int
"""
self._long_liq_size = long_liq_size
@property
def long_liq_amount(self):
"""Gets the long_liq_amount of this ContractStat. # noqa: E501
Long liquidation amount (base currency) # noqa: E501
:return: The long_liq_amount of this ContractStat. # noqa: E501
:rtype: float
"""
return self._long_liq_amount
@long_liq_amount.setter
def long_liq_amount(self, long_liq_amount):
"""Sets the long_liq_amount of this ContractStat.
Long liquidation amount (base currency) # noqa: E501
:param long_liq_amount: The long_liq_amount of this ContractStat. # noqa: E501
:type: float
"""
self._long_liq_amount = long_liq_amount
@property
def long_liq_usd(self):
"""Gets the long_liq_usd of this ContractStat. # noqa: E501
Long liquidation volume (quote currency) # noqa: E501
:return: The long_liq_usd of this ContractStat. # noqa: E501
:rtype: float
"""
return self._long_liq_usd
@long_liq_usd.setter
def long_liq_usd(self, long_liq_usd):
"""Sets the long_liq_usd of this ContractStat.
Long liquidation volume (quote currency) # noqa: E501
:param long_liq_usd: The long_liq_usd of this ContractStat. # noqa: E501
:type: float
"""
self._long_liq_usd = long_liq_usd
@property
def short_liq_size(self):
"""Gets the short_liq_size of this ContractStat. # noqa: E501
Short liquidation size (contracts) # noqa: E501
:return: The short_liq_size of this ContractStat. # noqa: E501
:rtype: int
"""
return self._short_liq_size
@short_liq_size.setter
def short_liq_size(self, short_liq_size):
"""Sets the short_liq_size of this ContractStat.
Short liquidation size (contracts) # noqa: E501
:param short_liq_size: The short_liq_size of this ContractStat. # noqa: E501
:type: int
"""
self._short_liq_size = short_liq_size
@property
def short_liq_amount(self):
"""Gets the short_liq_amount of this ContractStat. # noqa: E501
Short liquidation amount (base currency) # noqa: E501
:return: The short_liq_amount of this ContractStat. # noqa: E501
:rtype: float
"""
return self._short_liq_amount
@short_liq_amount.setter
def short_liq_amount(self, short_liq_amount):
"""Sets the short_liq_amount of this ContractStat.
Short liquidation amount (base currency) # noqa: E501
:param short_liq_amount: The short_liq_amount of this ContractStat. # noqa: E501
:type: float
"""
self._short_liq_amount = short_liq_amount
@property
def short_liq_usd(self):
"""Gets the short_liq_usd of this ContractStat. # noqa: E501
Short liquidation volume (quote currency) # noqa: E501
:return: The short_liq_usd of this ContractStat. # noqa: E501
:rtype: float
"""
return self._short_liq_usd
@short_liq_usd.setter
def short_liq_usd(self, short_liq_usd):
"""Sets the short_liq_usd of this ContractStat.
Short liquidation volume (quote currency) # noqa: E501
:param short_liq_usd: The short_liq_usd of this ContractStat. # noqa: E501
:type: float
"""
self._short_liq_usd = short_liq_usd
@property
def open_interest(self):
"""Gets the open_interest of this ContractStat. # noqa: E501
Total open interest size (contracts) # noqa: E501
:return: The open_interest of this ContractStat. # noqa: E501
:rtype: int
"""
return self._open_interest
@open_interest.setter
def open_interest(self, open_interest):
"""Sets the open_interest of this ContractStat.
Total open interest size (contracts) # noqa: E501
:param open_interest: The open_interest of this ContractStat. # noqa: E501
:type: int
"""
self._open_interest = open_interest
@property
def open_interest_usd(self):
"""Gets the open_interest_usd of this ContractStat. # noqa: E501
Total open interest volume (quote currency) # noqa: E501
:return: The open_interest_usd of this ContractStat. # noqa: E501
:rtype: float
"""
return self._open_interest_usd
@open_interest_usd.setter
def open_interest_usd(self, open_interest_usd):
"""Sets the open_interest_usd of this ContractStat.
Total open interest volume (quote currency) # noqa: E501
:param open_interest_usd: The open_interest_usd of this ContractStat. # noqa: E501
:type: float
"""
self._open_interest_usd = open_interest_usd
@property
def top_lsr_account(self):
"""Gets the top_lsr_account of this ContractStat. # noqa: E501
Top trader long/short account ratio # noqa: E501
:return: The top_lsr_account of this ContractStat. # noqa: E501
:rtype: float
"""
return self._top_lsr_account
@top_lsr_account.setter
def top_lsr_account(self, top_lsr_account):
"""Sets the top_lsr_account of this ContractStat.
Top trader long/short account ratio # noqa: E501
:param top_lsr_account: The top_lsr_account of this ContractStat. # noqa: E501
:type: float
"""
self._top_lsr_account = top_lsr_account
@property
def top_lsr_size(self):
"""Gets the top_lsr_size of this ContractStat. # noqa: E501
Top trader long/short position ratio # noqa: E501
:return: The top_lsr_size of this ContractStat. # noqa: E501
:rtype: float
"""
return self._top_lsr_size
@top_lsr_size.setter
def top_lsr_size(self, top_lsr_size):
"""Sets the top_lsr_size of this ContractStat.
Top trader long/short position ratio # noqa: E501
:param top_lsr_size: The top_lsr_size of this ContractStat. # noqa: E501
:type: float
"""
self._top_lsr_size = top_lsr_size
@property
def mark_price(self):
"""Gets the mark_price of this ContractStat. # noqa: E501
Mark price # noqa: E501
:return: The mark_price of this ContractStat. # noqa: E501
:rtype: float
"""
return self._mark_price
@mark_price.setter
def mark_price(self, mark_price):
"""Sets the mark_price of this ContractStat.
Mark price # noqa: E501
:param mark_price: The mark_price of this ContractStat. # noqa: E501
:type: float
"""
self._mark_price = mark_price
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, ContractStat):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, ContractStat):
return True
return self.to_dict() != other.to_dict()