天择加密量化开放框架下载
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

473 lines
14 KiB

1 year ago
  1. # coding: utf-8
  2. """
  3. Gate API v4
  4. Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501
  5. Contact: support@mail.gate.io
  6. Generated by: https://openapi-generator.tech
  7. """
  8. import pprint
  9. import re # noqa: F401
  10. import six
  11. from gate_api.configuration import Configuration
  12. class ContractStat(object):
  13. """NOTE: This class is auto generated by OpenAPI Generator.
  14. Ref: https://openapi-generator.tech
  15. Do not edit the class manually.
  16. """
  17. """
  18. Attributes:
  19. openapi_types (dict): The key is attribute name
  20. and the value is attribute type.
  21. attribute_map (dict): The key is attribute name
  22. and the value is json key in definition.
  23. """
  24. openapi_types = {
  25. 'time': 'int',
  26. 'lsr_taker': 'float',
  27. 'lsr_account': 'float',
  28. 'long_liq_size': 'int',
  29. 'long_liq_amount': 'float',
  30. 'long_liq_usd': 'float',
  31. 'short_liq_size': 'int',
  32. 'short_liq_amount': 'float',
  33. 'short_liq_usd': 'float',
  34. 'open_interest': 'int',
  35. 'open_interest_usd': 'float',
  36. 'top_lsr_account': 'float',
  37. 'top_lsr_size': 'float',
  38. }
  39. attribute_map = {
  40. 'time': 'time',
  41. 'lsr_taker': 'lsr_taker',
  42. 'lsr_account': 'lsr_account',
  43. 'long_liq_size': 'long_liq_size',
  44. 'long_liq_amount': 'long_liq_amount',
  45. 'long_liq_usd': 'long_liq_usd',
  46. 'short_liq_size': 'short_liq_size',
  47. 'short_liq_amount': 'short_liq_amount',
  48. 'short_liq_usd': 'short_liq_usd',
  49. 'open_interest': 'open_interest',
  50. 'open_interest_usd': 'open_interest_usd',
  51. 'top_lsr_account': 'top_lsr_account',
  52. 'top_lsr_size': 'top_lsr_size',
  53. }
  54. def __init__(
  55. self,
  56. time=None,
  57. lsr_taker=None,
  58. lsr_account=None,
  59. long_liq_size=None,
  60. long_liq_amount=None,
  61. long_liq_usd=None,
  62. short_liq_size=None,
  63. short_liq_amount=None,
  64. short_liq_usd=None,
  65. open_interest=None,
  66. open_interest_usd=None,
  67. top_lsr_account=None,
  68. top_lsr_size=None,
  69. local_vars_configuration=None,
  70. ): # noqa: E501
  71. # type: (int, float, float, int, float, float, int, float, float, int, float, float, float, Configuration) -> None
  72. """ContractStat - a model defined in OpenAPI""" # noqa: E501
  73. if local_vars_configuration is None:
  74. local_vars_configuration = Configuration()
  75. self.local_vars_configuration = local_vars_configuration
  76. self._time = None
  77. self._lsr_taker = None
  78. self._lsr_account = None
  79. self._long_liq_size = None
  80. self._long_liq_amount = None
  81. self._long_liq_usd = None
  82. self._short_liq_size = None
  83. self._short_liq_amount = None
  84. self._short_liq_usd = None
  85. self._open_interest = None
  86. self._open_interest_usd = None
  87. self._top_lsr_account = None
  88. self._top_lsr_size = None
  89. self.discriminator = None
  90. if time is not None:
  91. self.time = time
  92. if lsr_taker is not None:
  93. self.lsr_taker = lsr_taker
  94. if lsr_account is not None:
  95. self.lsr_account = lsr_account
  96. if long_liq_size is not None:
  97. self.long_liq_size = long_liq_size
  98. if long_liq_amount is not None:
  99. self.long_liq_amount = long_liq_amount
  100. if long_liq_usd is not None:
  101. self.long_liq_usd = long_liq_usd
  102. if short_liq_size is not None:
  103. self.short_liq_size = short_liq_size
  104. if short_liq_amount is not None:
  105. self.short_liq_amount = short_liq_amount
  106. if short_liq_usd is not None:
  107. self.short_liq_usd = short_liq_usd
  108. if open_interest is not None:
  109. self.open_interest = open_interest
  110. if open_interest_usd is not None:
  111. self.open_interest_usd = open_interest_usd
  112. if top_lsr_account is not None:
  113. self.top_lsr_account = top_lsr_account
  114. if top_lsr_size is not None:
  115. self.top_lsr_size = top_lsr_size
  116. @property
  117. def time(self):
  118. """Gets the time of this ContractStat. # noqa: E501
  119. Stat timestamp # noqa: E501
  120. :return: The time of this ContractStat. # noqa: E501
  121. :rtype: int
  122. """
  123. return self._time
  124. @time.setter
  125. def time(self, time):
  126. """Sets the time of this ContractStat.
  127. Stat timestamp # noqa: E501
  128. :param time: The time of this ContractStat. # noqa: E501
  129. :type: int
  130. """
  131. self._time = time
  132. @property
  133. def lsr_taker(self):
  134. """Gets the lsr_taker of this ContractStat. # noqa: E501
  135. Long/short account number ratio # noqa: E501
  136. :return: The lsr_taker of this ContractStat. # noqa: E501
  137. :rtype: float
  138. """
  139. return self._lsr_taker
  140. @lsr_taker.setter
  141. def lsr_taker(self, lsr_taker):
  142. """Sets the lsr_taker of this ContractStat.
  143. Long/short account number ratio # noqa: E501
  144. :param lsr_taker: The lsr_taker of this ContractStat. # noqa: E501
  145. :type: float
  146. """
  147. self._lsr_taker = lsr_taker
  148. @property
  149. def lsr_account(self):
  150. """Gets the lsr_account of this ContractStat. # noqa: E501
  151. Long/short taker size ratio # noqa: E501
  152. :return: The lsr_account of this ContractStat. # noqa: E501
  153. :rtype: float
  154. """
  155. return self._lsr_account
  156. @lsr_account.setter
  157. def lsr_account(self, lsr_account):
  158. """Sets the lsr_account of this ContractStat.
  159. Long/short taker size ratio # noqa: E501
  160. :param lsr_account: The lsr_account of this ContractStat. # noqa: E501
  161. :type: float
  162. """
  163. self._lsr_account = lsr_account
  164. @property
  165. def long_liq_size(self):
  166. """Gets the long_liq_size of this ContractStat. # noqa: E501
  167. Long liquidation size # noqa: E501
  168. :return: The long_liq_size of this ContractStat. # noqa: E501
  169. :rtype: int
  170. """
  171. return self._long_liq_size
  172. @long_liq_size.setter
  173. def long_liq_size(self, long_liq_size):
  174. """Sets the long_liq_size of this ContractStat.
  175. Long liquidation size # noqa: E501
  176. :param long_liq_size: The long_liq_size of this ContractStat. # noqa: E501
  177. :type: int
  178. """
  179. self._long_liq_size = long_liq_size
  180. @property
  181. def long_liq_amount(self):
  182. """Gets the long_liq_amount of this ContractStat. # noqa: E501
  183. Long liquidation amount(base currency) # noqa: E501
  184. :return: The long_liq_amount of this ContractStat. # noqa: E501
  185. :rtype: float
  186. """
  187. return self._long_liq_amount
  188. @long_liq_amount.setter
  189. def long_liq_amount(self, long_liq_amount):
  190. """Sets the long_liq_amount of this ContractStat.
  191. Long liquidation amount(base currency) # noqa: E501
  192. :param long_liq_amount: The long_liq_amount of this ContractStat. # noqa: E501
  193. :type: float
  194. """
  195. self._long_liq_amount = long_liq_amount
  196. @property
  197. def long_liq_usd(self):
  198. """Gets the long_liq_usd of this ContractStat. # noqa: E501
  199. Long liquidation volume(quote currency) # noqa: E501
  200. :return: The long_liq_usd of this ContractStat. # noqa: E501
  201. :rtype: float
  202. """
  203. return self._long_liq_usd
  204. @long_liq_usd.setter
  205. def long_liq_usd(self, long_liq_usd):
  206. """Sets the long_liq_usd of this ContractStat.
  207. Long liquidation volume(quote currency) # noqa: E501
  208. :param long_liq_usd: The long_liq_usd of this ContractStat. # noqa: E501
  209. :type: float
  210. """
  211. self._long_liq_usd = long_liq_usd
  212. @property
  213. def short_liq_size(self):
  214. """Gets the short_liq_size of this ContractStat. # noqa: E501
  215. Short liquidation size # noqa: E501
  216. :return: The short_liq_size of this ContractStat. # noqa: E501
  217. :rtype: int
  218. """
  219. return self._short_liq_size
  220. @short_liq_size.setter
  221. def short_liq_size(self, short_liq_size):
  222. """Sets the short_liq_size of this ContractStat.
  223. Short liquidation size # noqa: E501
  224. :param short_liq_size: The short_liq_size of this ContractStat. # noqa: E501
  225. :type: int
  226. """
  227. self._short_liq_size = short_liq_size
  228. @property
  229. def short_liq_amount(self):
  230. """Gets the short_liq_amount of this ContractStat. # noqa: E501
  231. Short liquidation amount(base currency) # noqa: E501
  232. :return: The short_liq_amount of this ContractStat. # noqa: E501
  233. :rtype: float
  234. """
  235. return self._short_liq_amount
  236. @short_liq_amount.setter
  237. def short_liq_amount(self, short_liq_amount):
  238. """Sets the short_liq_amount of this ContractStat.
  239. Short liquidation amount(base currency) # noqa: E501
  240. :param short_liq_amount: The short_liq_amount of this ContractStat. # noqa: E501
  241. :type: float
  242. """
  243. self._short_liq_amount = short_liq_amount
  244. @property
  245. def short_liq_usd(self):
  246. """Gets the short_liq_usd of this ContractStat. # noqa: E501
  247. Short liquidation volume(quote currency) # noqa: E501
  248. :return: The short_liq_usd of this ContractStat. # noqa: E501
  249. :rtype: float
  250. """
  251. return self._short_liq_usd
  252. @short_liq_usd.setter
  253. def short_liq_usd(self, short_liq_usd):
  254. """Sets the short_liq_usd of this ContractStat.
  255. Short liquidation volume(quote currency) # noqa: E501
  256. :param short_liq_usd: The short_liq_usd of this ContractStat. # noqa: E501
  257. :type: float
  258. """
  259. self._short_liq_usd = short_liq_usd
  260. @property
  261. def open_interest(self):
  262. """Gets the open_interest of this ContractStat. # noqa: E501
  263. Open interest size # noqa: E501
  264. :return: The open_interest of this ContractStat. # noqa: E501
  265. :rtype: int
  266. """
  267. return self._open_interest
  268. @open_interest.setter
  269. def open_interest(self, open_interest):
  270. """Sets the open_interest of this ContractStat.
  271. Open interest size # noqa: E501
  272. :param open_interest: The open_interest of this ContractStat. # noqa: E501
  273. :type: int
  274. """
  275. self._open_interest = open_interest
  276. @property
  277. def open_interest_usd(self):
  278. """Gets the open_interest_usd of this ContractStat. # noqa: E501
  279. Open interest volume(quote currency) # noqa: E501
  280. :return: The open_interest_usd of this ContractStat. # noqa: E501
  281. :rtype: float
  282. """
  283. return self._open_interest_usd
  284. @open_interest_usd.setter
  285. def open_interest_usd(self, open_interest_usd):
  286. """Sets the open_interest_usd of this ContractStat.
  287. Open interest volume(quote currency) # noqa: E501
  288. :param open_interest_usd: The open_interest_usd of this ContractStat. # noqa: E501
  289. :type: float
  290. """
  291. self._open_interest_usd = open_interest_usd
  292. @property
  293. def top_lsr_account(self):
  294. """Gets the top_lsr_account of this ContractStat. # noqa: E501
  295. Top trader long/short account ratio # noqa: E501
  296. :return: The top_lsr_account of this ContractStat. # noqa: E501
  297. :rtype: float
  298. """
  299. return self._top_lsr_account
  300. @top_lsr_account.setter
  301. def top_lsr_account(self, top_lsr_account):
  302. """Sets the top_lsr_account of this ContractStat.
  303. Top trader long/short account ratio # noqa: E501
  304. :param top_lsr_account: The top_lsr_account of this ContractStat. # noqa: E501
  305. :type: float
  306. """
  307. self._top_lsr_account = top_lsr_account
  308. @property
  309. def top_lsr_size(self):
  310. """Gets the top_lsr_size of this ContractStat. # noqa: E501
  311. Top trader long/short position ratio # noqa: E501
  312. :return: The top_lsr_size of this ContractStat. # noqa: E501
  313. :rtype: float
  314. """
  315. return self._top_lsr_size
  316. @top_lsr_size.setter
  317. def top_lsr_size(self, top_lsr_size):
  318. """Sets the top_lsr_size of this ContractStat.
  319. Top trader long/short position ratio # noqa: E501
  320. :param top_lsr_size: The top_lsr_size of this ContractStat. # noqa: E501
  321. :type: float
  322. """
  323. self._top_lsr_size = top_lsr_size
  324. def to_dict(self):
  325. """Returns the model properties as a dict"""
  326. result = {}
  327. for attr, _ in six.iteritems(self.openapi_types):
  328. value = getattr(self, attr)
  329. if isinstance(value, list):
  330. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  331. elif hasattr(value, "to_dict"):
  332. result[attr] = value.to_dict()
  333. elif isinstance(value, dict):
  334. result[attr] = dict(
  335. map(
  336. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  337. value.items(),
  338. )
  339. )
  340. else:
  341. result[attr] = value
  342. return result
  343. def to_str(self):
  344. """Returns the string representation of the model"""
  345. return pprint.pformat(self.to_dict())
  346. def __repr__(self):
  347. """For `print` and `pprint`"""
  348. return self.to_str()
  349. def __eq__(self, other):
  350. """Returns true if both objects are equal"""
  351. if not isinstance(other, ContractStat):
  352. return False
  353. return self.to_dict() == other.to_dict()
  354. def __ne__(self, other):
  355. """Returns true if both objects are not equal"""
  356. if not isinstance(other, ContractStat):
  357. return True
  358. return self.to_dict() != other.to_dict()