-
-
Notifications
You must be signed in to change notification settings - Fork 345
FEATURE: [xmaker] custom hedge method support #2061
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
Conversation
6ea989b
to
84becc5
Compare
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.
Pull Request Overview
Adds support for configurable hedging methods in the xmaker strategy by introducing a new HedgeMarket and executor system, refactors orderbook depth handling, and aligns mock interfaces.
- Refactored DepthBook to accept dynamic depths and updated related calls.
- Introduced
HedgeMarketConfig
withHedgeExecutor
implementations for market and counterparty methods. - Updated mocks to consistently name context parameters and added a new
ExchangeExtended
interface.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
pkg/types/sliceorderbook.go | Reordered SliceOrderBook fields (Asks before Bids) |
pkg/types/orderbook.go | Removed stored Depth , updated NewDepthBook and methods |
pkg/types/mocks/* | Renamed mock methods to use ctx , symbol , options , etc. |
pkg/types/exchange.go | Added ExchangeExtended interface and formatted signatures |
pkg/strategy/xmaker/synthetichedge.go | Refactored SyntheticHedge to use HedgeMarketConfig |
pkg/strategy/xmaker/positionexposure.go | Extracted PositionExposure type into its own file |
pkg/strategy/xmaker/strategy.go | Updated calls to GetQuotePrices and NewDepthBook |
pkg/strategy/xmaker/hedgemarket.go | Implemented HedgeMarket , executors, and helper functions |
pkg/strategy/xmaker/positionexposure_test.go | Added tests for PositionExposure |
pkg/strategy/xmaker/hedgemarket_test.go | Maintained tests for hedging logic with new API |
Comments suppressed due to low confidence (1)
pkg/strategy/xmaker/positionexposure.go:22
- The code calls
log.Infof
, butlog
is not imported. Add an import for your logger (e.g.,github.com/sirupsen/logrus
aliased aslog
) or qualify the package.
log.Infof(
a0abef3
to
f4b3060
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
f4b3060
to
a78afec
Compare
Uh oh!
There was an error while loading. Please reload this page.