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

FEATURE: [max] add QueryDepth v3 API to query orderbook #1760

Merged
merged 2 commits into from
Oct 4, 2024

Conversation

kbearXD
Copy link
Collaborator

@kbearXD kbearXD commented Oct 1, 2024

No description provided.

@bbgokarma-bot
Copy link

Welcome back! @kbearXD, This pull request may get 486 BBG.

return convertDepth(symbol, depth)
}

func convertDepth(symbol string, depth *v3.Depth) (snapshot types.SliceOrderBook, finalUpdateID int64, err error) {
Copy link
Owner

Choose a reason for hiding this comment

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

move this to convert.go ?

@@ -1134,6 +1134,36 @@ func (e *Exchange) QueryKLines(
return kLines, nil
}

func (e *Exchange) QueryDepth(ctx context.Context, symbol string, limit int) (snapshot types.SliceOrderBook, finalUpdateID int64, err error) {
req := e.v3client.NewGetDepthRequest()
req.Market(symbol)
Copy link
Owner

Choose a reason for hiding this comment

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

should we sort by price?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

default it's true, I think both options are fine ?

@bbgokarma-bot
Copy link

Re-estimated karma: this pull request may get 526 BBG

@kbearXD kbearXD merged commit a548596 into main Oct 4, 2024
3 checks passed
@kbearXD kbearXD deleted the chiahung/max/query-depth branch October 4, 2024 05:11
@bbgokarma-bot
Copy link

Hi @kbearXD,

Well done! 531 BBG has been sent to your polygon wallet. Please check the following tx:

https://polygonscan.com/tx/0x929f338acd3d747ea560f2316be82451d81f8a3e23993bfa818be9740c127a4d

Thank you for your contribution!

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.

3 participants