Skip to content

Commit 845bc7a

Browse files
authored
Merge pull request #1623 from c9s/c9s/liqmaker-adjustment
FEATURE: [liquiditymaker] limit adjustment order quantity
2 parents 489889d + a9db21a commit 845bc7a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/strategy/liquiditymaker/strategy.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ type Strategy struct {
4141

4242
LiquidityUpdateInterval types.Interval `json:"liquidityUpdateInterval"`
4343

44-
AdjustmentUpdateInterval types.Interval `json:"adjustmentUpdateInterval"`
44+
AdjustmentUpdateInterval types.Interval `json:"adjustmentUpdateInterval"`
45+
MaxAdjustmentOrderQuantity fixedpoint.Value `json:"maxAdjustmentOrderQuantity"`
4546

4647
NumOfLiquidityLayers int `json:"numOfLiquidityLayers"`
4748
LiquiditySlideRule *bbgo.SlideRule `json:"liquidityScale"`
@@ -171,6 +172,11 @@ func (s *Strategy) placeAdjustmentOrders(ctx context.Context) {
171172
var adjOrders []types.SubmitOrder
172173

173174
posSize := s.Position.Base.Abs()
175+
176+
if !s.MaxAdjustmentOrderQuantity.IsZero() {
177+
posSize = fixedpoint.Min(posSize, s.MaxAdjustmentOrderQuantity)
178+
}
179+
174180
tickSize := s.Market.TickSize
175181

176182
if s.Position.IsShort() {

0 commit comments

Comments
 (0)