-
-
Notifications
You must be signed in to change notification settings - Fork 269
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: [bitget] support query trades #1400
Conversation
Welcome back! @bailantaotao, This pull request may get 733 BBG. |
pkg/exchange/bitget/exchange.go
Outdated
} | ||
|
||
limit := options.Limit | ||
if limit > queryOrdersLimit || limit <= 0 { |
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 be queryTradesLimit
?
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.
Oh, both the trade and order have a limit of 100, so I am using it. I will rename it to queryLimit
.
if err := queryTradeRateLimiter.Wait(ctx); err != nil { | ||
return nil, fmt.Errorf("trade rate limiter wait error: %w", err) | ||
} |
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.
How about moving this rate limit check to the beginning of this function?
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.
The thought is to call it before req.Do, so that we can stay near the rate limit.
req := e.v2Client.NewGetTradeFillsRequest() | ||
req.Symbol(symbol) | ||
|
||
if options.StartTime != nil { |
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.
if both StartTime and EndTime are given, you will need to check the time range?
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.
Please ensure the end >= start
if both conditions are given
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.
I was just thinking that the caller should use batch.TradeBatchQuery, so I missed this part.
9fa92e0
to
87d05cd
Compare
Re-estimated karma: this pull request may get 818 BBG |
8b96e85
to
7326e7f
Compare
87d05cd
to
2f94923
Compare
Re-estimated karma: this pull request may get 822 BBG |
7326e7f
to
ec256c5
Compare
2f94923
to
ae3f68d
Compare
Re-estimated karma: this pull request may get 827 BBG |
ae3f68d
to
4bcddea
Compare
Re-estimated karma: this pull request may get 833 BBG |
bcf1691
to
cb5e305
Compare
4bcddea
to
cc7466a
Compare
Re-estimated karma: this pull request may get 838 BBG |
cc7466a
to
b14c3ea
Compare
Re-estimated karma: this pull request may get 843 BBG |
b14c3ea
to
a26b158
Compare
Re-estimated karma: this pull request may get 848 BBG |
Codecov Report
@@ Coverage Diff @@
## main #1400 +/- ##
==========================================
+ Coverage 21.24% 21.28% +0.03%
==========================================
Files 576 577 +1
Lines 41707 41802 +95
==========================================
+ Hits 8862 8898 +36
- Misses 32200 32256 +56
- Partials 645 648 +3
Continue to review full report in Codecov by Sentry.
|
Hi @bailantaotao, Well done! 858 BBG has been sent to your polygon wallet. Please check the following tx: https://polygonscan.com/tx/0xc4f5cf5b14184e58820f09abc817247f504160d57b62f23beb4523f0ad2af899 Thank you for your contribution! |
https://www.bitget.com/api-doc/spot/trade/Get-Fills