Skip to content
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 market trade stream #1347

Merged

Conversation

bailantaotao
Copy link
Collaborator

@bailantaotao bailantaotao commented Oct 19, 2023

@bbgokarma-bot
Copy link

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

@bbgokarma-bot
Copy link

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

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Merging #1347 (a18b1be) into main (f8c47f7) will increase coverage by 0.05%.
The diff coverage is 43.56%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1347      +/-   ##
==========================================
+ Coverage   20.76%   20.81%   +0.05%     
==========================================
  Files         566      566              
  Lines       40357    40454      +97     
==========================================
+ Hits         8380     8422      +42     
- Misses      31368    31421      +53     
- Partials      609      611       +2     
Files Coverage Δ
pkg/exchange/bitget/stream_callbacks.go 0.00% <0.00%> (ø)
pkg/exchange/bitget/stream.go 32.37% <46.66%> (+2.90%) ⬆️
pkg/exchange/bitget/types.go 42.22% <46.15%> (+11.45%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8c47f7...a18b1be. Read the comment docs.

{
Asks: []types.PriceVolume{
{
Price: fixedpoint.NewFromFloat(28350.78),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can check the number() function, I think you can make a copy here for writing the tests

it helps you to create fixedpoint value object with just number(3200.0) or number("3200.0"

@@ -523,6 +523,7 @@ const (
DepthLevelMedium Depth = "MEDIUM"
DepthLevel1 Depth = "1"
DepthLevel5 Depth = "5"
DepthLevel15 Depth = "15"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's time to define the supported depth function for each exchange


type MarketTradeSlice []MarketTrade

func (m *MarketTradeSlice) UnmarshalJSON(b []byte) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a guard to avoid m==nil?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I have added it . Avoid stepping on landmines in the future.

Comment on lines 256 to 257
Type ActionType
InstId string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible make these two fields private (starting with lowercase)?

Copy link
Collaborator

@gx578007 gx578007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others LGTM

@bailantaotao bailantaotao force-pushed the edwin/bitget/public-stream-trade branch from 997cbf0 to a18b1be Compare October 20, 2023 08:42
@bbgokarma-bot
Copy link

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

@bailantaotao bailantaotao merged commit 09e2b84 into c9s:main Oct 20, 2023
4 checks passed
@bbgokarma-bot
Copy link

Hi @bailantaotao,

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

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

Thank you for your contribution!

@bailantaotao bailantaotao deleted the edwin/bitget/public-stream-trade branch October 20, 2023 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants