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

feat: add support for depth parameter in orderbook query #6

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

bmuddha
Copy link
Contributor

@bmuddha bmuddha commented Feb 28, 2024

This commit adds new method to DLOBClient, which allows to request orderbook with a required depth. To handle cases when depth is not provided, default constant can be used, which is set to value of 10.

Motivation: currently DLOBClient requests the entirety of orderbook, which contains around 50 levels. Sometimes this can be unecessary, for example if we are only interested in best bid/ask, which is why it can be useful to have an option to control the depth of requested orderbook.

The change shouldn't break anything, except for cases, when more than 10 levels of orderbook are expected.

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.

thanks for PR! the change is good but think we should change the api a little

src/dlob.rs Outdated Show resolved Hide resolved
@bmuddha bmuddha force-pushed the client-orderbook-depth branch from 6866359 to 0045bc2 Compare February 29, 2024 08:53
This commit adds new method to DLOBClient, which allows to request
orderbook with a required depth. To handle cases when depth is not
provided, default constant can be used, which is set to value of 10.

Motivation: currently DLOBClient requests the entirety of orderbook,
which contains around 50 levels. Sometimes this can be unecessary, for
example if we are only interested in best bid/ask, which is why it can
be useful to have an option to control the depth of requested orderbook.
@bmuddha bmuddha force-pushed the client-orderbook-depth branch from 0045bc2 to 1a9f135 Compare February 29, 2024 08:57
@jordy25519 jordy25519 merged commit 212a38a into drift-labs:main Feb 29, 2024
1 check failed
@github-actions github-actions bot mentioned this pull request Mar 6, 2024
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