-
-
Notifications
You must be signed in to change notification settings - Fork 302
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
Conversation
Welcome back! @kbearXD, This pull request may get 486 BBG. |
pkg/exchange/max/exchange.go
Outdated
return convertDepth(symbol, depth) | ||
} | ||
|
||
func convertDepth(symbol string, depth *v3.Depth) (snapshot types.SliceOrderBook, finalUpdateID int64, err error) { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ?
Re-estimated karma: this pull request may get 526 BBG |
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! |
No description provided.