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

frank/market & oracle maps #17

Merged
merged 21 commits into from
Mar 22, 2024
Merged

frank/market & oracle maps #17

merged 21 commits into from
Mar 22, 2024

Conversation

soundsonacid
Copy link
Contributor

No description provided.

src/lib.rs Outdated Show resolved Hide resolved
@soundsonacid soundsonacid changed the title frank/marketmaps frank/improvements Mar 20, 2024
@soundsonacid soundsonacid changed the title frank/improvements frank/market/oracle maps Mar 20, 2024
@soundsonacid soundsonacid changed the title frank/market/oracle maps frank/market & oracle maps Mar 20, 2024
Copy link
Collaborator

@jordy25519 jordy25519 left a comment

Choose a reason for hiding this comment

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

generally lgtm.
should be doing concurrent awaits where we can since network is the slowest part

self.unsubscriber = Some(unsub_tx);

tokio::spawn({
let event_emitter = self.event_emitter.clone();
Copy link
Collaborator

@jordy25519 jordy25519 Mar 21, 2024

Choose a reason for hiding this comment

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

💭 the shape of the Subscribers is very similar, wonder if we can generalize that

pubkey: Pubkey,
pub(crate) commitment: CommitmentConfig,
pub subscribed: bool,
pub event_emitter: EventEmitter,
Copy link
Collaborator

@jordy25519 jordy25519 Mar 21, 2024

Choose a reason for hiding this comment

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

💭 can try something like EventEmitter<T> to get rid of the any/boxing or a drift-rs wide (concrete) enum

enum Event {
   AccountUpdate(...),
   AuctionUpdate(...),
   // etc.
}

src/marketmap.rs Outdated Show resolved Hide resolved
src/oraclemap.rs Outdated Show resolved Hide resolved
src/oraclemap.rs Outdated Show resolved Hide resolved
src/oraclemap.rs Outdated Show resolved Hide resolved
src/oraclemap.rs Outdated Show resolved Hide resolved
src/oraclemap.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@jordy25519 jordy25519 left a comment

Choose a reason for hiding this comment

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

changes lgtm.
since we're building more infra on top of the websocket_account_subscriber it will need some reconnection logic or surface failed/disconnected status (the other subscribers may have similar issue)

Cargo.toml Outdated Show resolved Hide resolved
src/websocket_account_subscriber.rs Show resolved Hide resolved
@soundsonacid soundsonacid merged commit 2855dd7 into drift-labs:main Mar 22, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants