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
gbjk
wants to merge
71
commits into
thrasher-corp:master
Choose a base branch
from
gbjk:feature/kraken_ws_chans_v3
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Currencies: Fix Pairs.Equal comparing Delimiter Can't think of a case where we care about case or delimiter when we're using this new function, so making it Loose since that matches our current use case.
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
force-pushed
the
feature/kraken_ws_chans_v3
branch
2 times, most recently
from
April 15, 2024 03:45
7ad509c
to
d45f86a
Compare
3 tasks
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
All parsed times should be in UTC
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
force-pushed
the
feature/kraken_ws_chans_v3
branch
from
April 15, 2024 06:42
d45f86a
to
db0f863
Compare
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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
Depends on #1501 and #1505
Type of change
How has this been tested