From 4894a597569712ab691731627b7d10da7e57fb53 Mon Sep 17 00:00:00 2001 From: c9s Date: Tue, 19 Dec 2023 21:59:44 +0800 Subject: [PATCH] fixedmaker, liquiditymaker: update initialize method --- pkg/strategy/fixedmaker/strategy.go | 5 ++++- pkg/strategy/liquiditymaker/strategy.go | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/strategy/fixedmaker/strategy.go b/pkg/strategy/fixedmaker/strategy.go index 3585e4da1..af561de09 100644 --- a/pkg/strategy/fixedmaker/strategy.go +++ b/pkg/strategy/fixedmaker/strategy.go @@ -47,7 +47,10 @@ func (s *Strategy) Defaults() error { } func (s *Strategy) Initialize() error { - s.Strategy = &common.Strategy{} + if s.Strategy == nil { + s.Strategy = &common.Strategy{} + } + return nil } diff --git a/pkg/strategy/liquiditymaker/strategy.go b/pkg/strategy/liquiditymaker/strategy.go index 47ecec89c..187082d79 100644 --- a/pkg/strategy/liquiditymaker/strategy.go +++ b/pkg/strategy/liquiditymaker/strategy.go @@ -67,7 +67,9 @@ type Strategy struct { } func (s *Strategy) Initialize() error { - s.Strategy = &common.Strategy{} + if s.Strategy == nil { + s.Strategy = &common.Strategy{} + } return nil }