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

Fqsns #295

Merged
merged 26 commits into from
Apr 11, 2022
Merged

Fqsns #295

merged 26 commits into from
Apr 11, 2022

Conversation

goodboy
Copy link
Contributor

@goodboy goodboy commented Apr 8, 2022

fqsn = "fully qualified symbol name"

Basically the idea here is for all client-ish code (aka programs/actors that ask the provider agnostic layers in the stack for data) should be able to tell which backend / venue / derivative each data feed/flow is from by an explicit string key of the current form <instrumentname>.<venue>.<suffixwithmetadata>.<brokerbackendname>.

I have thoughts that we should actually change this to be more like an "attr lookup" (like how the web should have done urls, but marketting peeps ruined it etc. etc.):

<broker>.<venue>.<instrumentname>.<suffixwithmetadata>

This preps for new derivatives search support in the ib backend coming in #294 (which will get rebased and likely renamed after this).


Moar,

  • there's some fixes to the data (feed) layer to be more tolerant to IPC failures
  • there might be some dependency custom fork changes i have to include, gotta dig through what's missing - CI and all..

@goodboy goodboy requested review from guilledk and iamzoltan April 8, 2022 17:36
@goodboy
Copy link
Contributor Author

goodboy commented Apr 8, 2022

Bleh, CI is actually failing due to this change:

requirements.txt (line 4))
  Cloning git://github.com/goodboy/tractor.git (to revision master) to ./src/tractor
  Running command git clone --filter=blob:none --quiet git://github.com/goodboy/tractor.git /home/runner/work/piker/piker/src/tractor
  fatal: remote error:
    The unauthenticated git protocol on port 9418 is no longer supported.
  Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

So i guess even more hassle to test things 😂

@goodboy goodboy added the data-layer real-time and historical data processing and storage label Apr 9, 2022
Copy link
Contributor

@iamzoltan iamzoltan left a comment

Choose a reason for hiding this comment

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

looks good to me. mainly some docs on the new nomenclature as well as a func name change for clarity.

I dig it.

@@ -18,9 +18,9 @@
Kraken backend.

"""
from contextlib import asynccontextmanager
from contextlib import asynccontextmanager as acm
Copy link
Contributor

Choose a reason for hiding this comment

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

this is definitely cleaner

goodboy added 23 commits April 10, 2022 17:30
Allocate and `.started()` return the `ShmArray` from here as well in
prep for tsdb integration.
In order to support instruments with lifetimes (aka derivatives) we need
generally need special symbol annotations which detail such meta data
(such as `MNQ.GLOBEX.20220717` for daq futes). Further there is really
no reason for the public api for this feed layer to care about getting
a special "brokername" field since generally the data is coming directly
from UIs (eg. search selection) so we might as well accept a fqsn (fully
qualified symbol name) which includes the broker name; for now a suffix
like `'.ib'`. We may change this schema (soon) but this at least gets us
to a point where we expect the full name including broker/provider.

An additional detail: for certain "generic" symbol names (like for
futes) we will pull a so called "front contract" and map this to
a specific fqsn underneath, so there is a double (cached) entry for that
entry such that other consumers can use it the same way if desired.

Some other machinery changes:
- expect the `stream_quotes()` endpoint to deliver it's `.started()` msg
  almost immediately since we now need it deliver any fqsn asap (yes
  this means the ep should no longer wait on a "live" first quote and
  instead deliver what quote data it can right away.
- expect the quotes ohlc sampler task to add in the broker name before
  broadcast to remote (actor) consumers since the backend isn't (yet)
  expected to do that add in itself.
- obviously we start using all the new fqsn related `Symbol` apis
Use fqsn as input to the client-side EMS apis but strip broker-name
stuff before generating and sending `Brokerd*` msgs to each backend for
live order requests (since it's weird for a backend to expect it's own
name, though maybe that could be a sanity check?).

Summary of fqsn use vs. broker native keys:
- client side pps, order requests and general UX for order management
  use an fqsn for tracking
- brokerd side order dialogs use the broker-specific symbol which is
  usually nearly the same key minus the broker name
- internal dark book and quote feed lookups use the fqsn where possible
- move to 3.9+ type annots
- add initial draft `open_history_client()` endpoints
- deliver `'fqsn'` keys in quote-stream init msgs
Copy link
Contributor

@iamzoltan iamzoltan left a comment

Choose a reason for hiding this comment

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

looks gouda to me my dude

Basically the idea here is for all client-ish code (aka programs/actors
that ask the provider agnostic layers in the stack for data) should be
able to tell which backend / venue / derivative each data feed/flow is
from by an explicit string key of the current form:
Copy link
Contributor

Choose a reason for hiding this comment

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

hot hot hot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data-layer real-time and historical data processing and storage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants