Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Bybit's v3 APIs (3.0.0) #85

Merged
merged 24 commits into from
Mar 1, 2023
Merged

Upgrade to Bybit's v3 APIs (3.0.0) #85

merged 24 commits into from
Mar 1, 2023

Conversation

dextertd
Copy link
Collaborator

@dextertd dextertd commented Jan 4, 2023

No description provided.

@dextertd
Copy link
Collaborator Author

dextertd commented Jan 4, 2023

This is a work in progress and will not be merged imminently.

@dextertd
Copy link
Collaborator Author

dextertd commented Jan 11, 2023

Closes #77

@ervuks
Copy link

ervuks commented Jan 31, 2023

@dextertd WDYT, should API reference URL's be included in the codebase as well?
Are there any topics where help would be needed?

@dextertd
Copy link
Collaborator Author

dextertd commented Feb 1, 2023

@ervuks Yes links to the API docs should be included in the docstring of each method but Bybit's API docs will imminently be moving to a new address so it would be wasted work to add the existing doc URLs (they might not all redirect properly).

I'm currently working on adding copy trading. If you want to help with other topics, one thing would be to help update the example files for v3, my limited time means I have been focusing on implementing the APIs/WS rather than documenting them properly.

Pybit examples will be added to Bybit's new documentation in any case, but fixing the examples in the repo won't hurt.

@ervuks
Copy link

ervuks commented Feb 2, 2023

Is the webhook part finished already?
Tried to make some examples, but ran into different problems with domain/topics.

@dextertd
Copy link
Collaborator Author

dextertd commented Feb 2, 2023

Is the webhook part finished already? Tried to make some examples, but ran into different problems with domain/topics.

Presuming you mean websocket part, yes it should work for all the modules. Can you share the specific errors here please?

@ervuks
Copy link

ervuks commented Feb 2, 2023

mar = unified_margin.WebSocket(
    testnet=True,
    api_key="...",  
    api_secret="...",
)

mar.orderbook_stream(
    callback=handle_orderbook,
    symbol="BTCUSDT",
    level="100"
)

Those are parts from the error message:

Couldn't subscribe to topic.Error: error:handler not found,topic:orderbook.100.BTCUSDT.
Exception in thread Thread-1 (<lambda>):
  File "/Users/epatmalnieks/git/crypto/pybit/pybit/_websocket_stream.py", line 460, in _extract_topic
    return topic_without_symbol[0]
TypeError: 'NoneType' object is not subscriptable
^CTraceback (most recent call last):
  File "/Users/epatmalnieks/git/crypto/pybit/test_file.py", line 40, in <module>
    sleep(1)

@ervuks
Copy link

ervuks commented Feb 3, 2023

@dextertd I just found out that there's Bybit V5 API available.
Perhaps it would be worth to directly upgrade to latest one?

@dextertd dextertd mentioned this pull request Feb 20, 2023
@dextertd
Copy link
Collaborator Author

dextertd commented Mar 1, 2023

Merging this as it is really the latest main version of pybit. However, upgrade to v5 is imminent, and will soon supersede v3. The latest pybit version is 3.0.0rc5, and the first version of v5 will be 5.0.0rc0 (stay in line with Bybit's API, which doesn't have a v4).

@dextertd dextertd merged commit df32cc4 into master Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants