bbgo icon indicating copy to clipboard operation
bbgo copied to clipboard

REFACTOR: daily data tracker

Open narumiruna opened this issue 1 year ago • 0 comments

This pull request refactors the FeeBudget class to replace the State structure with a new DailyDataTracker utility class for better code organization and functionality. The changes also include updates to the corresponding test cases to align with the new structure.

Refactoring FeeBudget class:

  • Replaced the State structure with the DailyDataTracker class for tracking daily fee budgets and accumulated fees. (pkg/strategy/common/fee_budget.go)
  • Updated methods in FeeBudget to use DailyDataTracker for checking and resetting fee data. (pkg/strategy/common/fee_budget.go) [1] [2]

Test updates:

  • Modified test cases to use DailyDataTracker instead of State for validating fee budget logic. (pkg/strategy/common/fee_budget_test.go)

New utility class:

  • Introduced DailyDataTracker class in pkg/util/daily_data_tracker.go to encapsulate the logic for tracking and resetting daily data. (pkg/util/daily_data_tracker.go)

narumiruna avatar Jun 18 '24 10:06 narumiruna