c9s / bbgo

The modern cryptocurrency trading bot framework written in Go.
https://bbgo.finance
GNU Affero General Public License v3.0
1.18k stars 283 forks source link

FIX: [okx] refine okx rate limiter #1534

Closed bailantaotao closed 6 months ago

bailantaotao commented 6 months ago
request failed with status code: 429, body: "{\"msg\":\"Too Many Requests\",\"code\":\"50011\"

In the past, I allowed a maximum of N buckets in the rate limiter, but OKX seems to have a strict restriction, leading to issues with the rate limiter. Therefore, I have now updated the value to 1.

bbgokarma-bot commented 6 months ago

Welcome back! @bailantaotao, This pull request may get 212 BBG.

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (7436a7e) 21.77% compared to head (f135b6d) 21.77%. Report is 7 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/c9s/bbgo/pull/1534/graphs/tree.svg?width=650&height=150&src=pr&token=ZT7I56OV8K&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin)](https://app.codecov.io/gh/c9s/bbgo/pull/1534?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin) ```diff @@ Coverage Diff @@ ## main #1534 +/- ## ======================================= Coverage 21.77% 21.77% ======================================= Files 606 606 Lines 43939 43939 ======================================= Hits 9566 9566 Misses 33691 33691 Partials 682 682 ``` | [Files](https://app.codecov.io/gh/c9s/bbgo/pull/1534?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin) | Coverage Δ | | |---|---|---| | [pkg/exchange/okex/exchange.go](https://app.codecov.io/gh/c9s/bbgo/pull/1534?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin#diff-cGtnL2V4Y2hhbmdlL29rZXgvZXhjaGFuZ2UuZ28=) | `0.00% <ø> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/c9s/bbgo/pull/1534?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/c9s/bbgo/pull/1534?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin). Last update [7436a7e...f135b6d](https://app.codecov.io/gh/c9s/bbgo/pull/1534?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin).
bbgokarma-bot commented 6 months ago

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

bbgokarma-bot commented 6 months ago

Hi @bailantaotao,

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

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

Thank you for your contribution!