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: speedup symbol lookup in trade stream #473

Merged
merged 2 commits into from
Oct 29, 2019

Conversation

vslee
Copy link
Collaborator

@vslee vslee commented Oct 29, 2019

  • Kraken uses special symbols (ADA/CAD rather than ADACAD)
  • a recent bugfix fa2534e now sets the WS name as an alternate name
  • the ExchangeMarket is looked up for each symbol name to pull out the alternate name
  • while it attempts to use caching, it is not actually able to use the cache, bc once it hits the await MakeJsonRequestAsync(), the next select statement progresses so OnGetMarketSymbolsMetadataAsync() is called for every symbol
  • by priming the cache first, this allows the cache to populate first before the select statement, thus hitting OnGetMarketSymbolsMetadataAsync() once
  • this is a hacky way to fix this problem, unless @jjxtra can think of a more elegant way?

- Kraken uses special symbols (ADA/CAD rather than ADACAD)
- a recent bugfix fa2534e now sets the WS name as an alternate name
- this ExchangeMarket is looked up for each symbol name to pull out the alternate name
- while it attempts to use caching, it is not actually able to use the cache, bc once it hits the await MakeJsonRequestAsync() in OnGetMarketSymbolsMetadataAsync(), the next select statement progresses so OnGetMarketSymbolsMetadataAsync() is called for every symbol
- by priming the cache first, this allows the cache to populate first before the select statement, thus hitting OnGetMarketSymbolsMetadataAsync() once
@vslee vslee requested a review from jjxtra October 29, 2019 03:28
@jjxtra
Copy link
Collaborator

jjxtra commented Oct 29, 2019

Could we just call OnGetMarketSymbolsMetadataAsync to prime the cache instead?

@vslee
Copy link
Collaborator Author

vslee commented Oct 29, 2019

I tried that, but that doesn't seem to prime it...

@jjxtra
Copy link
Collaborator

jjxtra commented Oct 29, 2019

Maybe just await PopulateExchangeMarketsAsync(false); is needed

@vslee
Copy link
Collaborator Author

vslee commented Oct 29, 2019

that works

@vslee vslee merged commit 0d1c82a into DigitalRuby:master Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants