Releases: bybit-exchange/pybit
Releases · bybit-exchange/pybit
2.3.0
[2.3.0] - 2022-06-24
Added
HTTP
methods for the spot API's Leveraged Token and Cross Margin endpointsagentSource
parameter when sending requests to place spot orders, which uses thereferral_id
argument, so that affiliates can track orders
2.2.3
[2.2.3] - 2022-06-22
- There was a packaging problem with the previous version. There are no changes compared with 2.2.2.
[2.2.2] - 2022-06-22 [YANKED]
- See below release candidates for further changes. TLDR: Improved WebSocket stability and reconnection logic.
Added
retries
argument so that users specify how many times the WSS tries to reconnect upon disconnection- The default is
10
. To retry forever, set it to0
. pybit will wait 1 second between each retry.
- The default is
Modified
- Improved the logging around WSS disconnection
[2.2.2rc2] - 2022-06-15
Added
- WSS topic resubscription so that when a WSS connection is dropped and then reconnected it should resume pushing the same data as before. Essentially, completes the expected functionality of reconnecting to the WSS.
Modified
is_connected()
function to work with modules that utilise >1 WSS connections
[2.2.2rc1] - 2022-06-10
Added
is_connected()
function toWebSocket
class so that you can check if your WSS connection is alive
Fixed
- Bug where, upon WSS disconnection, pybit rapidly tries to re-establish the connection, which results in being banned by the CDN for malicious activity
[2.2.2rc0] - 2022-06-10
Modified
- Improved HTTP error handling and logging to ease troubleshooting
2.2.1
2.2.0
2.1.2
2.1.1
[2.1.1] - 2022-04-30
Added
- USDC perpetual
WebSocket
andHTTP
classes - USDT perpetual
extended_user_trade_records()
method
Modified
- Expose all WebSocket arguments to users (fixing the previous "wonky and unintuitive" implementation by simplifying the inheritance design)
- See below release candidates for details.
[2.1.1rc0] - 2022-04-14
Modified
- Added arg (
trace_logging
) to enable websocket-client's trace logging, which reveals extra debug information regarding the websocket connection, including the raw sent & received messages- Note: the code implementation is a little wonky and unintuitive, and will be refined as much as possible before the proper release - although the functionality will remain the same.
2.1.0
[2.1.0] - 2022-04-08
Fixed
- The processing of
instrument_info
WebSocket messages so that the user receive a"type": "snapshot"
every time, rather than having to do their own delta/snapshot processing - Fix
AttributeError: '_FuturesWebSocketManager' object has no attribute 'endpoint'
when attempting reconnect
2.0.1
[2.0.1] - 2022-03-17
Added
record_request_time
arg toHTTP
classes which, if true, returns the response dictionary in a tuple with the request elapsed time - as recorded byrequests
Changed
websocket_example.py
to demonstrate callbacks clearly- the license to reflect the transition to bybit-exchange
Fixed
JSONDecodeError
when trying to subscribe to a spot private WSS stream
2.0.0
[2.0.0] - 2022-03-09
Added
- New modules for each API as part of a restructuring effort:
inverse_perpetual.py
,usdt_perpetual.py
,spot.py
, and more- see the README for how to import these new modules
HTTP
andWebSocket
classes within each applicable module- These classes use inheritance to reflect the structure of the Bybit APIs - due to the division of endpoints along the lines of different market types
- This means that different classes can share their common endpoints, such as
api_key_info()
, whilst keeping their distinctive endpoints likeget_active_order()
separate
Changed
WebSocket
functionality to use callbacks instead of polling- This means that instead of polling
ws.fetch()
for your latest websocket messages, you can now simply define a function (my_callback_function
), and pass this as an argument upon subscribing to your chosen topic- see the example file for more information
- This also removes the need to remember topic names and JSON formats, as you now directly call a class method to subscribe
- There is also a
custom_topic_stream
method which can be used if a new websocket topic has been released by Bybit, but it's not been added topybit
yet
- This means that instead of polling
HTTP
classes will now instantiate a new HTTP session for each API (Spot (spot.HTTP
), Account Asset (account_asset.HTTP
), etc)- this is due to the restructuring of
pybit
to use class inheritance
- this is due to the restructuring of
- Generally, the restructuring has allowed a great amount of segregation of the internal code to occur, which will allow for easier future development
Removed
- The
WebSocket
class from the__init__.py
file, which was imported like so:from pybit import WebSocket
- This is because of the aforementioned functionality changes, which also have the potential to improve performance (as a core no longer needs to be occupied polling
ws.fetch()
)
- This is because of the aforementioned functionality changes, which also have the potential to improve performance (as a core no longer needs to be occupied polling
- However, the
HTTP
class was not removed from__init__.py
in an effort to provide a unified alternative- Despite this, we would recommend preferring the market-specific modules