Skip to content

Releases: bybit-exchange/pybit

2.3.0

24 Jun 17:10
43cf700
Compare
Choose a tag to compare

[2.3.0] - 2022-06-24

Added

  • HTTP methods for the spot API's Leveraged Token and Cross Margin endpoints
  • agentSource parameter when sending requests to place spot orders, which uses the referral_id argument, so that affiliates can track orders

2.2.3

23 Jun 09:44
b4eb0a8
Compare
Choose a tag to compare

[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 to 0. pybit will wait 1 second between each retry.

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 to WebSocket 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

07 Jun 11:10
1b57107
Compare
Choose a tag to compare

[2.2.1] - 2022-06-07

Modified

  • usdt_perpetual -> get_risk_limit() to not require authentication

Fixed

  • usdt_perpetual -> add_reduce_margin() to use the correct request method

2.2.0

25 May 16:44
6adfe52
Compare
Choose a tag to compare

[2.2.0] - 2022-05-25

Added

  • USDC options WebSocket and HTTP classes
  • Deposit/withdrawal endpoints to account_asset module

2.1.2

05 May 15:58
280f690
Compare
Choose a tag to compare

[2.1.2] - 2022-05-05

Fixed

  • Initiating a WSS object without an api_key or api_secret for objects that create multiple WSS connections
  • Error thrown when processing WSS orderbook

2.1.1

30 Apr 20:37
4e3bf31
Compare
Choose a tag to compare

[2.1.1] - 2022-04-30

Added

  • USDC perpetual WebSocket and HTTP 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

08 Apr 16:50
a0fceeb
Compare
Choose a tag to compare

[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

17 Mar 15:37
Compare
Choose a tag to compare

[2.0.1] - 2022-03-17

Added

  • record_request_time arg to HTTP classes which, if true, returns the response dictionary in a tuple with the request elapsed time - as recorded by requests

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

09 Mar 13:54
e6452d2
Compare
Choose a tag to compare

[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 and WebSocket 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 like get_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
    • 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 to pybit yet
  • 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
  • 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())
  • 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