Skip to content

Commit

Permalink
Merge pull request #1623 from c9s/c9s/liqmaker-adjustment
Browse files Browse the repository at this point in the history
FEATURE: [liquiditymaker] limit adjustment order quantity
  • Loading branch information
c9s authored Apr 22, 2024
2 parents 489889d + a9db21a commit 845bc7a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/strategy/liquiditymaker/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ type Strategy struct {

LiquidityUpdateInterval types.Interval `json:"liquidityUpdateInterval"`

AdjustmentUpdateInterval types.Interval `json:"adjustmentUpdateInterval"`
AdjustmentUpdateInterval types.Interval `json:"adjustmentUpdateInterval"`
MaxAdjustmentOrderQuantity fixedpoint.Value `json:"maxAdjustmentOrderQuantity"`

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

posSize := s.Position.Base.Abs()

if !s.MaxAdjustmentOrderQuantity.IsZero() {
posSize = fixedpoint.Min(posSize, s.MaxAdjustmentOrderQuantity)
}

tickSize := s.Market.TickSize

if s.Position.IsShort() {
Expand Down

0 comments on commit 845bc7a

Please sign in to comment.