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

821 lines
25 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 OptionsContract(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. 'tag': 'str',
  27. 'create_time': 'float',
  28. 'expiration_time': 'float',
  29. 'is_call': 'bool',
  30. 'multiplier': 'str',
  31. 'underlying': 'str',
  32. 'underlying_price': 'str',
  33. 'last_price': 'str',
  34. 'mark_price': 'str',
  35. 'index_price': 'str',
  36. 'maker_fee_rate': 'str',
  37. 'taker_fee_rate': 'str',
  38. 'order_price_round': 'str',
  39. 'mark_price_round': 'str',
  40. 'order_size_min': 'int',
  41. 'order_size_max': 'int',
  42. 'order_price_deviate': 'str',
  43. 'ref_discount_rate': 'str',
  44. 'ref_rebate_rate': 'str',
  45. 'orderbook_id': 'int',
  46. 'trade_id': 'int',
  47. 'trade_size': 'int',
  48. 'position_size': 'int',
  49. 'orders_limit': 'int',
  50. }
  51. attribute_map = {
  52. 'name': 'name',
  53. 'tag': 'tag',
  54. 'create_time': 'create_time',
  55. 'expiration_time': 'expiration_time',
  56. 'is_call': 'is_call',
  57. 'multiplier': 'multiplier',
  58. 'underlying': 'underlying',
  59. 'underlying_price': 'underlying_price',
  60. 'last_price': 'last_price',
  61. 'mark_price': 'mark_price',
  62. 'index_price': 'index_price',
  63. 'maker_fee_rate': 'maker_fee_rate',
  64. 'taker_fee_rate': 'taker_fee_rate',
  65. 'order_price_round': 'order_price_round',
  66. 'mark_price_round': 'mark_price_round',
  67. 'order_size_min': 'order_size_min',
  68. 'order_size_max': 'order_size_max',
  69. 'order_price_deviate': 'order_price_deviate',
  70. 'ref_discount_rate': 'ref_discount_rate',
  71. 'ref_rebate_rate': 'ref_rebate_rate',
  72. 'orderbook_id': 'orderbook_id',
  73. 'trade_id': 'trade_id',
  74. 'trade_size': 'trade_size',
  75. 'position_size': 'position_size',
  76. 'orders_limit': 'orders_limit',
  77. }
  78. def __init__(
  79. self,
  80. name=None,
  81. tag=None,
  82. create_time=None,
  83. expiration_time=None,
  84. is_call=None,
  85. multiplier=None,
  86. underlying=None,
  87. underlying_price=None,
  88. last_price=None,
  89. mark_price=None,
  90. index_price=None,
  91. maker_fee_rate=None,
  92. taker_fee_rate=None,
  93. order_price_round=None,
  94. mark_price_round=None,
  95. order_size_min=None,
  96. order_size_max=None,
  97. order_price_deviate=None,
  98. ref_discount_rate=None,
  99. ref_rebate_rate=None,
  100. orderbook_id=None,
  101. trade_id=None,
  102. trade_size=None,
  103. position_size=None,
  104. orders_limit=None,
  105. local_vars_configuration=None,
  106. ): # noqa: E501
  107. # type: (str, str, float, float, bool, str, str, str, str, str, str, str, str, str, str, int, int, str, str, str, int, int, int, int, int, Configuration) -> None
  108. """OptionsContract - a model defined in OpenAPI""" # noqa: E501
  109. if local_vars_configuration is None:
  110. local_vars_configuration = Configuration()
  111. self.local_vars_configuration = local_vars_configuration
  112. self._name = None
  113. self._tag = None
  114. self._create_time = None
  115. self._expiration_time = None
  116. self._is_call = None
  117. self._multiplier = None
  118. self._underlying = None
  119. self._underlying_price = None
  120. self._last_price = None
  121. self._mark_price = None
  122. self._index_price = None
  123. self._maker_fee_rate = None
  124. self._taker_fee_rate = None
  125. self._order_price_round = None
  126. self._mark_price_round = None
  127. self._order_size_min = None
  128. self._order_size_max = None
  129. self._order_price_deviate = None
  130. self._ref_discount_rate = None
  131. self._ref_rebate_rate = None
  132. self._orderbook_id = None
  133. self._trade_id = None
  134. self._trade_size = None
  135. self._position_size = None
  136. self._orders_limit = None
  137. self.discriminator = None
  138. if name is not None:
  139. self.name = name
  140. if tag is not None:
  141. self.tag = tag
  142. if create_time is not None:
  143. self.create_time = create_time
  144. if expiration_time is not None:
  145. self.expiration_time = expiration_time
  146. if is_call is not None:
  147. self.is_call = is_call
  148. if multiplier is not None:
  149. self.multiplier = multiplier
  150. if underlying is not None:
  151. self.underlying = underlying
  152. if underlying_price is not None:
  153. self.underlying_price = underlying_price
  154. if last_price is not None:
  155. self.last_price = last_price
  156. if mark_price is not None:
  157. self.mark_price = mark_price
  158. if index_price is not None:
  159. self.index_price = index_price
  160. if maker_fee_rate is not None:
  161. self.maker_fee_rate = maker_fee_rate
  162. if taker_fee_rate is not None:
  163. self.taker_fee_rate = taker_fee_rate
  164. if order_price_round is not None:
  165. self.order_price_round = order_price_round
  166. if mark_price_round is not None:
  167. self.mark_price_round = mark_price_round
  168. if order_size_min is not None:
  169. self.order_size_min = order_size_min
  170. if order_size_max is not None:
  171. self.order_size_max = order_size_max
  172. if order_price_deviate is not None:
  173. self.order_price_deviate = order_price_deviate
  174. if ref_discount_rate is not None:
  175. self.ref_discount_rate = ref_discount_rate
  176. if ref_rebate_rate is not None:
  177. self.ref_rebate_rate = ref_rebate_rate
  178. if orderbook_id is not None:
  179. self.orderbook_id = orderbook_id
  180. if trade_id is not None:
  181. self.trade_id = trade_id
  182. if trade_size is not None:
  183. self.trade_size = trade_size
  184. if position_size is not None:
  185. self.position_size = position_size
  186. if orders_limit is not None:
  187. self.orders_limit = orders_limit
  188. @property
  189. def name(self):
  190. """Gets the name of this OptionsContract. # noqa: E501
  191. Options contract name # noqa: E501
  192. :return: The name of this OptionsContract. # noqa: E501
  193. :rtype: str
  194. """
  195. return self._name
  196. @name.setter
  197. def name(self, name):
  198. """Sets the name of this OptionsContract.
  199. Options contract name # noqa: E501
  200. :param name: The name of this OptionsContract. # noqa: E501
  201. :type: str
  202. """
  203. self._name = name
  204. @property
  205. def tag(self):
  206. """Gets the tag of this OptionsContract. # noqa: E501
  207. tag # noqa: E501
  208. :return: The tag of this OptionsContract. # noqa: E501
  209. :rtype: str
  210. """
  211. return self._tag
  212. @tag.setter
  213. def tag(self, tag):
  214. """Sets the tag of this OptionsContract.
  215. tag # noqa: E501
  216. :param tag: The tag of this OptionsContract. # noqa: E501
  217. :type: str
  218. """
  219. self._tag = tag
  220. @property
  221. def create_time(self):
  222. """Gets the create_time of this OptionsContract. # noqa: E501
  223. Creation time # noqa: E501
  224. :return: The create_time of this OptionsContract. # noqa: E501
  225. :rtype: float
  226. """
  227. return self._create_time
  228. @create_time.setter
  229. def create_time(self, create_time):
  230. """Sets the create_time of this OptionsContract.
  231. Creation time # noqa: E501
  232. :param create_time: The create_time of this OptionsContract. # noqa: E501
  233. :type: float
  234. """
  235. self._create_time = create_time
  236. @property
  237. def expiration_time(self):
  238. """Gets the expiration_time of this OptionsContract. # noqa: E501
  239. Expiration time # noqa: E501
  240. :return: The expiration_time of this OptionsContract. # noqa: E501
  241. :rtype: float
  242. """
  243. return self._expiration_time
  244. @expiration_time.setter
  245. def expiration_time(self, expiration_time):
  246. """Sets the expiration_time of this OptionsContract.
  247. Expiration time # noqa: E501
  248. :param expiration_time: The expiration_time of this OptionsContract. # noqa: E501
  249. :type: float
  250. """
  251. self._expiration_time = expiration_time
  252. @property
  253. def is_call(self):
  254. """Gets the is_call of this OptionsContract. # noqa: E501
  255. `true` means call options, while `false` is put options # noqa: E501
  256. :return: The is_call of this OptionsContract. # noqa: E501
  257. :rtype: bool
  258. """
  259. return self._is_call
  260. @is_call.setter
  261. def is_call(self, is_call):
  262. """Sets the is_call of this OptionsContract.
  263. `true` means call options, while `false` is put options # noqa: E501
  264. :param is_call: The is_call of this OptionsContract. # noqa: E501
  265. :type: bool
  266. """
  267. self._is_call = is_call
  268. @property
  269. def multiplier(self):
  270. """Gets the multiplier of this OptionsContract. # noqa: E501
  271. Multiplier used in converting from invoicing to settlement currency # noqa: E501
  272. :return: The multiplier of this OptionsContract. # noqa: E501
  273. :rtype: str
  274. """
  275. return self._multiplier
  276. @multiplier.setter
  277. def multiplier(self, multiplier):
  278. """Sets the multiplier of this OptionsContract.
  279. Multiplier used in converting from invoicing to settlement currency # noqa: E501
  280. :param multiplier: The multiplier of this OptionsContract. # noqa: E501
  281. :type: str
  282. """
  283. self._multiplier = multiplier
  284. @property
  285. def underlying(self):
  286. """Gets the underlying of this OptionsContract. # noqa: E501
  287. Underlying # noqa: E501
  288. :return: The underlying of this OptionsContract. # noqa: E501
  289. :rtype: str
  290. """
  291. return self._underlying
  292. @underlying.setter
  293. def underlying(self, underlying):
  294. """Sets the underlying of this OptionsContract.
  295. Underlying # noqa: E501
  296. :param underlying: The underlying of this OptionsContract. # noqa: E501
  297. :type: str
  298. """
  299. self._underlying = underlying
  300. @property
  301. def underlying_price(self):
  302. """Gets the underlying_price of this OptionsContract. # noqa: E501
  303. Underlying price (quote currency) # noqa: E501
  304. :return: The underlying_price of this OptionsContract. # noqa: E501
  305. :rtype: str
  306. """
  307. return self._underlying_price
  308. @underlying_price.setter
  309. def underlying_price(self, underlying_price):
  310. """Sets the underlying_price of this OptionsContract.
  311. Underlying price (quote currency) # noqa: E501
  312. :param underlying_price: The underlying_price of this OptionsContract. # noqa: E501
  313. :type: str
  314. """
  315. self._underlying_price = underlying_price
  316. @property
  317. def last_price(self):
  318. """Gets the last_price of this OptionsContract. # noqa: E501
  319. Last trading price # noqa: E501
  320. :return: The last_price of this OptionsContract. # noqa: E501
  321. :rtype: str
  322. """
  323. return self._last_price
  324. @last_price.setter
  325. def last_price(self, last_price):
  326. """Sets the last_price of this OptionsContract.
  327. Last trading price # noqa: E501
  328. :param last_price: The last_price of this OptionsContract. # noqa: E501
  329. :type: str
  330. """
  331. self._last_price = last_price
  332. @property
  333. def mark_price(self):
  334. """Gets the mark_price of this OptionsContract. # noqa: E501
  335. Current mark price (quote currency) # noqa: E501
  336. :return: The mark_price of this OptionsContract. # noqa: E501
  337. :rtype: str
  338. """
  339. return self._mark_price
  340. @mark_price.setter
  341. def mark_price(self, mark_price):
  342. """Sets the mark_price of this OptionsContract.
  343. Current mark price (quote currency) # noqa: E501
  344. :param mark_price: The mark_price of this OptionsContract. # noqa: E501
  345. :type: str
  346. """
  347. self._mark_price = mark_price
  348. @property
  349. def index_price(self):
  350. """Gets the index_price of this OptionsContract. # noqa: E501
  351. Current index price (quote currency) # noqa: E501
  352. :return: The index_price of this OptionsContract. # noqa: E501
  353. :rtype: str
  354. """
  355. return self._index_price
  356. @index_price.setter
  357. def index_price(self, index_price):
  358. """Sets the index_price of this OptionsContract.
  359. Current index price (quote currency) # noqa: E501
  360. :param index_price: The index_price of this OptionsContract. # noqa: E501
  361. :type: str
  362. """
  363. self._index_price = index_price
  364. @property
  365. def maker_fee_rate(self):
  366. """Gets the maker_fee_rate of this OptionsContract. # noqa: E501
  367. Maker fee rate, where negative means rebate # noqa: E501
  368. :return: The maker_fee_rate of this OptionsContract. # noqa: E501
  369. :rtype: str
  370. """
  371. return self._maker_fee_rate
  372. @maker_fee_rate.setter
  373. def maker_fee_rate(self, maker_fee_rate):
  374. """Sets the maker_fee_rate of this OptionsContract.
  375. Maker fee rate, where negative means rebate # noqa: E501
  376. :param maker_fee_rate: The maker_fee_rate of this OptionsContract. # noqa: E501
  377. :type: str
  378. """
  379. self._maker_fee_rate = maker_fee_rate
  380. @property
  381. def taker_fee_rate(self):
  382. """Gets the taker_fee_rate of this OptionsContract. # noqa: E501
  383. Taker fee rate # noqa: E501
  384. :return: The taker_fee_rate of this OptionsContract. # noqa: E501
  385. :rtype: str
  386. """
  387. return self._taker_fee_rate
  388. @taker_fee_rate.setter
  389. def taker_fee_rate(self, taker_fee_rate):
  390. """Sets the taker_fee_rate of this OptionsContract.
  391. Taker fee rate # noqa: E501
  392. :param taker_fee_rate: The taker_fee_rate of this OptionsContract. # noqa: E501
  393. :type: str
  394. """
  395. self._taker_fee_rate = taker_fee_rate
  396. @property
  397. def order_price_round(self):
  398. """Gets the order_price_round of this OptionsContract. # noqa: E501
  399. Minimum order price increment # noqa: E501
  400. :return: The order_price_round of this OptionsContract. # noqa: E501
  401. :rtype: str
  402. """
  403. return self._order_price_round
  404. @order_price_round.setter
  405. def order_price_round(self, order_price_round):
  406. """Sets the order_price_round of this OptionsContract.
  407. Minimum order price increment # noqa: E501
  408. :param order_price_round: The order_price_round of this OptionsContract. # noqa: E501
  409. :type: str
  410. """
  411. self._order_price_round = order_price_round
  412. @property
  413. def mark_price_round(self):
  414. """Gets the mark_price_round of this OptionsContract. # noqa: E501
  415. Minimum mark price increment # noqa: E501
  416. :return: The mark_price_round of this OptionsContract. # noqa: E501
  417. :rtype: str
  418. """
  419. return self._mark_price_round
  420. @mark_price_round.setter
  421. def mark_price_round(self, mark_price_round):
  422. """Sets the mark_price_round of this OptionsContract.
  423. Minimum mark price increment # noqa: E501
  424. :param mark_price_round: The mark_price_round of this OptionsContract. # noqa: E501
  425. :type: str
  426. """
  427. self._mark_price_round = mark_price_round
  428. @property
  429. def order_size_min(self):
  430. """Gets the order_size_min of this OptionsContract. # noqa: E501
  431. Minimum order size the contract allowed # noqa: E501
  432. :return: The order_size_min of this OptionsContract. # noqa: E501
  433. :rtype: int
  434. """
  435. return self._order_size_min
  436. @order_size_min.setter
  437. def order_size_min(self, order_size_min):
  438. """Sets the order_size_min of this OptionsContract.
  439. Minimum order size the contract allowed # noqa: E501
  440. :param order_size_min: The order_size_min of this OptionsContract. # noqa: E501
  441. :type: int
  442. """
  443. self._order_size_min = order_size_min
  444. @property
  445. def order_size_max(self):
  446. """Gets the order_size_max of this OptionsContract. # noqa: E501
  447. Maximum order size the contract allowed # noqa: E501
  448. :return: The order_size_max of this OptionsContract. # noqa: E501
  449. :rtype: int
  450. """
  451. return self._order_size_max
  452. @order_size_max.setter
  453. def order_size_max(self, order_size_max):
  454. """Sets the order_size_max of this OptionsContract.
  455. Maximum order size the contract allowed # noqa: E501
  456. :param order_size_max: The order_size_max of this OptionsContract. # noqa: E501
  457. :type: int
  458. """
  459. self._order_size_max = order_size_max
  460. @property
  461. def order_price_deviate(self):
  462. """Gets the order_price_deviate of this OptionsContract. # noqa: E501
  463. deviation between order price and current index price. If price of an order is denoted as order_price, it must meet the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate # noqa: E501
  464. :return: The order_price_deviate of this OptionsContract. # noqa: E501
  465. :rtype: str
  466. """
  467. return self._order_price_deviate
  468. @order_price_deviate.setter
  469. def order_price_deviate(self, order_price_deviate):
  470. """Sets the order_price_deviate of this OptionsContract.
  471. deviation between order price and current index price. If price of an order is denoted as order_price, it must meet the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate # noqa: E501
  472. :param order_price_deviate: The order_price_deviate of this OptionsContract. # noqa: E501
  473. :type: str
  474. """
  475. self._order_price_deviate = order_price_deviate
  476. @property
  477. def ref_discount_rate(self):
  478. """Gets the ref_discount_rate of this OptionsContract. # noqa: E501
  479. Referral fee rate discount # noqa: E501
  480. :return: The ref_discount_rate of this OptionsContract. # noqa: E501
  481. :rtype: str
  482. """
  483. return self._ref_discount_rate
  484. @ref_discount_rate.setter
  485. def ref_discount_rate(self, ref_discount_rate):
  486. """Sets the ref_discount_rate of this OptionsContract.
  487. Referral fee rate discount # noqa: E501
  488. :param ref_discount_rate: The ref_discount_rate of this OptionsContract. # noqa: E501
  489. :type: str
  490. """
  491. self._ref_discount_rate = ref_discount_rate
  492. @property
  493. def ref_rebate_rate(self):
  494. """Gets the ref_rebate_rate of this OptionsContract. # noqa: E501
  495. Referrer commission rate # noqa: E501
  496. :return: The ref_rebate_rate of this OptionsContract. # noqa: E501
  497. :rtype: str
  498. """
  499. return self._ref_rebate_rate
  500. @ref_rebate_rate.setter
  501. def ref_rebate_rate(self, ref_rebate_rate):
  502. """Sets the ref_rebate_rate of this OptionsContract.
  503. Referrer commission rate # noqa: E501
  504. :param ref_rebate_rate: The ref_rebate_rate of this OptionsContract. # noqa: E501
  505. :type: str
  506. """
  507. self._ref_rebate_rate = ref_rebate_rate
  508. @property
  509. def orderbook_id(self):
  510. """Gets the orderbook_id of this OptionsContract. # noqa: E501
  511. Current orderbook ID # noqa: E501
  512. :return: The orderbook_id of this OptionsContract. # noqa: E501
  513. :rtype: int
  514. """
  515. return self._orderbook_id
  516. @orderbook_id.setter
  517. def orderbook_id(self, orderbook_id):
  518. """Sets the orderbook_id of this OptionsContract.
  519. Current orderbook ID # noqa: E501
  520. :param orderbook_id: The orderbook_id of this OptionsContract. # noqa: E501
  521. :type: int
  522. """
  523. self._orderbook_id = orderbook_id
  524. @property
  525. def trade_id(self):
  526. """Gets the trade_id of this OptionsContract. # noqa: E501
  527. Current trade ID # noqa: E501
  528. :return: The trade_id of this OptionsContract. # noqa: E501
  529. :rtype: int
  530. """
  531. return self._trade_id
  532. @trade_id.setter
  533. def trade_id(self, trade_id):
  534. """Sets the trade_id of this OptionsContract.
  535. Current trade ID # noqa: E501
  536. :param trade_id: The trade_id of this OptionsContract. # noqa: E501
  537. :type: int
  538. """
  539. self._trade_id = trade_id
  540. @property
  541. def trade_size(self):
  542. """Gets the trade_size of this OptionsContract. # noqa: E501
  543. Historical accumulated trade size # noqa: E501
  544. :return: The trade_size of this OptionsContract. # noqa: E501
  545. :rtype: int
  546. """
  547. return self._trade_size
  548. @trade_size.setter
  549. def trade_size(self, trade_size):
  550. """Sets the trade_size of this OptionsContract.
  551. Historical accumulated trade size # noqa: E501
  552. :param trade_size: The trade_size of this OptionsContract. # noqa: E501
  553. :type: int
  554. """
  555. self._trade_size = trade_size
  556. @property
  557. def position_size(self):
  558. """Gets the position_size of this OptionsContract. # noqa: E501
  559. Current total long position size # noqa: E501
  560. :return: The position_size of this OptionsContract. # noqa: E501
  561. :rtype: int
  562. """
  563. return self._position_size
  564. @position_size.setter
  565. def position_size(self, position_size):
  566. """Sets the position_size of this OptionsContract.
  567. Current total long position size # noqa: E501
  568. :param position_size: The position_size of this OptionsContract. # noqa: E501
  569. :type: int
  570. """
  571. self._position_size = position_size
  572. @property
  573. def orders_limit(self):
  574. """Gets the orders_limit of this OptionsContract. # noqa: E501
  575. Maximum number of open orders # noqa: E501
  576. :return: The orders_limit of this OptionsContract. # noqa: E501
  577. :rtype: int
  578. """
  579. return self._orders_limit
  580. @orders_limit.setter
  581. def orders_limit(self, orders_limit):
  582. """Sets the orders_limit of this OptionsContract.
  583. Maximum number of open orders # noqa: E501
  584. :param orders_limit: The orders_limit of this OptionsContract. # noqa: E501
  585. :type: int
  586. """
  587. self._orders_limit = orders_limit
  588. def to_dict(self):
  589. """Returns the model properties as a dict"""
  590. result = {}
  591. for attr, _ in six.iteritems(self.openapi_types):
  592. value = getattr(self, attr)
  593. if isinstance(value, list):
  594. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  595. elif hasattr(value, "to_dict"):
  596. result[attr] = value.to_dict()
  597. elif isinstance(value, dict):
  598. result[attr] = dict(
  599. map(
  600. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  601. value.items(),
  602. )
  603. )
  604. else:
  605. result[attr] = value
  606. return result
  607. def to_str(self):
  608. """Returns the string representation of the model"""
  609. return pprint.pformat(self.to_dict())
  610. def __repr__(self):
  611. """For `print` and `pprint`"""
  612. return self.to_str()
  613. def __eq__(self, other):
  614. """Returns true if both objects are equal"""
  615. if not isinstance(other, OptionsContract):
  616. return False
  617. return self.to_dict() == other.to_dict()
  618. def __ne__(self, other):
  619. """Returns true if both objects are not equal"""
  620. if not isinstance(other, OptionsContract):
  621. return True
  622. return self.to_dict() != other.to_dict()