Skip to content

Conversation

c9s
Copy link
Owner

@c9s c9s commented Jun 5, 2025

- xmaker: &xmaker-config
    symbol: BTCTWD
    sourceSymbol: BTCUSDT
    sourceExchange: binance
    makerExchange: max

    useSandbox: true

    syntheticHedge:
      enabled: true
      source:
        symbol: "binance.BTCUSDT"
        depthInQuote: 10_000.0
        hedgeMethod: "counterparty"
        hedgeMethodCounterparty:
          priceLevel: 1
      fiat:
        symbol: "max.USDTTWD"
        depth: 10_000.0
        hedgeMethod: "market"
        hedgeMethodMarket:
          maxOrderQuantity: 10_0000.0

Base automatically changed from c9s/xmaker/fiat-synthetic-hedge to main June 5, 2025 09:20
@c9s c9s force-pushed the c9s/xmaker/fiat-synthetic-hedge-3 branch 2 times, most recently from 6ea989b to 84becc5 Compare June 6, 2025 11:27
@narumiruna narumiruna requested a review from Copilot June 11, 2025 06:22
Copy link
Contributor

@Copilot Copilot AI left a 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 with HedgeExecutor 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, but log is not imported. Add an import for your logger (e.g., github.com/sirupsen/logrus aliased as log) or qualify the package.
log.Infof(

@c9s c9s force-pushed the c9s/xmaker/fiat-synthetic-hedge-3 branch from a0abef3 to f4b3060 Compare June 11, 2025 09:33
@c9s c9s force-pushed the c9s/xmaker/fiat-synthetic-hedge-3 branch from f4b3060 to a78afec Compare June 11, 2025 10:03
@c9s c9s enabled auto-merge June 11, 2025 10:05
@c9s c9s merged commit 36ea0f9 into main Jun 11, 2025
2 checks passed
@c9s c9s deleted the c9s/xmaker/fiat-synthetic-hedge-3 branch June 11, 2025 10:14
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.

3 participants