pybit 5.17.0__tar.gz → 5.17.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pybit-5.17.0 → pybit-5.17.2}/CHANGELOG.md +139 -3
- {pybit-5.17.0/pybit.egg-info → pybit-5.17.2}/PKG-INFO +1 -1
- pybit-5.17.2/pybit/__init__.py +1 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_http_manager.py +3 -1
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_account.py +45 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_asset.py +30 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_crypto_loan.py +41 -1
- pybit-5.17.2/pybit/_v5_dca.py +43 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_earn.py +33 -0
- pybit-5.17.2/pybit/_v5_fcombobot.py +86 -0
- pybit-5.17.2/pybit/_v5_fgridbot.py +93 -0
- pybit-5.17.2/pybit/_v5_fht.py +44 -0
- pybit-5.17.2/pybit/_v5_fmartingalebot.py +89 -0
- pybit-5.17.2/pybit/_v5_grid.py +115 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_institutional_loan.py +30 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_market.py +15 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_position.py +21 -0
- pybit-5.17.2/pybit/_v5_rwa.py +174 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_spot_margin_trade.py +150 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_spread.py +23 -0
- pybit-5.17.2/pybit/_v5_strategy.py +126 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_user.py +15 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/account.py +3 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/asset.py +2 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/crypto_loan.py +2 -0
- pybit-5.17.2/pybit/dca.py +9 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/earn.py +2 -0
- pybit-5.17.2/pybit/fcombobot.py +11 -0
- pybit-5.17.2/pybit/fgridbot.py +11 -0
- pybit-5.17.2/pybit/fht.py +9 -0
- pybit-5.17.2/pybit/fmartingalebot.py +11 -0
- pybit-5.17.2/pybit/grid.py +11 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/institutional_loan.py +3 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/market.py +1 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/position.py +1 -0
- pybit-5.17.2/pybit/rwa.py +16 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/spot_margin_trade.py +8 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/spread.py +1 -0
- pybit-5.17.2/pybit/strategy.py +12 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/unified_trading.py +17 -1
- {pybit-5.17.0 → pybit-5.17.2}/pybit/user.py +1 -0
- {pybit-5.17.0 → pybit-5.17.2/pybit.egg-info}/PKG-INFO +1 -1
- {pybit-5.17.0 → pybit-5.17.2}/pybit.egg-info/SOURCES.txt +17 -0
- pybit-5.17.2/tests/test_generated_openapi_endpoints.py +290 -0
- {pybit-5.17.0 → pybit-5.17.2}/tests/test_pybit.py +37 -2
- pybit-5.17.0/pybit/__init__.py +0 -1
- {pybit-5.17.0 → pybit-5.17.2}/LICENSE +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/MANIFEST.in +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/README.md +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/examples/direct_session.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/examples/http_example_explanatory.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/examples/http_example_quickstart.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/examples/http_example_rsa_authentication.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/examples/p2p_example_explanatory.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/examples/p2p_example_quickstart.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/examples/websocket_example_explanatory.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/examples/websocket_example_quickstart.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/examples/websocket_example_rsa_authentication.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/examples/websocket_http_example_spread_trading_quickstart.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/examples/websocket_trading_example_quickstart.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/examples/websocket_unsubscribe_example.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/examples/wrapper_class.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_helpers.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_broker.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_fiat.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_misc.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_p2p.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_pre_upgrade.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_rate_limit.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_rfq.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_spot_leverage_token.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_v5_trade.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_websocket_stream.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/_websocket_trading.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/broker.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/exceptions.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/fiat.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/helpers.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/misc.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/p2p.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/pre_upgrade.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/rate_limit.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/rfq.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/spot_leverage_token.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit/trade.py +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit.egg-info/dependency_links.txt +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit.egg-info/not-zip-safe +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit.egg-info/requires.txt +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/pybit.egg-info/top_level.txt +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/setup.cfg +0 -0
- {pybit-5.17.0 → pybit-5.17.2}/setup.py +0 -0
|
@@ -1,9 +1,145 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
## [5.17.2] - 2026-10-13
|
|
5
|
+
|
|
6
|
+
### New Methods (20)
|
|
7
|
+
|
|
8
|
+
- `get_option_asset_info`
|
|
9
|
+
- `get_pay_info`
|
|
10
|
+
- `get_trade_info_for_analysis`
|
|
11
|
+
- `get_portfolio_margin`
|
|
12
|
+
- `get_total_members_assets`
|
|
13
|
+
- `list_earn_auto_savings`
|
|
14
|
+
- `edit_earn_auto_savings`
|
|
15
|
+
- `ins_loan_coin_delta_amount`
|
|
16
|
+
- `ins_loan_delay_liq_status`
|
|
17
|
+
- `get_position_symbol_info`
|
|
18
|
+
- `query_fixed_available_inventory`
|
|
19
|
+
- `account_fixed_borrow`
|
|
20
|
+
- `query_fixed_borrow_contracts`
|
|
21
|
+
- `query_fixed_borrow_orders`
|
|
22
|
+
- `query_fixed_borrow_market`
|
|
23
|
+
- `renew_fixed_borrow`
|
|
24
|
+
- `get_spot_margin_trade_flexible_available_inventory`
|
|
25
|
+
- `query_borrow_liability`
|
|
26
|
+
- `get_spread_max_qty`
|
|
27
|
+
- `query_referral_code`
|
|
28
|
+
|
|
29
|
+
### New Endpoint Keys (20)
|
|
30
|
+
|
|
31
|
+
- `Account.GET_OPTION_ASSET_INFO`
|
|
32
|
+
- `Account.GET_PAY_INFO`
|
|
33
|
+
- `Account.GET_TRADE_INFO_FOR_ANALYSIS`
|
|
34
|
+
- `Asset.GET_PORTFOLIO_MARGIN`
|
|
35
|
+
- `Asset.GET_TOTAL_MEMBERS_ASSETS`
|
|
36
|
+
- `Earn.LIST_EARN_AUTO_SAVINGS`
|
|
37
|
+
- `Earn.EDIT_EARN_AUTO_SAVINGS`
|
|
38
|
+
- `InstitutionalLoan.INS_LOAN_COIN_DELTA_AMOUNT`
|
|
39
|
+
- `InstitutionalLoan.INS_LOAN_DELAY_LIQ_STATUS`
|
|
40
|
+
- `Position.GET_POSITION_SYMBOL_INFO`
|
|
41
|
+
- `SpotMarginTrade.QUERY_FIXED_AVAILABLE_INVENTORY`
|
|
42
|
+
- `SpotMarginTrade.ACCOUNT_FIXED_BORROW`
|
|
43
|
+
- `SpotMarginTrade.QUERY_FIXED_BORROW_CONTRACTS`
|
|
44
|
+
- `SpotMarginTrade.QUERY_FIXED_BORROW_ORDERS`
|
|
45
|
+
- `SpotMarginTrade.QUERY_FIXED_BORROW_MARKET`
|
|
46
|
+
- `SpotMarginTrade.RENEW_FIXED_BORROW`
|
|
47
|
+
- `SpotMarginTrade.GET_SPOT_MARGIN_TRADE_FLEXIBLE_AVAILABLE_INVENTORY`
|
|
48
|
+
- `SpotMarginTrade.QUERY_BORROW_LIABILITY`
|
|
49
|
+
- `Spread.GET_SPREAD_MAX_QTY`
|
|
50
|
+
- `User.QUERY_REFERRAL_CODE`
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- Serialize GET list parameters as repeated query keys so signatures match the
|
|
55
|
+
transmitted URL.
|
|
56
|
+
- Correct new endpoint documentation links and parameter descriptions.
|
|
57
|
+
|
|
58
|
+
## [5.17.1] - 2026-09-30
|
|
59
|
+
|
|
60
|
+
### New Methods (40)
|
|
61
|
+
|
|
62
|
+
- `get_option_base_coins`
|
|
63
|
+
- `get_crypto_loan_fixed_available_inventory`
|
|
64
|
+
- `get_crypto_loan_flexible_available_inventory`
|
|
65
|
+
- `close_dca_bot`
|
|
66
|
+
- `create_dca_bot`
|
|
67
|
+
- `close_combo_bot`
|
|
68
|
+
- `create_combo_bot`
|
|
69
|
+
- `get_combo_detail`
|
|
70
|
+
- `get_combo_limit`
|
|
71
|
+
- `close_f_grid_bot`
|
|
72
|
+
- `create_f_grid_bot`
|
|
73
|
+
- `get_f_grid_detail`
|
|
74
|
+
- `validate_f_grid_input`
|
|
75
|
+
- `batch_create_tax_reports`
|
|
76
|
+
- `batch_query_tax_reports`
|
|
77
|
+
- `close_f_mart_bot`
|
|
78
|
+
- `create_f_mart_bot`
|
|
79
|
+
- `get_f_mart_detail`
|
|
80
|
+
- `get_f_mart_limit`
|
|
81
|
+
- `close_grid_bot`
|
|
82
|
+
- `create_grid_bot`
|
|
83
|
+
- `query_grid_detail`
|
|
84
|
+
- `validate_grid_input`
|
|
85
|
+
- `get_convert_detail`
|
|
86
|
+
- `get_convert_list`
|
|
87
|
+
- `submit_convert`
|
|
88
|
+
- `get_multiplier_list`
|
|
89
|
+
- `get_market_session`
|
|
90
|
+
- `place_stocks_order`
|
|
91
|
+
- `cancel_stocks_order`
|
|
92
|
+
- `get_stocks_order_detail`
|
|
93
|
+
- `get_stocks_positions`
|
|
94
|
+
- `create_strategy`
|
|
95
|
+
- `create_chase_order_strategy`
|
|
96
|
+
- `create_twap_strategy`
|
|
97
|
+
- `create_iceberg_strategy`
|
|
98
|
+
- `create_pov_strategy`
|
|
99
|
+
- `query_strategy_list`
|
|
100
|
+
- `query_strategy_order_list`
|
|
101
|
+
- `stop_strategy`
|
|
102
|
+
|
|
103
|
+
### New Endpoint Keys (37)
|
|
104
|
+
|
|
105
|
+
- `Market.GET_OPTION_BASE_COINS`
|
|
106
|
+
- `CryptoLoan.GET_CRYPTO_LOAN_FIXED_AVAILABLE_INVENTORY`
|
|
107
|
+
- `CryptoLoan.GET_CRYPTO_LOAN_FLEXIBLE_AVAILABLE_INVENTORY`
|
|
108
|
+
- `DCA.CLOSE_DCA_BOT`
|
|
109
|
+
- `DCA.CREATE_DCA_BOT`
|
|
110
|
+
- `FComboBot.CLOSE_COMBO_BOT`
|
|
111
|
+
- `FComboBot.CREATE_COMBO_BOT`
|
|
112
|
+
- `FComboBot.GET_COMBO_DETAIL`
|
|
113
|
+
- `FComboBot.GET_COMBO_LIMIT`
|
|
114
|
+
- `FGridBot.CLOSE_F_GRID_BOT`
|
|
115
|
+
- `FGridBot.CREATE_F_GRID_BOT`
|
|
116
|
+
- `FGridBot.GET_F_GRID_DETAIL`
|
|
117
|
+
- `FGridBot.VALIDATE_F_GRID_INPUT`
|
|
118
|
+
- `FHT.BATCH_CREATE_TAX_REPORTS`
|
|
119
|
+
- `FHT.BATCH_QUERY_TAX_REPORTS`
|
|
120
|
+
- `FMartingaleBot.CLOSE_F_MART_BOT`
|
|
121
|
+
- `FMartingaleBot.CREATE_F_MART_BOT`
|
|
122
|
+
- `FMartingaleBot.GET_F_MART_DETAIL`
|
|
123
|
+
- `FMartingaleBot.GET_F_MART_LIMIT`
|
|
124
|
+
- `Grid.CLOSE_GRID_BOT`
|
|
125
|
+
- `Grid.CREATE_GRID_BOT`
|
|
126
|
+
- `Grid.QUERY_GRID_DETAIL`
|
|
127
|
+
- `Grid.VALIDATE_GRID_INPUT`
|
|
128
|
+
- `RWA.GET_CONVERT_DETAIL`
|
|
129
|
+
- `RWA.GET_CONVERT_LIST`
|
|
130
|
+
- `RWA.SUBMIT_CONVERT`
|
|
131
|
+
- `RWA.GET_MULTIPLIER_LIST`
|
|
132
|
+
- `RWA.GET_MARKET_SESSION`
|
|
133
|
+
- `RWA.PLACE_STOCKS_ORDER`
|
|
134
|
+
- `RWA.CANCEL_STOCKS_ORDER`
|
|
135
|
+
- `RWA.GET_STOCKS_ORDER_DETAIL`
|
|
136
|
+
- `RWA.GET_STOCKS_POSITIONS`
|
|
137
|
+
- `Strategy.CREATE_STRATEGY`
|
|
138
|
+
- `Strategy.CREATE_CHASE_ORDER_STRATEGY`
|
|
139
|
+
- `Strategy.QUERY_STRATEGY_LIST`
|
|
140
|
+
- `Strategy.QUERY_STRATEGY_ORDER_LIST`
|
|
141
|
+
- `Strategy.STOP_STRATEGY`
|
|
142
|
+
|
|
7
143
|
|
|
8
144
|
## [5.17.0] - 2026-07-08
|
|
9
145
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = "5.17.2"
|
|
@@ -181,9 +181,11 @@ class _V5HTTPManager:
|
|
|
181
181
|
if method == "GET":
|
|
182
182
|
payload = "&".join(
|
|
183
183
|
[
|
|
184
|
-
str(k) + "=" + str(
|
|
184
|
+
str(k) + "=" + str(item)
|
|
185
185
|
for k, v in sorted(parameters.items())
|
|
186
186
|
if v is not None
|
|
187
|
+
for item in (v if isinstance(v, list) else [v])
|
|
188
|
+
if item is not None
|
|
187
189
|
]
|
|
188
190
|
)
|
|
189
191
|
return payload
|
|
@@ -499,3 +499,48 @@ class AccountHTTP(_V5HTTPManager):
|
|
|
499
499
|
query=kwargs,
|
|
500
500
|
auth=True,
|
|
501
501
|
)
|
|
502
|
+
|
|
503
|
+
def get_option_asset_info(self, **kwargs):
|
|
504
|
+
"""Get Option Asset Info
|
|
505
|
+
Returns:
|
|
506
|
+
Request results as dictionary.
|
|
507
|
+
|
|
508
|
+
Additional information:
|
|
509
|
+
https://bybit-exchange.github.io/docs/v5/account/option-asset-info
|
|
510
|
+
"""
|
|
511
|
+
return self._submit_request(
|
|
512
|
+
method="GET",
|
|
513
|
+
path=f"{self.endpoint}{Account.GET_OPTION_ASSET_INFO}",
|
|
514
|
+
query=kwargs,
|
|
515
|
+
auth=True,
|
|
516
|
+
)
|
|
517
|
+
|
|
518
|
+
def get_pay_info(self, **kwargs):
|
|
519
|
+
"""Get Pay Info
|
|
520
|
+
Returns:
|
|
521
|
+
Request results as dictionary.
|
|
522
|
+
|
|
523
|
+
Additional information:
|
|
524
|
+
https://bybit-exchange.github.io/docs/v5/account/pay-info
|
|
525
|
+
"""
|
|
526
|
+
return self._submit_request(
|
|
527
|
+
method="GET",
|
|
528
|
+
path=f"{self.endpoint}{Account.GET_PAY_INFO}",
|
|
529
|
+
query=kwargs,
|
|
530
|
+
auth=True,
|
|
531
|
+
)
|
|
532
|
+
|
|
533
|
+
def get_trade_info_for_analysis(self, **kwargs):
|
|
534
|
+
"""Get Trade Info For Analysis
|
|
535
|
+
Returns:
|
|
536
|
+
Request results as dictionary.
|
|
537
|
+
|
|
538
|
+
Additional information:
|
|
539
|
+
https://bybit-exchange.github.io/docs/v5/account/trade-info-for-analysis
|
|
540
|
+
"""
|
|
541
|
+
return self._submit_request(
|
|
542
|
+
method="GET",
|
|
543
|
+
path=f"{self.endpoint}{Account.GET_TRADE_INFO_FOR_ANALYSIS}",
|
|
544
|
+
query=kwargs,
|
|
545
|
+
auth=True,
|
|
546
|
+
)
|
|
@@ -824,3 +824,33 @@ class AssetHTTP(_V5HTTPManager):
|
|
|
824
824
|
query=kwargs,
|
|
825
825
|
auth=True,
|
|
826
826
|
)
|
|
827
|
+
|
|
828
|
+
def get_portfolio_margin(self, **kwargs):
|
|
829
|
+
"""Get Portfolio Margin Info
|
|
830
|
+
Returns:
|
|
831
|
+
Request results as dictionary.
|
|
832
|
+
|
|
833
|
+
Additional information:
|
|
834
|
+
https://bybit-exchange.github.io/docs/v5/asset/portfolio-margin
|
|
835
|
+
"""
|
|
836
|
+
return self._submit_request(
|
|
837
|
+
method="GET",
|
|
838
|
+
path=f"{self.endpoint}{Asset.GET_PORTFOLIO_MARGIN}",
|
|
839
|
+
query=kwargs,
|
|
840
|
+
auth=True,
|
|
841
|
+
)
|
|
842
|
+
|
|
843
|
+
def get_total_members_assets(self, **kwargs):
|
|
844
|
+
"""Get Total Members Assets
|
|
845
|
+
Returns:
|
|
846
|
+
Request results as dictionary.
|
|
847
|
+
|
|
848
|
+
Additional information:
|
|
849
|
+
https://bybit-exchange.github.io/docs/v5/asset/total-members-assets
|
|
850
|
+
"""
|
|
851
|
+
return self._submit_request(
|
|
852
|
+
method="GET",
|
|
853
|
+
path=f"{self.endpoint}{Asset.GET_TOTAL_MEMBERS_ASSETS}",
|
|
854
|
+
query=kwargs,
|
|
855
|
+
auth=True,
|
|
856
|
+
)
|
|
@@ -342,6 +342,25 @@ class CryptoLoanHTTP(_V5HTTPManager):
|
|
|
342
342
|
auth=True,
|
|
343
343
|
)
|
|
344
344
|
|
|
345
|
+
def get_crypto_loan_flexible_available_inventory(self, **kwargs):
|
|
346
|
+
"""Get flexible crypto-loan available inventory.
|
|
347
|
+
|
|
348
|
+
Required args:
|
|
349
|
+
currency (string): Coin name, uppercase only
|
|
350
|
+
|
|
351
|
+
Returns:
|
|
352
|
+
Request results as dictionary.
|
|
353
|
+
|
|
354
|
+
Additional information:
|
|
355
|
+
https://bybit-exchange.github.io/docs/v5/new-crypto-loan/flexible/available-inventory
|
|
356
|
+
"""
|
|
357
|
+
return self._submit_request(
|
|
358
|
+
method="GET",
|
|
359
|
+
path=f"{self.endpoint}{CryptoLoan.GET_CRYPTO_LOAN_FLEXIBLE_AVAILABLE_INVENTORY}",
|
|
360
|
+
query=kwargs,
|
|
361
|
+
auth=True,
|
|
362
|
+
)
|
|
363
|
+
|
|
345
364
|
def borrow_flexible_crypto_loan(self, **kwargs):
|
|
346
365
|
"""
|
|
347
366
|
Required args:
|
|
@@ -450,6 +469,27 @@ class CryptoLoanHTTP(_V5HTTPManager):
|
|
|
450
469
|
auth=True,
|
|
451
470
|
)
|
|
452
471
|
|
|
472
|
+
def get_crypto_loan_fixed_available_inventory(self, **kwargs):
|
|
473
|
+
"""Get fixed-term crypto-loan available inventory.
|
|
474
|
+
|
|
475
|
+
Required args:
|
|
476
|
+
currency (string): Coin name, uppercase only
|
|
477
|
+
term (string): Fixed term in days
|
|
478
|
+
annualRate (string): Annual interest rate, e.g. 0.02 means 2%
|
|
479
|
+
|
|
480
|
+
Returns:
|
|
481
|
+
Request results as dictionary.
|
|
482
|
+
|
|
483
|
+
Additional information:
|
|
484
|
+
https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/available-inventory
|
|
485
|
+
"""
|
|
486
|
+
return self._submit_request(
|
|
487
|
+
method="GET",
|
|
488
|
+
path=f"{self.endpoint}{CryptoLoan.GET_CRYPTO_LOAN_FIXED_AVAILABLE_INVENTORY}",
|
|
489
|
+
query=kwargs,
|
|
490
|
+
auth=True,
|
|
491
|
+
)
|
|
492
|
+
|
|
453
493
|
def get_lending_market_fixed_crypto_loan(self, **kwargs):
|
|
454
494
|
"""
|
|
455
495
|
If you want to lend, you can use this endpoint to check whether there
|
|
@@ -697,4 +737,4 @@ class CryptoLoanHTTP(_V5HTTPManager):
|
|
|
697
737
|
path=f"{self.endpoint}{CryptoLoan.GET_MAX_LOAN_AMOUNT_NEW_CRYPTO_LOAN}",
|
|
698
738
|
query=kwargs,
|
|
699
739
|
auth=True,
|
|
700
|
-
)
|
|
740
|
+
)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from ._http_manager import _V5HTTPManager
|
|
2
|
+
from .dca import DCA
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class DCAHTTP(_V5HTTPManager):
|
|
6
|
+
def close_dca_bot(self, **kwargs):
|
|
7
|
+
"""Close a running DCA bot with a specified settlement mode.
|
|
8
|
+
|
|
9
|
+
Required args:
|
|
10
|
+
bot_id (integer): DCA bot ID to close.
|
|
11
|
+
close_mode (integer): Asset settlement mode on close.
|
|
12
|
+
|
|
13
|
+
Returns:
|
|
14
|
+
Request results as dictionary.
|
|
15
|
+
|
|
16
|
+
Additional information:
|
|
17
|
+
https://bybit-exchange.github.io/docs/v5/bot/dca/close
|
|
18
|
+
"""
|
|
19
|
+
return self._submit_request(
|
|
20
|
+
method="POST",
|
|
21
|
+
path=f"{self.endpoint}{DCA.CLOSE_DCA_BOT}",
|
|
22
|
+
query=kwargs,
|
|
23
|
+
auth=True,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
def create_dca_bot(self, **kwargs):
|
|
27
|
+
"""Create a new DCA (Dollar-Cost Averaging) bot with custom parameters.
|
|
28
|
+
|
|
29
|
+
Required args:
|
|
30
|
+
parameters (object): DCA bot configuration parameters.
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
Request results as dictionary.
|
|
34
|
+
|
|
35
|
+
Additional information:
|
|
36
|
+
https://bybit-exchange.github.io/docs/v5/bot/dca/create
|
|
37
|
+
"""
|
|
38
|
+
return self._submit_request(
|
|
39
|
+
method="POST",
|
|
40
|
+
path=f"{self.endpoint}{DCA.CREATE_DCA_BOT}",
|
|
41
|
+
query=kwargs,
|
|
42
|
+
auth=True,
|
|
43
|
+
)
|
|
@@ -1312,3 +1312,36 @@ class EarnHTTP(_V5HTTPManager):
|
|
|
1312
1312
|
query=kwargs,
|
|
1313
1313
|
auth=True,
|
|
1314
1314
|
)
|
|
1315
|
+
|
|
1316
|
+
def list_earn_auto_savings(self, **kwargs):
|
|
1317
|
+
"""Get Auto Savings Settings
|
|
1318
|
+
Returns:
|
|
1319
|
+
Request results as dictionary.
|
|
1320
|
+
|
|
1321
|
+
Additional information:
|
|
1322
|
+
https://bybit-exchange.github.io/docs/v5/finance/earn/flexible-saving/auto-savings
|
|
1323
|
+
"""
|
|
1324
|
+
return self._submit_request(
|
|
1325
|
+
method="GET",
|
|
1326
|
+
path=f"{self.endpoint}{Earn.LIST_EARN_AUTO_SAVINGS}",
|
|
1327
|
+
query=kwargs,
|
|
1328
|
+
auth=True,
|
|
1329
|
+
)
|
|
1330
|
+
|
|
1331
|
+
def edit_earn_auto_savings(self, **kwargs):
|
|
1332
|
+
"""Edit Auto Savings Settings
|
|
1333
|
+
|
|
1334
|
+
Required args:
|
|
1335
|
+
isSelected (boolean): Whether to enable auto savings
|
|
1336
|
+
Returns:
|
|
1337
|
+
Request results as dictionary.
|
|
1338
|
+
|
|
1339
|
+
Additional information:
|
|
1340
|
+
https://bybit-exchange.github.io/docs/v5/finance/earn/flexible-saving/auto-savings
|
|
1341
|
+
"""
|
|
1342
|
+
return self._submit_request(
|
|
1343
|
+
method="POST",
|
|
1344
|
+
path=f"{self.endpoint}{Earn.EDIT_EARN_AUTO_SAVINGS}",
|
|
1345
|
+
query=kwargs,
|
|
1346
|
+
auth=True,
|
|
1347
|
+
)
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
from ._http_manager import _V5HTTPManager
|
|
2
|
+
from .fcombobot import FComboBot
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class FComboBotHTTP(_V5HTTPManager):
|
|
6
|
+
def close_combo_bot(self, **kwargs):
|
|
7
|
+
"""Close a running futures combo bot by bot ID.
|
|
8
|
+
|
|
9
|
+
Required args:
|
|
10
|
+
bot_id (integer): The bot ID to close, obtained from createComboBot response.
|
|
11
|
+
|
|
12
|
+
Returns:
|
|
13
|
+
Request results as dictionary.
|
|
14
|
+
|
|
15
|
+
Additional information:
|
|
16
|
+
https://bybit-exchange.github.io/docs/v5/bot/futures-combo/close
|
|
17
|
+
"""
|
|
18
|
+
return self._submit_request(
|
|
19
|
+
method="POST",
|
|
20
|
+
path=f"{self.endpoint}{FComboBot.CLOSE_COMBO_BOT}",
|
|
21
|
+
query=kwargs,
|
|
22
|
+
auth=True,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
def create_combo_bot(self, **kwargs):
|
|
26
|
+
"""Create a new futures combo bot with multi-symbol portfolio and rebalancing.
|
|
27
|
+
|
|
28
|
+
Required args:
|
|
29
|
+
leverage (string): Position leverage multiplier as whole number (e.g. '5' means 5x). Must be >= 1.
|
|
30
|
+
init_margin (string): Initial investment amount in quote currency as decimal string (e.g. '1000' for 1000 USDT).
|
|
31
|
+
adjust_position_mode (integer): Position rebalancing trigger mode.
|
|
32
|
+
symbol_settings (array): Per-symbol portfolio configuration (at least one entry required).
|
|
33
|
+
|
|
34
|
+
Returns:
|
|
35
|
+
Request results as dictionary.
|
|
36
|
+
|
|
37
|
+
Additional information:
|
|
38
|
+
https://bybit-exchange.github.io/docs/v5/bot/futures-combo/create
|
|
39
|
+
"""
|
|
40
|
+
return self._submit_request(
|
|
41
|
+
method="POST",
|
|
42
|
+
path=f"{self.endpoint}{FComboBot.CREATE_COMBO_BOT}",
|
|
43
|
+
query=kwargs,
|
|
44
|
+
auth=True,
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
def get_combo_detail(self, **kwargs):
|
|
48
|
+
"""Get full details of a futures combo bot including PnL, positions, and status.
|
|
49
|
+
|
|
50
|
+
Required args:
|
|
51
|
+
bot_id (integer): The bot ID to query.
|
|
52
|
+
|
|
53
|
+
Returns:
|
|
54
|
+
Request results as dictionary.
|
|
55
|
+
|
|
56
|
+
Additional information:
|
|
57
|
+
https://bybit-exchange.github.io/docs/v5/bot/futures-combo/get-detail
|
|
58
|
+
"""
|
|
59
|
+
return self._submit_request(
|
|
60
|
+
method="POST",
|
|
61
|
+
path=f"{self.endpoint}{FComboBot.GET_COMBO_DETAIL}",
|
|
62
|
+
query=kwargs,
|
|
63
|
+
auth=True,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
def get_combo_limit(self, **kwargs):
|
|
67
|
+
"""Validate combo bot input parameters and return allowable ranges.
|
|
68
|
+
|
|
69
|
+
Required args:
|
|
70
|
+
leverage (string): Position leverage multiplier as whole number (e.g. '5' means 5x). Must be >= 1.
|
|
71
|
+
init_margin (string): Initial investment amount in quote currency as decimal string (e.g. '1000' for 1000 USDT).
|
|
72
|
+
adjust_position_mode (integer): Position rebalancing trigger mode.
|
|
73
|
+
symbol_settings (array): Per-symbol portfolio configuration.
|
|
74
|
+
|
|
75
|
+
Returns:
|
|
76
|
+
Request results as dictionary.
|
|
77
|
+
|
|
78
|
+
Additional information:
|
|
79
|
+
https://bybit-exchange.github.io/docs/v5/bot/futures-combo/get-limit
|
|
80
|
+
"""
|
|
81
|
+
return self._submit_request(
|
|
82
|
+
method="POST",
|
|
83
|
+
path=f"{self.endpoint}{FComboBot.GET_COMBO_LIMIT}",
|
|
84
|
+
query=kwargs,
|
|
85
|
+
auth=True,
|
|
86
|
+
)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
from ._http_manager import _V5HTTPManager
|
|
2
|
+
from .fgridbot import FGridBot
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class FGridBotHTTP(_V5HTTPManager):
|
|
6
|
+
def close_f_grid_bot(self, **kwargs):
|
|
7
|
+
"""Close a running futures grid bot by bot ID.
|
|
8
|
+
|
|
9
|
+
Required args:
|
|
10
|
+
bot_id (integer): The bot ID to close, obtained from createFGridBot response.
|
|
11
|
+
|
|
12
|
+
Returns:
|
|
13
|
+
Request results as dictionary.
|
|
14
|
+
|
|
15
|
+
Additional information:
|
|
16
|
+
https://bybit-exchange.github.io/docs/v5/bot/futures-grid/close
|
|
17
|
+
"""
|
|
18
|
+
return self._submit_request(
|
|
19
|
+
method="POST",
|
|
20
|
+
path=f"{self.endpoint}{FGridBot.CLOSE_F_GRID_BOT}",
|
|
21
|
+
query=kwargs,
|
|
22
|
+
auth=True,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
def create_f_grid_bot(self, **kwargs):
|
|
26
|
+
"""Create a new futures grid trading bot with specified parameters.
|
|
27
|
+
|
|
28
|
+
Required args:
|
|
29
|
+
symbol (string): Trading pair symbol (e.g. BTCUSDT).
|
|
30
|
+
grid_mode (integer): Grid strategy direction.
|
|
31
|
+
min_price (string): Lower price bound of the grid range.
|
|
32
|
+
max_price (string): Upper price bound of the grid range.
|
|
33
|
+
cell_number (integer): Number of grid levels (minimum 2).
|
|
34
|
+
leverage (string): Position leverage multiplier as whole number (e.g. '5' means 5x leverage). Must be >= 1.
|
|
35
|
+
grid_type (integer): Grid spacing type.
|
|
36
|
+
total_investment (string): Initial investment amount in quote currency as decimal string (e.g. '1000' for 1000 USDT).
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
Request results as dictionary.
|
|
40
|
+
|
|
41
|
+
Additional information:
|
|
42
|
+
https://bybit-exchange.github.io/docs/v5/bot/futures-grid/create
|
|
43
|
+
"""
|
|
44
|
+
return self._submit_request(
|
|
45
|
+
method="POST",
|
|
46
|
+
path=f"{self.endpoint}{FGridBot.CREATE_F_GRID_BOT}",
|
|
47
|
+
query=kwargs,
|
|
48
|
+
auth=True,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
def get_f_grid_detail(self, **kwargs):
|
|
52
|
+
"""Get full details of a futures grid bot including PnL, positions, and status.
|
|
53
|
+
|
|
54
|
+
Required args:
|
|
55
|
+
bot_id (integer): The bot ID to query.
|
|
56
|
+
|
|
57
|
+
Returns:
|
|
58
|
+
Request results as dictionary.
|
|
59
|
+
|
|
60
|
+
Additional information:
|
|
61
|
+
https://bybit-exchange.github.io/docs/v5/bot/futures-grid/get-detail
|
|
62
|
+
"""
|
|
63
|
+
return self._submit_request(
|
|
64
|
+
method="POST",
|
|
65
|
+
path=f"{self.endpoint}{FGridBot.GET_F_GRID_DETAIL}",
|
|
66
|
+
query=kwargs,
|
|
67
|
+
auth=True,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
def validate_f_grid_input(self, **kwargs):
|
|
71
|
+
"""Validate futures grid bot input parameters and return allowable ranges.
|
|
72
|
+
|
|
73
|
+
Required args:
|
|
74
|
+
symbol (string): Trading pair symbol (e.g. BTCUSDT).
|
|
75
|
+
cell_number (integer): Number of grid levels (minimum 2).
|
|
76
|
+
min_price (string): Lower price bound of the grid range.
|
|
77
|
+
max_price (string): Upper price bound of the grid range.
|
|
78
|
+
leverage (string): Position leverage, must be >= 1 (e.g. '5').
|
|
79
|
+
grid_type (integer): Grid spacing type.
|
|
80
|
+
grid_mode (integer): Grid strategy direction.
|
|
81
|
+
|
|
82
|
+
Returns:
|
|
83
|
+
Request results as dictionary.
|
|
84
|
+
|
|
85
|
+
Additional information:
|
|
86
|
+
https://bybit-exchange.github.io/docs/v5/bot/futures-grid/validate-input
|
|
87
|
+
"""
|
|
88
|
+
return self._submit_request(
|
|
89
|
+
method="POST",
|
|
90
|
+
path=f"{self.endpoint}{FGridBot.VALIDATE_F_GRID_INPUT}",
|
|
91
|
+
query=kwargs,
|
|
92
|
+
auth=True,
|
|
93
|
+
)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from ._http_manager import _V5HTTPManager
|
|
2
|
+
from .fht import FHT
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class FHTHTTP(_V5HTTPManager):
|
|
6
|
+
def batch_create_tax_reports(self, **kwargs):
|
|
7
|
+
"""Batch create tax report files.
|
|
8
|
+
|
|
9
|
+
Required args:
|
|
10
|
+
startTime (integer): Tax report start time (Unix timestamp, seconds)
|
|
11
|
+
endTime (integer): Tax report end time (Unix timestamp, seconds); interval must not exceed 12 months
|
|
12
|
+
items (array): Non-empty list of tax report export items
|
|
13
|
+
|
|
14
|
+
Returns:
|
|
15
|
+
Request results as dictionary.
|
|
16
|
+
|
|
17
|
+
Additional information:
|
|
18
|
+
https://bybit-exchange.github.io/docs/v5/tax/batch-create
|
|
19
|
+
"""
|
|
20
|
+
return self._submit_request(
|
|
21
|
+
method="POST",
|
|
22
|
+
path=f"{self.endpoint}{FHT.BATCH_CREATE_TAX_REPORTS}",
|
|
23
|
+
query=kwargs,
|
|
24
|
+
auth=True,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
def batch_query_tax_reports(self, **kwargs):
|
|
28
|
+
"""Query batch tax report status.
|
|
29
|
+
|
|
30
|
+
Required args:
|
|
31
|
+
batchId (string): Batch ID returned by `batch_create`
|
|
32
|
+
|
|
33
|
+
Returns:
|
|
34
|
+
Request results as dictionary.
|
|
35
|
+
|
|
36
|
+
Additional information:
|
|
37
|
+
https://bybit-exchange.github.io/docs/v5/tax/batch-query
|
|
38
|
+
"""
|
|
39
|
+
return self._submit_request(
|
|
40
|
+
method="GET",
|
|
41
|
+
path=f"{self.endpoint}{FHT.BATCH_QUERY_TAX_REPORTS}",
|
|
42
|
+
query=kwargs,
|
|
43
|
+
auth=True,
|
|
44
|
+
)
|