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] fix trade id #1530

Closed bailantaotao closed 6 months ago

bailantaotao commented 7 months ago

In the past, I used the bill ID as the trade ID because OKX only supports querying trades by bill ID. However, the bill ID is not supported on websocket events.

I updated the implementation, handling the bill ID as a filter in the loop instead of getting the ID from outside, even if you use batch.query.

bbgokarma-bot commented 7 months ago

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

codecov[bot] commented 7 months ago

Codecov Report

Attention: 25 lines in your changes are missing coverage. Please review.

Comparison is base (d34a410) 21.78% compared to head (262c05f) 21.77%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/c9s/bbgo/pull/1530/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/1530?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 #1530 +/- ## ========================================== - Coverage 21.78% 21.77% -0.02% ========================================== Files 606 606 Lines 43931 43941 +10 ========================================== - Hits 9569 9566 -3 - Misses 33680 33693 +13 Partials 682 682 ``` | [Files](https://app.codecov.io/gh/c9s/bbgo/pull/1530?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/convert.go](https://app.codecov.io/gh/c9s/bbgo/pull/1530?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin#diff-cGtnL2V4Y2hhbmdlL29rZXgvY29udmVydC5nbw==) | `31.51% <100.00%> (-0.66%)` | :arrow_down: | | [pkg/exchange/okex/exchange.go](https://app.codecov.io/gh/c9s/bbgo/pull/1530?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% <0.00%> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/c9s/bbgo/pull/1530?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/1530?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin). Last update [d34a410...262c05f](https://app.codecov.io/gh/c9s/bbgo/pull/1530?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

Hi @bailantaotao,

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

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

Thank you for your contribution!