天择加密量化开放框架下载
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.

618 lines
17 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 OptionsTicker(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. 'name': 'str',
  26. 'last_price': 'str',
  27. 'mark_price': 'str',
  28. 'index_price': 'str',
  29. 'ask1_size': 'int',
  30. 'ask1_price': 'str',
  31. 'bid1_size': 'int',
  32. 'bid1_price': 'str',
  33. 'position_size': 'int',
  34. 'mark_iv': 'str',
  35. 'bid_iv': 'str',
  36. 'ask_iv': 'str',
  37. 'leverage': 'str',
  38. 'delta': 'str',
  39. 'gamma': 'str',
  40. 'vega': 'str',
  41. 'theta': 'str',
  42. 'rho': 'str',
  43. }
  44. attribute_map = {
  45. 'name': 'name',
  46. 'last_price': 'last_price',
  47. 'mark_price': 'mark_price',
  48. 'index_price': 'index_price',
  49. 'ask1_size': 'ask1_size',
  50. 'ask1_price': 'ask1_price',
  51. 'bid1_size': 'bid1_size',
  52. 'bid1_price': 'bid1_price',
  53. 'position_size': 'position_size',
  54. 'mark_iv': 'mark_iv',
  55. 'bid_iv': 'bid_iv',
  56. 'ask_iv': 'ask_iv',
  57. 'leverage': 'leverage',
  58. 'delta': 'delta',
  59. 'gamma': 'gamma',
  60. 'vega': 'vega',
  61. 'theta': 'theta',
  62. 'rho': 'rho',
  63. }
  64. def __init__(
  65. self,
  66. name=None,
  67. last_price=None,
  68. mark_price=None,
  69. index_price=None,
  70. ask1_size=None,
  71. ask1_price=None,
  72. bid1_size=None,
  73. bid1_price=None,
  74. position_size=None,
  75. mark_iv=None,
  76. bid_iv=None,
  77. ask_iv=None,
  78. leverage=None,
  79. delta=None,
  80. gamma=None,
  81. vega=None,
  82. theta=None,
  83. rho=None,
  84. local_vars_configuration=None,
  85. ): # noqa: E501
  86. # type: (str, str, str, str, int, str, int, str, int, str, str, str, str, str, str, str, str, str, Configuration) -> None
  87. """OptionsTicker - a model defined in OpenAPI""" # noqa: E501
  88. if local_vars_configuration is None:
  89. local_vars_configuration = Configuration()
  90. self.local_vars_configuration = local_vars_configuration
  91. self._name = None
  92. self._last_price = None
  93. self._mark_price = None
  94. self._index_price = None
  95. self._ask1_size = None
  96. self._ask1_price = None
  97. self._bid1_size = None
  98. self._bid1_price = None
  99. self._position_size = None
  100. self._mark_iv = None
  101. self._bid_iv = None
  102. self._ask_iv = None
  103. self._leverage = None
  104. self._delta = None
  105. self._gamma = None
  106. self._vega = None
  107. self._theta = None
  108. self._rho = None
  109. self.discriminator = None
  110. if name is not None:
  111. self.name = name
  112. if last_price is not None:
  113. self.last_price = last_price
  114. if mark_price is not None:
  115. self.mark_price = mark_price
  116. if index_price is not None:
  117. self.index_price = index_price
  118. if ask1_size is not None:
  119. self.ask1_size = ask1_size
  120. if ask1_price is not None:
  121. self.ask1_price = ask1_price
  122. if bid1_size is not None:
  123. self.bid1_size = bid1_size
  124. if bid1_price is not None:
  125. self.bid1_price = bid1_price
  126. if position_size is not None:
  127. self.position_size = position_size
  128. if mark_iv is not None:
  129. self.mark_iv = mark_iv
  130. if bid_iv is not None:
  131. self.bid_iv = bid_iv
  132. if ask_iv is not None:
  133. self.ask_iv = ask_iv
  134. if leverage is not None:
  135. self.leverage = leverage
  136. if delta is not None:
  137. self.delta = delta
  138. if gamma is not None:
  139. self.gamma = gamma
  140. if vega is not None:
  141. self.vega = vega
  142. if theta is not None:
  143. self.theta = theta
  144. if rho is not None:
  145. self.rho = rho
  146. @property
  147. def name(self):
  148. """Gets the name of this OptionsTicker. # noqa: E501
  149. Options contract name # noqa: E501
  150. :return: The name of this OptionsTicker. # noqa: E501
  151. :rtype: str
  152. """
  153. return self._name
  154. @name.setter
  155. def name(self, name):
  156. """Sets the name of this OptionsTicker.
  157. Options contract name # noqa: E501
  158. :param name: The name of this OptionsTicker. # noqa: E501
  159. :type: str
  160. """
  161. self._name = name
  162. @property
  163. def last_price(self):
  164. """Gets the last_price of this OptionsTicker. # noqa: E501
  165. Last trading price (quote currency) # noqa: E501
  166. :return: The last_price of this OptionsTicker. # noqa: E501
  167. :rtype: str
  168. """
  169. return self._last_price
  170. @last_price.setter
  171. def last_price(self, last_price):
  172. """Sets the last_price of this OptionsTicker.
  173. Last trading price (quote currency) # noqa: E501
  174. :param last_price: The last_price of this OptionsTicker. # noqa: E501
  175. :type: str
  176. """
  177. self._last_price = last_price
  178. @property
  179. def mark_price(self):
  180. """Gets the mark_price of this OptionsTicker. # noqa: E501
  181. Current mark price (quote currency) # noqa: E501
  182. :return: The mark_price of this OptionsTicker. # noqa: E501
  183. :rtype: str
  184. """
  185. return self._mark_price
  186. @mark_price.setter
  187. def mark_price(self, mark_price):
  188. """Sets the mark_price of this OptionsTicker.
  189. Current mark price (quote currency) # noqa: E501
  190. :param mark_price: The mark_price of this OptionsTicker. # noqa: E501
  191. :type: str
  192. """
  193. self._mark_price = mark_price
  194. @property
  195. def index_price(self):
  196. """Gets the index_price of this OptionsTicker. # noqa: E501
  197. Current index price (quote currency) # noqa: E501
  198. :return: The index_price of this OptionsTicker. # noqa: E501
  199. :rtype: str
  200. """
  201. return self._index_price
  202. @index_price.setter
  203. def index_price(self, index_price):
  204. """Sets the index_price of this OptionsTicker.
  205. Current index price (quote currency) # noqa: E501
  206. :param index_price: The index_price of this OptionsTicker. # noqa: E501
  207. :type: str
  208. """
  209. self._index_price = index_price
  210. @property
  211. def ask1_size(self):
  212. """Gets the ask1_size of this OptionsTicker. # noqa: E501
  213. Best ask size # noqa: E501
  214. :return: The ask1_size of this OptionsTicker. # noqa: E501
  215. :rtype: int
  216. """
  217. return self._ask1_size
  218. @ask1_size.setter
  219. def ask1_size(self, ask1_size):
  220. """Sets the ask1_size of this OptionsTicker.
  221. Best ask size # noqa: E501
  222. :param ask1_size: The ask1_size of this OptionsTicker. # noqa: E501
  223. :type: int
  224. """
  225. self._ask1_size = ask1_size
  226. @property
  227. def ask1_price(self):
  228. """Gets the ask1_price of this OptionsTicker. # noqa: E501
  229. Best ask price # noqa: E501
  230. :return: The ask1_price of this OptionsTicker. # noqa: E501
  231. :rtype: str
  232. """
  233. return self._ask1_price
  234. @ask1_price.setter
  235. def ask1_price(self, ask1_price):
  236. """Sets the ask1_price of this OptionsTicker.
  237. Best ask price # noqa: E501
  238. :param ask1_price: The ask1_price of this OptionsTicker. # noqa: E501
  239. :type: str
  240. """
  241. self._ask1_price = ask1_price
  242. @property
  243. def bid1_size(self):
  244. """Gets the bid1_size of this OptionsTicker. # noqa: E501
  245. Best bid size # noqa: E501
  246. :return: The bid1_size of this OptionsTicker. # noqa: E501
  247. :rtype: int
  248. """
  249. return self._bid1_size
  250. @bid1_size.setter
  251. def bid1_size(self, bid1_size):
  252. """Sets the bid1_size of this OptionsTicker.
  253. Best bid size # noqa: E501
  254. :param bid1_size: The bid1_size of this OptionsTicker. # noqa: E501
  255. :type: int
  256. """
  257. self._bid1_size = bid1_size
  258. @property
  259. def bid1_price(self):
  260. """Gets the bid1_price of this OptionsTicker. # noqa: E501
  261. Best bid price # noqa: E501
  262. :return: The bid1_price of this OptionsTicker. # noqa: E501
  263. :rtype: str
  264. """
  265. return self._bid1_price
  266. @bid1_price.setter
  267. def bid1_price(self, bid1_price):
  268. """Sets the bid1_price of this OptionsTicker.
  269. Best bid price # noqa: E501
  270. :param bid1_price: The bid1_price of this OptionsTicker. # noqa: E501
  271. :type: str
  272. """
  273. self._bid1_price = bid1_price
  274. @property
  275. def position_size(self):
  276. """Gets the position_size of this OptionsTicker. # noqa: E501
  277. Current total long position size # noqa: E501
  278. :return: The position_size of this OptionsTicker. # noqa: E501
  279. :rtype: int
  280. """
  281. return self._position_size
  282. @position_size.setter
  283. def position_size(self, position_size):
  284. """Sets the position_size of this OptionsTicker.
  285. Current total long position size # noqa: E501
  286. :param position_size: The position_size of this OptionsTicker. # noqa: E501
  287. :type: int
  288. """
  289. self._position_size = position_size
  290. @property
  291. def mark_iv(self):
  292. """Gets the mark_iv of this OptionsTicker. # noqa: E501
  293. Implied volatility # noqa: E501
  294. :return: The mark_iv of this OptionsTicker. # noqa: E501
  295. :rtype: str
  296. """
  297. return self._mark_iv
  298. @mark_iv.setter
  299. def mark_iv(self, mark_iv):
  300. """Sets the mark_iv of this OptionsTicker.
  301. Implied volatility # noqa: E501
  302. :param mark_iv: The mark_iv of this OptionsTicker. # noqa: E501
  303. :type: str
  304. """
  305. self._mark_iv = mark_iv
  306. @property
  307. def bid_iv(self):
  308. """Gets the bid_iv of this OptionsTicker. # noqa: E501
  309. Bid side implied volatility # noqa: E501
  310. :return: The bid_iv of this OptionsTicker. # noqa: E501
  311. :rtype: str
  312. """
  313. return self._bid_iv
  314. @bid_iv.setter
  315. def bid_iv(self, bid_iv):
  316. """Sets the bid_iv of this OptionsTicker.
  317. Bid side implied volatility # noqa: E501
  318. :param bid_iv: The bid_iv of this OptionsTicker. # noqa: E501
  319. :type: str
  320. """
  321. self._bid_iv = bid_iv
  322. @property
  323. def ask_iv(self):
  324. """Gets the ask_iv of this OptionsTicker. # noqa: E501
  325. Ask side implied volatility # noqa: E501
  326. :return: The ask_iv of this OptionsTicker. # noqa: E501
  327. :rtype: str
  328. """
  329. return self._ask_iv
  330. @ask_iv.setter
  331. def ask_iv(self, ask_iv):
  332. """Sets the ask_iv of this OptionsTicker.
  333. Ask side implied volatility # noqa: E501
  334. :param ask_iv: The ask_iv of this OptionsTicker. # noqa: E501
  335. :type: str
  336. """
  337. self._ask_iv = ask_iv
  338. @property
  339. def leverage(self):
  340. """Gets the leverage of this OptionsTicker. # noqa: E501
  341. Current leverage. Formula: underlying_price / mark_price * delta # noqa: E501
  342. :return: The leverage of this OptionsTicker. # noqa: E501
  343. :rtype: str
  344. """
  345. return self._leverage
  346. @leverage.setter
  347. def leverage(self, leverage):
  348. """Sets the leverage of this OptionsTicker.
  349. Current leverage. Formula: underlying_price / mark_price * delta # noqa: E501
  350. :param leverage: The leverage of this OptionsTicker. # noqa: E501
  351. :type: str
  352. """
  353. self._leverage = leverage
  354. @property
  355. def delta(self):
  356. """Gets the delta of this OptionsTicker. # noqa: E501
  357. Delta # noqa: E501
  358. :return: The delta of this OptionsTicker. # noqa: E501
  359. :rtype: str
  360. """
  361. return self._delta
  362. @delta.setter
  363. def delta(self, delta):
  364. """Sets the delta of this OptionsTicker.
  365. Delta # noqa: E501
  366. :param delta: The delta of this OptionsTicker. # noqa: E501
  367. :type: str
  368. """
  369. self._delta = delta
  370. @property
  371. def gamma(self):
  372. """Gets the gamma of this OptionsTicker. # noqa: E501
  373. Gamma # noqa: E501
  374. :return: The gamma of this OptionsTicker. # noqa: E501
  375. :rtype: str
  376. """
  377. return self._gamma
  378. @gamma.setter
  379. def gamma(self, gamma):
  380. """Sets the gamma of this OptionsTicker.
  381. Gamma # noqa: E501
  382. :param gamma: The gamma of this OptionsTicker. # noqa: E501
  383. :type: str
  384. """
  385. self._gamma = gamma
  386. @property
  387. def vega(self):
  388. """Gets the vega of this OptionsTicker. # noqa: E501
  389. Vega # noqa: E501
  390. :return: The vega of this OptionsTicker. # noqa: E501
  391. :rtype: str
  392. """
  393. return self._vega
  394. @vega.setter
  395. def vega(self, vega):
  396. """Sets the vega of this OptionsTicker.
  397. Vega # noqa: E501
  398. :param vega: The vega of this OptionsTicker. # noqa: E501
  399. :type: str
  400. """
  401. self._vega = vega
  402. @property
  403. def theta(self):
  404. """Gets the theta of this OptionsTicker. # noqa: E501
  405. Theta # noqa: E501
  406. :return: The theta of this OptionsTicker. # noqa: E501
  407. :rtype: str
  408. """
  409. return self._theta
  410. @theta.setter
  411. def theta(self, theta):
  412. """Sets the theta of this OptionsTicker.
  413. Theta # noqa: E501
  414. :param theta: The theta of this OptionsTicker. # noqa: E501
  415. :type: str
  416. """
  417. self._theta = theta
  418. @property
  419. def rho(self):
  420. """Gets the rho of this OptionsTicker. # noqa: E501
  421. Rho # noqa: E501
  422. :return: The rho of this OptionsTicker. # noqa: E501
  423. :rtype: str
  424. """
  425. return self._rho
  426. @rho.setter
  427. def rho(self, rho):
  428. """Sets the rho of this OptionsTicker.
  429. Rho # noqa: E501
  430. :param rho: The rho of this OptionsTicker. # noqa: E501
  431. :type: str
  432. """
  433. self._rho = rho
  434. def to_dict(self):
  435. """Returns the model properties as a dict"""
  436. result = {}
  437. for attr, _ in six.iteritems(self.openapi_types):
  438. value = getattr(self, attr)
  439. if isinstance(value, list):
  440. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  441. elif hasattr(value, "to_dict"):
  442. result[attr] = value.to_dict()
  443. elif isinstance(value, dict):
  444. result[attr] = dict(
  445. map(
  446. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  447. value.items(),
  448. )
  449. )
  450. else:
  451. result[attr] = value
  452. return result
  453. def to_str(self):
  454. """Returns the string representation of the model"""
  455. return pprint.pformat(self.to_dict())
  456. def __repr__(self):
  457. """For `print` and `pprint`"""
  458. return self.to_str()
  459. def __eq__(self, other):
  460. """Returns true if both objects are equal"""
  461. if not isinstance(other, OptionsTicker):
  462. return False
  463. return self.to_dict() == other.to_dict()
  464. def __ne__(self, other):
  465. """Returns true if both objects are not equal"""
  466. if not isinstance(other, OptionsTicker):
  467. return True
  468. return self.to_dict() != other.to_dict()