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

Kucoin: Margin sub fix and improvements #1761

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gbjk
Copy link
Collaborator

@gbjk gbjk commented Dec 23, 2024

  • Fixes margin-only subscriptions not subscribing to the enabled spot asset pairs, despite there being no enabled spot sub
  • All margin pairs are merged to the spot subscription, if there is one, reducing the number of subscriptions
  • Require/Assert wording fixed in kucoin test

Fixes #1755

Use case

As a GCT user with spot and margin assets enabled, but only margin asset enabled websocket subscriptions, I should still get subscriptions for all the pairs in margin which are also in spot Currently it only works when spot subscriptions are enabled. Otherwise the spot pairs are ignored.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this been tested

  • go test ./... -race
  • golangci-lint run
  • TestGenerateMarginSubscriptions

As a GCT user with spot and margin assets enabled, but only margin asset enabled websocket subscriptions,
I should still get subscriptions for all the pairs in margin which are also in spot
Currently it only works when spot subscriptions are enabled. Otherwise the spot pairs are ignored.

Fixes thrasher-corp#1755
@gbjk gbjk added bug review me This pull request is ready for review labels Dec 23, 2024
@gbjk gbjk self-assigned this Dec 23, 2024
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.36%. Comparing base (50448ec) to head (d4ac07b).
Report is 8 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1761      +/-   ##
==========================================
- Coverage   37.37%   37.36%   -0.01%     
==========================================
  Files         415      415              
  Lines      178627   178660      +33     
==========================================
- Hits        66760    66758       -2     
- Misses     104089   104119      +30     
- Partials     7778     7783       +5     
Files with missing lines Coverage Δ
exchanges/kucoin/kucoin_websocket.go 57.56% <100.00%> (+1.06%) ⬆️

... and 17 files with indirect coverage changes

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, nothing from me, tACK unauth.

exchanges/kucoin/kucoin_websocket.go Outdated Show resolved Hide resolved
exchanges/kucoin/kucoin_websocket.go Show resolved Hide resolved
@gbjk gbjk requested a review from gloriousCode December 31, 2024 06:07
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!

@gloriousCode gloriousCode added the gcrc GloriousCode Review Complete label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug gcrc GloriousCode Review Complete review me This pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kucoin: Margin only-subs don't subscribe to spot pairs
3 participants