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

bybit: support categorised channel #1823

Merged
merged 2 commits into from
Mar 6, 2025
Merged

Conversation

junnplus
Copy link
Contributor

@junnplus junnplus commented Mar 3, 2025

PR Description

Enhance Bybit private channel subscription with categorised topics

ref: https://bybit-exchange.github.io/docs/v5/websocket/private/position

Fixes # (issue)

Type of change

Please delete options that are not relevant and add an x in [] as item is complete.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested

go test ./exchanges/bybit -v -run TestGenerateSubscriptions

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration and
also consider improving test coverage whilst working on a certain feature or package.

  • go test ./... -race
  • golangci-lint run
  • Test X

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation and regenerated documentation via the documentation tool
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally and on Github Actions with my changes
  • Any dependent changes have been merged and published in downstream modules

@thrasher- thrasher- added the review me This pull request is ready for review label Mar 4, 2025
Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks heaps @junnplus. Looks good to me! I don't have any funds so incoming changes did not test.

{"req_id":"108432952","success":true,"ret_msg":"","op":"subscribe","conn_id":"cthsbl8f2tdpsfl4bdgg-1hkjbt"}

With payload:

{auth:true RequestID:108432952 Operation:subscribe Arguments:[execution.spot order.spot wallet]

Master outbound which didn't have the specific categorised topic in args:

{auth:true RequestID:122744171 Operation:subscribe Arguments:[execution order wallet]

@@ -65,7 +65,6 @@ var defaultSubscriptions = subscription.List{
{Enabled: true, Asset: asset.Spot, Authenticated: true, Channel: subscription.MyOrdersChannel},
{Enabled: true, Asset: asset.Spot, Authenticated: true, Channel: subscription.MyWalletChannel},
{Enabled: true, Asset: asset.Spot, Authenticated: true, Channel: subscription.MyTradesChannel},
{Enabled: true, Asset: asset.Spot, Authenticated: true, Channel: chanPositions},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: This is associated with linear/inverse/options and can be removed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was going to be my first question 😄

Copy link
Collaborator

@gbjk gbjk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work and useful contribution 🎉

One minor suggestion, but approved as is as well.

Copy link
Collaborator

@gloriousCode gloriousCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK! Thanks for your contribution!

@gloriousCode gloriousCode added the gcrc GloriousCode Review Complete label Mar 5, 2025
@shazbert shazbert added the szrc shazbert review complete label Mar 5, 2025
Copy link
Collaborator

@thrasher- thrasher- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @junnplus for your contributions!

@thrasher- thrasher- merged commit 8f63b0b into thrasher-corp:master Mar 6, 2025
5 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gcrc GloriousCode Review Complete review me This pull request is ready for review szrc shazbert review complete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants