-
-
Notifications
You must be signed in to change notification settings - Fork 299
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: [okx] query recent trades #1583
Conversation
Welcome back! @bailantaotao, This pull request may get 1097 BBG. |
cc32a3c
to
2ae1933
Compare
Re-estimated karma: this pull request may get 1102 BBG |
@@ -55,6 +55,7 @@ const ( | |||
defaultQueryLimit = 100 | |||
|
|||
maxHistoricalDataQueryPeriod = 90 * 24 * time.Hour | |||
threeDaysHistoricalPeriod = 3 * 24 * time.Hour |
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.
use maxTradeHistoryPeriod ?
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.
We already have one that supports 90 days, called maxHistoricalDataQueryPeriod
.
And now we have another one that's only 3 days, so it's called threeDaysHistoricalPeriod
XD.
|
||
var newStartTime time.Time | ||
timeNow := e.timeNowFunc() |
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.
can be just now
?
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.
No, by using that timeNowFunc()
, we can test the function.
@@ -53,13 +53,13 @@ type Trade struct { | |||
PosSide string `json:"posSide"` | |||
} | |||
|
|||
//go:generate GetRequest -url "/api/v5/trade/fills-history" -type GetTransactionHistoryRequest -responseDataType []Trade | |||
//go:generate GetRequest -url "/api/v5/trade/fills-history" -type GetTransactionHistoryRequest -responseDataType []Trade -rateLimiter 1+10/2s |
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.
sooo cool!!!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1583 +/- ##
==========================================
+ Coverage 22.44% 22.53% +0.08%
==========================================
Files 615 617 +2
Lines 44463 44480 +17
==========================================
+ Hits 9981 10023 +42
+ Misses 33770 33742 -28
- Partials 712 715 +3
... and 7 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Hi @bailantaotao, Well done! 1162 BBG has been sent to your polygon wallet. Please check the following tx: https://polygonscan.com/tx/0x114ebd9e418077538489a6ad84d0c14b8d9a98a4a474707e59ace94e58ee99d2 Thank you for your contribution! |
The historical trade API has a high rate limiter cost (10/2s),
so I have introduced a new recent trade API to address this. If the start time is less than or equal to 3 days, we will utilize the recent trade API.