-
-
Notifications
You must be signed in to change notification settings - Fork 302
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: [max] new method for depth buffer to set snapshot #1835
Conversation
Welcome back! @kbearXD, This pull request may get 221 BBG. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1835 +/- ##
==========================================
+ Coverage 23.08% 23.21% +0.13%
==========================================
Files 625 636 +11
Lines 46942 48087 +1145
==========================================
+ Hits 10837 11165 +328
- Misses 35307 36113 +806
- Partials 798 809 +11
... and 9 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
dbd645a
to
cbd2876
Compare
Re-estimated karma: this pull request may get 261 BBG |
pkg/depth/buffer.go
Outdated
} | ||
|
||
// clean the buffer since we already set the snapshot | ||
b.buffer = nil |
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.
i guess we can still keep the updates?
b.mu.Lock() | ||
|
||
if b.finalUpdateID >= finalUpdateID { | ||
return nil |
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.
unlock before return?
pkg/exchange/max/stream.go
Outdated
Asks: e.Asks, | ||
}, e.FirstUpdateID, e.LastUpdateID); err != nil { | ||
log.WithError(err).Errorf("found missing %s update event", e.Market) | ||
if e.Event == "snapshot" { |
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.
do we have a constant for this? in the maxapi/v3 package.
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, we bypass this to book event.
@@ -75,6 +75,34 @@ func (b *Buffer) Reset() { | |||
b.mu.Unlock() | |||
} | |||
|
|||
func (b *Buffer) SetSnapshot(snapshot types.SliceOrderBook, firstUpdateID int64, finalArgs ...int64) error { |
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.
make it private method?
cbd2876
to
93f68bc
Compare
Re-estimated karma: this pull request may get 326 BBG |
Hi @kbearXD, Well done! 331 BBG has been sent to your polygon wallet. Please check the following tx: https://polygonscan.com/tx/0x01e7cf3cb82d8d7cd3fa7c1ac2f399dbbd9fa49e98281698aae5776c8e6e04eb Thank you for your contribution! |
No description provided.