thrasher-corp / gocryptotrader

A cryptocurrency trading bot and framework supporting multiple exchanges written in Golang.
MIT License
2.96k stars 792 forks source link

exchanges: abstract websocket/REST orderbook initial update code from wrapper to exchanges package. #1481

Open shazbert opened 5 months ago

shazbert commented 5 months ago

PR Description

Type of change

Please delete options that are not relevant and add an x in [] as item is complete.

How has this been tested

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration and also consider improving test coverage whilst working on a certain feature or package.

Checklist

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 73.60595% with 71 lines in your changes are missing coverage. Please review.

Project coverage is 35.88%. Comparing base (4cd4fb0) to head (0f4be56).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1481/graphs/tree.svg?width=650&height=150&src=pr&token=41784B23TS&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp)](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1481?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp) ```diff @@ Coverage Diff @@ ## master #1481 +/- ## ========================================== - Coverage 37.80% 35.88% -1.92% ========================================== Files 409 411 +2 Lines 147712 177260 +29548 ========================================== + Hits 55841 63616 +7775 - Misses 84005 105792 +21787 + Partials 7866 7852 -14 ``` | [Files](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1481?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp) | Coverage Δ | | |---|---|---| | [exchanges/binance/binance.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1481?src=pr&el=tree&filepath=exchanges%2Fbinance%2Fbinance.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2JpbmFuY2UvYmluYW5jZS5nbw==) | `45.19% <ø> (-3.13%)` | :arrow_down: | | [exchanges/binanceus/binanceus\_websocket.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1481?src=pr&el=tree&filepath=exchanges%2Fbinanceus%2Fbinanceus_websocket.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2JpbmFuY2V1cy9iaW5hbmNldXNfd2Vic29ja2V0Lmdv) | `43.94% <100.00%> (-3.32%)` | :arrow_down: | | [exchanges/btcmarkets/btcmarkets\_websocket.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1481?src=pr&el=tree&filepath=exchanges%2Fbtcmarkets%2Fbtcmarkets_websocket.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2J0Y21hcmtldHMvYnRjbWFya2V0c193ZWJzb2NrZXQuZ28=) | `39.63% <100.00%> (-3.76%)` | :arrow_down: | | [exchanges/bybit/bybit\_websocket.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1481?src=pr&el=tree&filepath=exchanges%2Fbybit%2Fbybit_websocket.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2J5Yml0L2J5Yml0X3dlYnNvY2tldC5nbw==) | `46.81% <100.00%> (-3.99%)` | :arrow_down: | | [exchanges/coinut/coinut\_websocket.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1481?src=pr&el=tree&filepath=exchanges%2Fcoinut%2Fcoinut_websocket.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2NvaW51dC9jb2ludXRfd2Vic29ja2V0Lmdv) | `25.79% <100.00%> (-2.18%)` | :arrow_down: | | [exchanges/hitbtc/hitbtc\_websocket.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1481?src=pr&el=tree&filepath=exchanges%2Fhitbtc%2Fhitbtc_websocket.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2hpdGJ0Yy9oaXRidGNfd2Vic29ja2V0Lmdv) | `25.42% <100.00%> (-2.84%)` | :arrow_down: | | [exchanges/kucoin/kucoin\_websocket.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1481?src=pr&el=tree&filepath=exchanges%2Fkucoin%2Fkucoin_websocket.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2t1Y29pbi9rdWNvaW5fd2Vic29ja2V0Lmdv) | `54.26% <100.00%> (-4.32%)` | :arrow_down: | | [exchanges/orderbook/depth.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1481?src=pr&el=tree&filepath=exchanges%2Forderbook%2Fdepth.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL29yZGVyYm9vay9kZXB0aC5nbw==) | `100.00% <100.00%> (ø)` | | | [exchanges/poloniex/poloniex\_websocket.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1481?src=pr&el=tree&filepath=exchanges%2Fpoloniex%2Fpoloniex_websocket.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL3BvbG9uaWV4L3BvbG9uaWV4X3dlYnNvY2tldC5nbw==) | `50.79% <100.00%> (-3.26%)` | :arrow_down: | | [exchanges/stream/buffer/buffer.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1481?src=pr&el=tree&filepath=exchanges%2Fstream%2Fbuffer%2Fbuffer.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL3N0cmVhbS9idWZmZXIvYnVmZmVyLmdv) | `65.93% <100.00%> (-3.34%)` | :arrow_down: | | ... and [3 more](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1481?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp) | | ... and [377 files with indirect coverage changes](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1481/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp)