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

1123 lines
34 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 Contract(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. 'type': 'str',
  27. 'quanto_multiplier': 'str',
  28. 'leverage_min': 'str',
  29. 'leverage_max': 'str',
  30. 'maintenance_rate': 'str',
  31. 'mark_type': 'str',
  32. 'mark_price': 'str',
  33. 'index_price': 'str',
  34. 'last_price': 'str',
  35. 'maker_fee_rate': 'str',
  36. 'taker_fee_rate': 'str',
  37. 'order_price_round': 'str',
  38. 'mark_price_round': 'str',
  39. 'funding_rate': 'str',
  40. 'funding_interval': 'int',
  41. 'funding_next_apply': 'float',
  42. 'risk_limit_base': 'str',
  43. 'risk_limit_step': 'str',
  44. 'risk_limit_max': 'str',
  45. 'order_size_min': 'int',
  46. 'order_size_max': 'int',
  47. 'order_price_deviate': 'str',
  48. 'ref_discount_rate': 'str',
  49. 'ref_rebate_rate': 'str',
  50. 'orderbook_id': 'int',
  51. 'trade_id': 'int',
  52. 'trade_size': 'int',
  53. 'position_size': 'int',
  54. 'config_change_time': 'float',
  55. 'in_delisting': 'bool',
  56. 'orders_limit': 'int',
  57. 'enable_bonus': 'bool',
  58. 'enable_credit': 'bool',
  59. 'create_time': 'float',
  60. }
  61. attribute_map = {
  62. 'name': 'name',
  63. 'type': 'type',
  64. 'quanto_multiplier': 'quanto_multiplier',
  65. 'leverage_min': 'leverage_min',
  66. 'leverage_max': 'leverage_max',
  67. 'maintenance_rate': 'maintenance_rate',
  68. 'mark_type': 'mark_type',
  69. 'mark_price': 'mark_price',
  70. 'index_price': 'index_price',
  71. 'last_price': 'last_price',
  72. 'maker_fee_rate': 'maker_fee_rate',
  73. 'taker_fee_rate': 'taker_fee_rate',
  74. 'order_price_round': 'order_price_round',
  75. 'mark_price_round': 'mark_price_round',
  76. 'funding_rate': 'funding_rate',
  77. 'funding_interval': 'funding_interval',
  78. 'funding_next_apply': 'funding_next_apply',
  79. 'risk_limit_base': 'risk_limit_base',
  80. 'risk_limit_step': 'risk_limit_step',
  81. 'risk_limit_max': 'risk_limit_max',
  82. 'order_size_min': 'order_size_min',
  83. 'order_size_max': 'order_size_max',
  84. 'order_price_deviate': 'order_price_deviate',
  85. 'ref_discount_rate': 'ref_discount_rate',
  86. 'ref_rebate_rate': 'ref_rebate_rate',
  87. 'orderbook_id': 'orderbook_id',
  88. 'trade_id': 'trade_id',
  89. 'trade_size': 'trade_size',
  90. 'position_size': 'position_size',
  91. 'config_change_time': 'config_change_time',
  92. 'in_delisting': 'in_delisting',
  93. 'orders_limit': 'orders_limit',
  94. 'enable_bonus': 'enable_bonus',
  95. 'enable_credit': 'enable_credit',
  96. 'create_time': 'create_time',
  97. }
  98. def __init__(
  99. self,
  100. name=None,
  101. type=None,
  102. quanto_multiplier=None,
  103. leverage_min=None,
  104. leverage_max=None,
  105. maintenance_rate=None,
  106. mark_type=None,
  107. mark_price=None,
  108. index_price=None,
  109. last_price=None,
  110. maker_fee_rate=None,
  111. taker_fee_rate=None,
  112. order_price_round=None,
  113. mark_price_round=None,
  114. funding_rate=None,
  115. funding_interval=None,
  116. funding_next_apply=None,
  117. risk_limit_base=None,
  118. risk_limit_step=None,
  119. risk_limit_max=None,
  120. order_size_min=None,
  121. order_size_max=None,
  122. order_price_deviate=None,
  123. ref_discount_rate=None,
  124. ref_rebate_rate=None,
  125. orderbook_id=None,
  126. trade_id=None,
  127. trade_size=None,
  128. position_size=None,
  129. config_change_time=None,
  130. in_delisting=None,
  131. orders_limit=None,
  132. enable_bonus=None,
  133. enable_credit=None,
  134. create_time=None,
  135. local_vars_configuration=None,
  136. ): # noqa: E501
  137. # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, int, float, str, str, str, int, int, str, str, str, int, int, int, int, float, bool, int, bool, bool, float, Configuration) -> None
  138. """Contract - a model defined in OpenAPI""" # noqa: E501
  139. if local_vars_configuration is None:
  140. local_vars_configuration = Configuration()
  141. self.local_vars_configuration = local_vars_configuration
  142. self._name = None
  143. self._type = None
  144. self._quanto_multiplier = None
  145. self._leverage_min = None
  146. self._leverage_max = None
  147. self._maintenance_rate = None
  148. self._mark_type = None
  149. self._mark_price = None
  150. self._index_price = None
  151. self._last_price = None
  152. self._maker_fee_rate = None
  153. self._taker_fee_rate = None
  154. self._order_price_round = None
  155. self._mark_price_round = None
  156. self._funding_rate = None
  157. self._funding_interval = None
  158. self._funding_next_apply = None
  159. self._risk_limit_base = None
  160. self._risk_limit_step = None
  161. self._risk_limit_max = None
  162. self._order_size_min = None
  163. self._order_size_max = None
  164. self._order_price_deviate = None
  165. self._ref_discount_rate = None
  166. self._ref_rebate_rate = None
  167. self._orderbook_id = None
  168. self._trade_id = None
  169. self._trade_size = None
  170. self._position_size = None
  171. self._config_change_time = None
  172. self._in_delisting = None
  173. self._orders_limit = None
  174. self._enable_bonus = None
  175. self._enable_credit = None
  176. self._create_time = None
  177. self.discriminator = None
  178. if name is not None:
  179. self.name = name
  180. if type is not None:
  181. self.type = type
  182. if quanto_multiplier is not None:
  183. self.quanto_multiplier = quanto_multiplier
  184. if leverage_min is not None:
  185. self.leverage_min = leverage_min
  186. if leverage_max is not None:
  187. self.leverage_max = leverage_max
  188. if maintenance_rate is not None:
  189. self.maintenance_rate = maintenance_rate
  190. if mark_type is not None:
  191. self.mark_type = mark_type
  192. if mark_price is not None:
  193. self.mark_price = mark_price
  194. if index_price is not None:
  195. self.index_price = index_price
  196. if last_price is not None:
  197. self.last_price = last_price
  198. if maker_fee_rate is not None:
  199. self.maker_fee_rate = maker_fee_rate
  200. if taker_fee_rate is not None:
  201. self.taker_fee_rate = taker_fee_rate
  202. if order_price_round is not None:
  203. self.order_price_round = order_price_round
  204. if mark_price_round is not None:
  205. self.mark_price_round = mark_price_round
  206. if funding_rate is not None:
  207. self.funding_rate = funding_rate
  208. if funding_interval is not None:
  209. self.funding_interval = funding_interval
  210. if funding_next_apply is not None:
  211. self.funding_next_apply = funding_next_apply
  212. if risk_limit_base is not None:
  213. self.risk_limit_base = risk_limit_base
  214. if risk_limit_step is not None:
  215. self.risk_limit_step = risk_limit_step
  216. if risk_limit_max is not None:
  217. self.risk_limit_max = risk_limit_max
  218. if order_size_min is not None:
  219. self.order_size_min = order_size_min
  220. if order_size_max is not None:
  221. self.order_size_max = order_size_max
  222. if order_price_deviate is not None:
  223. self.order_price_deviate = order_price_deviate
  224. if ref_discount_rate is not None:
  225. self.ref_discount_rate = ref_discount_rate
  226. if ref_rebate_rate is not None:
  227. self.ref_rebate_rate = ref_rebate_rate
  228. if orderbook_id is not None:
  229. self.orderbook_id = orderbook_id
  230. if trade_id is not None:
  231. self.trade_id = trade_id
  232. if trade_size is not None:
  233. self.trade_size = trade_size
  234. if position_size is not None:
  235. self.position_size = position_size
  236. if config_change_time is not None:
  237. self.config_change_time = config_change_time
  238. if in_delisting is not None:
  239. self.in_delisting = in_delisting
  240. if orders_limit is not None:
  241. self.orders_limit = orders_limit
  242. if enable_bonus is not None:
  243. self.enable_bonus = enable_bonus
  244. if enable_credit is not None:
  245. self.enable_credit = enable_credit
  246. if create_time is not None:
  247. self.create_time = create_time
  248. @property
  249. def name(self):
  250. """Gets the name of this Contract. # noqa: E501
  251. Futures contract # noqa: E501
  252. :return: The name of this Contract. # noqa: E501
  253. :rtype: str
  254. """
  255. return self._name
  256. @name.setter
  257. def name(self, name):
  258. """Sets the name of this Contract.
  259. Futures contract # noqa: E501
  260. :param name: The name of this Contract. # noqa: E501
  261. :type: str
  262. """
  263. self._name = name
  264. @property
  265. def type(self):
  266. """Gets the type of this Contract. # noqa: E501
  267. Futures contract type # noqa: E501
  268. :return: The type of this Contract. # noqa: E501
  269. :rtype: str
  270. """
  271. return self._type
  272. @type.setter
  273. def type(self, type):
  274. """Sets the type of this Contract.
  275. Futures contract type # noqa: E501
  276. :param type: The type of this Contract. # noqa: E501
  277. :type: str
  278. """
  279. allowed_values = ["inverse", "direct"] # noqa: E501
  280. if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501
  281. raise ValueError(
  282. "Invalid value for `type` ({0}), must be one of {1}".format(type, allowed_values) # noqa: E501
  283. )
  284. self._type = type
  285. @property
  286. def quanto_multiplier(self):
  287. """Gets the quanto_multiplier of this Contract. # noqa: E501
  288. Multiplier used in converting from invoicing to settlement currency # noqa: E501
  289. :return: The quanto_multiplier of this Contract. # noqa: E501
  290. :rtype: str
  291. """
  292. return self._quanto_multiplier
  293. @quanto_multiplier.setter
  294. def quanto_multiplier(self, quanto_multiplier):
  295. """Sets the quanto_multiplier of this Contract.
  296. Multiplier used in converting from invoicing to settlement currency # noqa: E501
  297. :param quanto_multiplier: The quanto_multiplier of this Contract. # noqa: E501
  298. :type: str
  299. """
  300. self._quanto_multiplier = quanto_multiplier
  301. @property
  302. def leverage_min(self):
  303. """Gets the leverage_min of this Contract. # noqa: E501
  304. Minimum leverage # noqa: E501
  305. :return: The leverage_min of this Contract. # noqa: E501
  306. :rtype: str
  307. """
  308. return self._leverage_min
  309. @leverage_min.setter
  310. def leverage_min(self, leverage_min):
  311. """Sets the leverage_min of this Contract.
  312. Minimum leverage # noqa: E501
  313. :param leverage_min: The leverage_min of this Contract. # noqa: E501
  314. :type: str
  315. """
  316. self._leverage_min = leverage_min
  317. @property
  318. def leverage_max(self):
  319. """Gets the leverage_max of this Contract. # noqa: E501
  320. Maximum leverage # noqa: E501
  321. :return: The leverage_max of this Contract. # noqa: E501
  322. :rtype: str
  323. """
  324. return self._leverage_max
  325. @leverage_max.setter
  326. def leverage_max(self, leverage_max):
  327. """Sets the leverage_max of this Contract.
  328. Maximum leverage # noqa: E501
  329. :param leverage_max: The leverage_max of this Contract. # noqa: E501
  330. :type: str
  331. """
  332. self._leverage_max = leverage_max
  333. @property
  334. def maintenance_rate(self):
  335. """Gets the maintenance_rate of this Contract. # noqa: E501
  336. Maintenance rate of margin # noqa: E501
  337. :return: The maintenance_rate of this Contract. # noqa: E501
  338. :rtype: str
  339. """
  340. return self._maintenance_rate
  341. @maintenance_rate.setter
  342. def maintenance_rate(self, maintenance_rate):
  343. """Sets the maintenance_rate of this Contract.
  344. Maintenance rate of margin # noqa: E501
  345. :param maintenance_rate: The maintenance_rate of this Contract. # noqa: E501
  346. :type: str
  347. """
  348. self._maintenance_rate = maintenance_rate
  349. @property
  350. def mark_type(self):
  351. """Gets the mark_type of this Contract. # noqa: E501
  352. Mark price type, internal - based on internal trading, index - based on external index price # noqa: E501
  353. :return: The mark_type of this Contract. # noqa: E501
  354. :rtype: str
  355. """
  356. return self._mark_type
  357. @mark_type.setter
  358. def mark_type(self, mark_type):
  359. """Sets the mark_type of this Contract.
  360. Mark price type, internal - based on internal trading, index - based on external index price # noqa: E501
  361. :param mark_type: The mark_type of this Contract. # noqa: E501
  362. :type: str
  363. """
  364. allowed_values = ["internal", "index"] # noqa: E501
  365. if self.local_vars_configuration.client_side_validation and mark_type not in allowed_values: # noqa: E501
  366. raise ValueError(
  367. "Invalid value for `mark_type` ({0}), must be one of {1}".format( # noqa: E501
  368. mark_type, allowed_values
  369. )
  370. )
  371. self._mark_type = mark_type
  372. @property
  373. def mark_price(self):
  374. """Gets the mark_price of this Contract. # noqa: E501
  375. Current mark price # noqa: E501
  376. :return: The mark_price of this Contract. # noqa: E501
  377. :rtype: str
  378. """
  379. return self._mark_price
  380. @mark_price.setter
  381. def mark_price(self, mark_price):
  382. """Sets the mark_price of this Contract.
  383. Current mark price # noqa: E501
  384. :param mark_price: The mark_price of this Contract. # noqa: E501
  385. :type: str
  386. """
  387. self._mark_price = mark_price
  388. @property
  389. def index_price(self):
  390. """Gets the index_price of this Contract. # noqa: E501
  391. Current index price # noqa: E501
  392. :return: The index_price of this Contract. # noqa: E501
  393. :rtype: str
  394. """
  395. return self._index_price
  396. @index_price.setter
  397. def index_price(self, index_price):
  398. """Sets the index_price of this Contract.
  399. Current index price # noqa: E501
  400. :param index_price: The index_price of this Contract. # noqa: E501
  401. :type: str
  402. """
  403. self._index_price = index_price
  404. @property
  405. def last_price(self):
  406. """Gets the last_price of this Contract. # noqa: E501
  407. Last trading price # noqa: E501
  408. :return: The last_price of this Contract. # noqa: E501
  409. :rtype: str
  410. """
  411. return self._last_price
  412. @last_price.setter
  413. def last_price(self, last_price):
  414. """Sets the last_price of this Contract.
  415. Last trading price # noqa: E501
  416. :param last_price: The last_price of this Contract. # noqa: E501
  417. :type: str
  418. """
  419. self._last_price = last_price
  420. @property
  421. def maker_fee_rate(self):
  422. """Gets the maker_fee_rate of this Contract. # noqa: E501
  423. Maker fee rate, where negative means rebate # noqa: E501
  424. :return: The maker_fee_rate of this Contract. # noqa: E501
  425. :rtype: str
  426. """
  427. return self._maker_fee_rate
  428. @maker_fee_rate.setter
  429. def maker_fee_rate(self, maker_fee_rate):
  430. """Sets the maker_fee_rate of this Contract.
  431. Maker fee rate, where negative means rebate # noqa: E501
  432. :param maker_fee_rate: The maker_fee_rate of this Contract. # noqa: E501
  433. :type: str
  434. """
  435. self._maker_fee_rate = maker_fee_rate
  436. @property
  437. def taker_fee_rate(self):
  438. """Gets the taker_fee_rate of this Contract. # noqa: E501
  439. Taker fee rate # noqa: E501
  440. :return: The taker_fee_rate of this Contract. # noqa: E501
  441. :rtype: str
  442. """
  443. return self._taker_fee_rate
  444. @taker_fee_rate.setter
  445. def taker_fee_rate(self, taker_fee_rate):
  446. """Sets the taker_fee_rate of this Contract.
  447. Taker fee rate # noqa: E501
  448. :param taker_fee_rate: The taker_fee_rate of this Contract. # noqa: E501
  449. :type: str
  450. """
  451. self._taker_fee_rate = taker_fee_rate
  452. @property
  453. def order_price_round(self):
  454. """Gets the order_price_round of this Contract. # noqa: E501
  455. Minimum order price increment # noqa: E501
  456. :return: The order_price_round of this Contract. # noqa: E501
  457. :rtype: str
  458. """
  459. return self._order_price_round
  460. @order_price_round.setter
  461. def order_price_round(self, order_price_round):
  462. """Sets the order_price_round of this Contract.
  463. Minimum order price increment # noqa: E501
  464. :param order_price_round: The order_price_round of this Contract. # noqa: E501
  465. :type: str
  466. """
  467. self._order_price_round = order_price_round
  468. @property
  469. def mark_price_round(self):
  470. """Gets the mark_price_round of this Contract. # noqa: E501
  471. Minimum mark price increment # noqa: E501
  472. :return: The mark_price_round of this Contract. # noqa: E501
  473. :rtype: str
  474. """
  475. return self._mark_price_round
  476. @mark_price_round.setter
  477. def mark_price_round(self, mark_price_round):
  478. """Sets the mark_price_round of this Contract.
  479. Minimum mark price increment # noqa: E501
  480. :param mark_price_round: The mark_price_round of this Contract. # noqa: E501
  481. :type: str
  482. """
  483. self._mark_price_round = mark_price_round
  484. @property
  485. def funding_rate(self):
  486. """Gets the funding_rate of this Contract. # noqa: E501
  487. Current funding rate # noqa: E501
  488. :return: The funding_rate of this Contract. # noqa: E501
  489. :rtype: str
  490. """
  491. return self._funding_rate
  492. @funding_rate.setter
  493. def funding_rate(self, funding_rate):
  494. """Sets the funding_rate of this Contract.
  495. Current funding rate # noqa: E501
  496. :param funding_rate: The funding_rate of this Contract. # noqa: E501
  497. :type: str
  498. """
  499. self._funding_rate = funding_rate
  500. @property
  501. def funding_interval(self):
  502. """Gets the funding_interval of this Contract. # noqa: E501
  503. Funding application interval, unit in seconds # noqa: E501
  504. :return: The funding_interval of this Contract. # noqa: E501
  505. :rtype: int
  506. """
  507. return self._funding_interval
  508. @funding_interval.setter
  509. def funding_interval(self, funding_interval):
  510. """Sets the funding_interval of this Contract.
  511. Funding application interval, unit in seconds # noqa: E501
  512. :param funding_interval: The funding_interval of this Contract. # noqa: E501
  513. :type: int
  514. """
  515. self._funding_interval = funding_interval
  516. @property
  517. def funding_next_apply(self):
  518. """Gets the funding_next_apply of this Contract. # noqa: E501
  519. Next funding time # noqa: E501
  520. :return: The funding_next_apply of this Contract. # noqa: E501
  521. :rtype: float
  522. """
  523. return self._funding_next_apply
  524. @funding_next_apply.setter
  525. def funding_next_apply(self, funding_next_apply):
  526. """Sets the funding_next_apply of this Contract.
  527. Next funding time # noqa: E501
  528. :param funding_next_apply: The funding_next_apply of this Contract. # noqa: E501
  529. :type: float
  530. """
  531. self._funding_next_apply = funding_next_apply
  532. @property
  533. def risk_limit_base(self):
  534. """Gets the risk_limit_base of this Contract. # noqa: E501
  535. Risk limit base # noqa: E501
  536. :return: The risk_limit_base of this Contract. # noqa: E501
  537. :rtype: str
  538. """
  539. return self._risk_limit_base
  540. @risk_limit_base.setter
  541. def risk_limit_base(self, risk_limit_base):
  542. """Sets the risk_limit_base of this Contract.
  543. Risk limit base # noqa: E501
  544. :param risk_limit_base: The risk_limit_base of this Contract. # noqa: E501
  545. :type: str
  546. """
  547. self._risk_limit_base = risk_limit_base
  548. @property
  549. def risk_limit_step(self):
  550. """Gets the risk_limit_step of this Contract. # noqa: E501
  551. Step of adjusting risk limit # noqa: E501
  552. :return: The risk_limit_step of this Contract. # noqa: E501
  553. :rtype: str
  554. """
  555. return self._risk_limit_step
  556. @risk_limit_step.setter
  557. def risk_limit_step(self, risk_limit_step):
  558. """Sets the risk_limit_step of this Contract.
  559. Step of adjusting risk limit # noqa: E501
  560. :param risk_limit_step: The risk_limit_step of this Contract. # noqa: E501
  561. :type: str
  562. """
  563. self._risk_limit_step = risk_limit_step
  564. @property
  565. def risk_limit_max(self):
  566. """Gets the risk_limit_max of this Contract. # noqa: E501
  567. Maximum risk limit the contract allowed # noqa: E501
  568. :return: The risk_limit_max of this Contract. # noqa: E501
  569. :rtype: str
  570. """
  571. return self._risk_limit_max
  572. @risk_limit_max.setter
  573. def risk_limit_max(self, risk_limit_max):
  574. """Sets the risk_limit_max of this Contract.
  575. Maximum risk limit the contract allowed # noqa: E501
  576. :param risk_limit_max: The risk_limit_max of this Contract. # noqa: E501
  577. :type: str
  578. """
  579. self._risk_limit_max = risk_limit_max
  580. @property
  581. def order_size_min(self):
  582. """Gets the order_size_min of this Contract. # noqa: E501
  583. Minimum order size the contract allowed # noqa: E501
  584. :return: The order_size_min of this Contract. # noqa: E501
  585. :rtype: int
  586. """
  587. return self._order_size_min
  588. @order_size_min.setter
  589. def order_size_min(self, order_size_min):
  590. """Sets the order_size_min of this Contract.
  591. Minimum order size the contract allowed # noqa: E501
  592. :param order_size_min: The order_size_min of this Contract. # noqa: E501
  593. :type: int
  594. """
  595. self._order_size_min = order_size_min
  596. @property
  597. def order_size_max(self):
  598. """Gets the order_size_max of this Contract. # noqa: E501
  599. Maximum order size the contract allowed # noqa: E501
  600. :return: The order_size_max of this Contract. # noqa: E501
  601. :rtype: int
  602. """
  603. return self._order_size_max
  604. @order_size_max.setter
  605. def order_size_max(self, order_size_max):
  606. """Sets the order_size_max of this Contract.
  607. Maximum order size the contract allowed # noqa: E501
  608. :param order_size_max: The order_size_max of this Contract. # noqa: E501
  609. :type: int
  610. """
  611. self._order_size_max = order_size_max
  612. @property
  613. def order_price_deviate(self):
  614. """Gets the order_price_deviate of this Contract. # noqa: E501
  615. 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
  616. :return: The order_price_deviate of this Contract. # noqa: E501
  617. :rtype: str
  618. """
  619. return self._order_price_deviate
  620. @order_price_deviate.setter
  621. def order_price_deviate(self, order_price_deviate):
  622. """Sets the order_price_deviate of this Contract.
  623. 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
  624. :param order_price_deviate: The order_price_deviate of this Contract. # noqa: E501
  625. :type: str
  626. """
  627. self._order_price_deviate = order_price_deviate
  628. @property
  629. def ref_discount_rate(self):
  630. """Gets the ref_discount_rate of this Contract. # noqa: E501
  631. Referral fee rate discount # noqa: E501
  632. :return: The ref_discount_rate of this Contract. # noqa: E501
  633. :rtype: str
  634. """
  635. return self._ref_discount_rate
  636. @ref_discount_rate.setter
  637. def ref_discount_rate(self, ref_discount_rate):
  638. """Sets the ref_discount_rate of this Contract.
  639. Referral fee rate discount # noqa: E501
  640. :param ref_discount_rate: The ref_discount_rate of this Contract. # noqa: E501
  641. :type: str
  642. """
  643. self._ref_discount_rate = ref_discount_rate
  644. @property
  645. def ref_rebate_rate(self):
  646. """Gets the ref_rebate_rate of this Contract. # noqa: E501
  647. Referrer commission rate # noqa: E501
  648. :return: The ref_rebate_rate of this Contract. # noqa: E501
  649. :rtype: str
  650. """
  651. return self._ref_rebate_rate
  652. @ref_rebate_rate.setter
  653. def ref_rebate_rate(self, ref_rebate_rate):
  654. """Sets the ref_rebate_rate of this Contract.
  655. Referrer commission rate # noqa: E501
  656. :param ref_rebate_rate: The ref_rebate_rate of this Contract. # noqa: E501
  657. :type: str
  658. """
  659. self._ref_rebate_rate = ref_rebate_rate
  660. @property
  661. def orderbook_id(self):
  662. """Gets the orderbook_id of this Contract. # noqa: E501
  663. Current orderbook ID # noqa: E501
  664. :return: The orderbook_id of this Contract. # noqa: E501
  665. :rtype: int
  666. """
  667. return self._orderbook_id
  668. @orderbook_id.setter
  669. def orderbook_id(self, orderbook_id):
  670. """Sets the orderbook_id of this Contract.
  671. Current orderbook ID # noqa: E501
  672. :param orderbook_id: The orderbook_id of this Contract. # noqa: E501
  673. :type: int
  674. """
  675. self._orderbook_id = orderbook_id
  676. @property
  677. def trade_id(self):
  678. """Gets the trade_id of this Contract. # noqa: E501
  679. Current trade ID # noqa: E501
  680. :return: The trade_id of this Contract. # noqa: E501
  681. :rtype: int
  682. """
  683. return self._trade_id
  684. @trade_id.setter
  685. def trade_id(self, trade_id):
  686. """Sets the trade_id of this Contract.
  687. Current trade ID # noqa: E501
  688. :param trade_id: The trade_id of this Contract. # noqa: E501
  689. :type: int
  690. """
  691. self._trade_id = trade_id
  692. @property
  693. def trade_size(self):
  694. """Gets the trade_size of this Contract. # noqa: E501
  695. Historical accumulated trade size # noqa: E501
  696. :return: The trade_size of this Contract. # noqa: E501
  697. :rtype: int
  698. """
  699. return self._trade_size
  700. @trade_size.setter
  701. def trade_size(self, trade_size):
  702. """Sets the trade_size of this Contract.
  703. Historical accumulated trade size # noqa: E501
  704. :param trade_size: The trade_size of this Contract. # noqa: E501
  705. :type: int
  706. """
  707. self._trade_size = trade_size
  708. @property
  709. def position_size(self):
  710. """Gets the position_size of this Contract. # noqa: E501
  711. Current total long position size # noqa: E501
  712. :return: The position_size of this Contract. # noqa: E501
  713. :rtype: int
  714. """
  715. return self._position_size
  716. @position_size.setter
  717. def position_size(self, position_size):
  718. """Sets the position_size of this Contract.
  719. Current total long position size # noqa: E501
  720. :param position_size: The position_size of this Contract. # noqa: E501
  721. :type: int
  722. """
  723. self._position_size = position_size
  724. @property
  725. def config_change_time(self):
  726. """Gets the config_change_time of this Contract. # noqa: E501
  727. Last changed time of configuration # noqa: E501
  728. :return: The config_change_time of this Contract. # noqa: E501
  729. :rtype: float
  730. """
  731. return self._config_change_time
  732. @config_change_time.setter
  733. def config_change_time(self, config_change_time):
  734. """Sets the config_change_time of this Contract.
  735. Last changed time of configuration # noqa: E501
  736. :param config_change_time: The config_change_time of this Contract. # noqa: E501
  737. :type: float
  738. """
  739. self._config_change_time = config_change_time
  740. @property
  741. def in_delisting(self):
  742. """Gets the in_delisting of this Contract. # noqa: E501
  743. Contract is delisting # noqa: E501
  744. :return: The in_delisting of this Contract. # noqa: E501
  745. :rtype: bool
  746. """
  747. return self._in_delisting
  748. @in_delisting.setter
  749. def in_delisting(self, in_delisting):
  750. """Sets the in_delisting of this Contract.
  751. Contract is delisting # noqa: E501
  752. :param in_delisting: The in_delisting of this Contract. # noqa: E501
  753. :type: bool
  754. """
  755. self._in_delisting = in_delisting
  756. @property
  757. def orders_limit(self):
  758. """Gets the orders_limit of this Contract. # noqa: E501
  759. Maximum number of open orders # noqa: E501
  760. :return: The orders_limit of this Contract. # noqa: E501
  761. :rtype: int
  762. """
  763. return self._orders_limit
  764. @orders_limit.setter
  765. def orders_limit(self, orders_limit):
  766. """Sets the orders_limit of this Contract.
  767. Maximum number of open orders # noqa: E501
  768. :param orders_limit: The orders_limit of this Contract. # noqa: E501
  769. :type: int
  770. """
  771. self._orders_limit = orders_limit
  772. @property
  773. def enable_bonus(self):
  774. """Gets the enable_bonus of this Contract. # noqa: E501
  775. Whether bouns is enabled # noqa: E501
  776. :return: The enable_bonus of this Contract. # noqa: E501
  777. :rtype: bool
  778. """
  779. return self._enable_bonus
  780. @enable_bonus.setter
  781. def enable_bonus(self, enable_bonus):
  782. """Sets the enable_bonus of this Contract.
  783. Whether bouns is enabled # noqa: E501
  784. :param enable_bonus: The enable_bonus of this Contract. # noqa: E501
  785. :type: bool
  786. """
  787. self._enable_bonus = enable_bonus
  788. @property
  789. def enable_credit(self):
  790. """Gets the enable_credit of this Contract. # noqa: E501
  791. Whether portfolio margin account is enabled # noqa: E501
  792. :return: The enable_credit of this Contract. # noqa: E501
  793. :rtype: bool
  794. """
  795. return self._enable_credit
  796. @enable_credit.setter
  797. def enable_credit(self, enable_credit):
  798. """Sets the enable_credit of this Contract.
  799. Whether portfolio margin account is enabled # noqa: E501
  800. :param enable_credit: The enable_credit of this Contract. # noqa: E501
  801. :type: bool
  802. """
  803. self._enable_credit = enable_credit
  804. @property
  805. def create_time(self):
  806. """Gets the create_time of this Contract. # noqa: E501
  807. Created time of the contract # noqa: E501
  808. :return: The create_time of this Contract. # noqa: E501
  809. :rtype: float
  810. """
  811. return self._create_time
  812. @create_time.setter
  813. def create_time(self, create_time):
  814. """Sets the create_time of this Contract.
  815. Created time of the contract # noqa: E501
  816. :param create_time: The create_time of this Contract. # noqa: E501
  817. :type: float
  818. """
  819. self._create_time = create_time
  820. def to_dict(self):
  821. """Returns the model properties as a dict"""
  822. result = {}
  823. for attr, _ in six.iteritems(self.openapi_types):
  824. value = getattr(self, attr)
  825. if isinstance(value, list):
  826. result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
  827. elif hasattr(value, "to_dict"):
  828. result[attr] = value.to_dict()
  829. elif isinstance(value, dict):
  830. result[attr] = dict(
  831. map(
  832. lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
  833. value.items(),
  834. )
  835. )
  836. else:
  837. result[attr] = value
  838. return result
  839. def to_str(self):
  840. """Returns the string representation of the model"""
  841. return pprint.pformat(self.to_dict())
  842. def __repr__(self):
  843. """For `print` and `pprint`"""
  844. return self.to_str()
  845. def __eq__(self, other):
  846. """Returns true if both objects are equal"""
  847. if not isinstance(other, Contract):
  848. return False
  849. return self.to_dict() == other.to_dict()
  850. def __ne__(self, other):
  851. """Returns true if both objects are not equal"""
  852. if not isinstance(other, Contract):
  853. return True
  854. return self.to_dict() != other.to_dict()