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

Kraken Subscription Improvements #1516

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

Conversation

gbjk
Copy link
Collaborator

@gbjk gbjk commented Apr 14, 2024

  • Add Websocket SendMessageReturnResponses
  • Fix convert.TimeFromUnixTimestampDecimal using local
  • Separate auth and non-auth ws tests
  • Move SeedAssets from Setup to Start
    Having SeedAssets in Setup is cruel and unusual because it calls the
    API. Most other interactive data seeding happens in Start.
    This made it so that fixing and creating unit tests for Kraken was
    painfully slow, particularly on flaky internet.
  • Use Websocket subscriptionChannels instead of local slice
  • Remove ChannelID - Deprecated in docs
    I went both ways on this N+ times. ChannelID is great, but the bottom line is that it's deprecated, and not available in auth channels. By moving away from it we futureproof, and there's no downside really. Note that with or without
  • Simplify ping handlers and hardcodes message
  • Add Depth as configurable orderbook channel param
  • Simplify auth/non-auth channel updates

Depends on #1501 and #1505

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-functional improvements)

How has this been tested

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

gbjk added 30 commits March 21, 2024 12:45
If the exchange passed in already has a websocket, don't clobber it
instead of errChannelAlreadySubscribed
Given that some subscriptions have multiple pairs, support that as the
standard.
We deliberately use Equal over Len to avoid spamming the contents of large Slices
Note: This is a naieve implementation because we want to rebase the
kraken websocket rewrite on top of this
* Fixes unauthenticated websocket left as CanUseAuth
* Fixes auth subs happening privately
* Consolidate ProductIDs when all subscriptions are for the same list
@gbjk gbjk added review me This pull request is ready for review nomerge requires dependency This pull request is dependent on another, so it can't be merged until the dependent one is merged labels Apr 14, 2024
@gbjk gbjk self-assigned this Apr 14, 2024
@gbjk gbjk force-pushed the feature/kraken_ws_chans_v3 branch 2 times, most recently from 7ad509c to d45f86a Compare April 15, 2024 03:45
gbjk added 13 commits April 15, 2024 13:41
We were using the "cancel many" facility of the Kraken api.
However since that doesn't actually report errors individually, it seems
saner to just multiplex over it.
We were going to get N+ responses anyway. Might as well send N+ requests
Having SeedAssets in Setup is cruel and unusual because it calls the
API. Most other interactive data seeding happens in Bootstrap.

This made it so that fixing and creating unit tests for Kraken was
painfully slow, particularly on flaky internet.
* Use Websocket subscriptionChannels instead of local slice
* Remove ChannelID - Deprecated in docs
* Simplify ping handlers and hardcodes message
* Add Depth as configurable orderbook channel param
* Simplify auth/non-auth channel updates
* Add configurable Book depth
* Add configurable Candle timeframes
Duplicate of convert_test.go TestTimeFromUnixTimestampDecimal
If we generate one sub for all pairs, but then fan it out in the
responses, we end up with a mis-match between the sub store and
GenerateSubs, and when we do FlushChannels it will try to resub
everything again.

Kraken: Generate N+ subs for pairs

If we generate one sub for all pairs, but then fan it out in the
responses, we end up with a mis-match between the sub store and
GenerateSubs, and when we do FlushChannels it will try to resub
everything again.
@gbjk gbjk force-pushed the feature/kraken_ws_chans_v3 branch from d45f86a to db0f863 Compare April 15, 2024 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nomerge requires dependency This pull request is dependent on another, so it can't be merged until the dependent one is merged review me This pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant