Skip to content

Commit

Permalink
adjust max order limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Mar 9, 2024
1 parent c06b161 commit cf4fb0e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/exchange/max/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ func New(key, secret string) *Exchange {
v3client: &v3.Client{Client: client},
v3margin: &v3.MarginService{Client: client},

queryTradeLimiter: rate.NewLimiter(rate.Every(1*time.Second), 2),
submitOrderLimiter: rate.NewLimiter(rate.Every(100*time.Millisecond), 10),
queryTradeLimiter: rate.NewLimiter(rate.Every(1*time.Second), 2),

// 1200 cpm (1200 requests per minute = 20 requests per second)
submitOrderLimiter: rate.NewLimiter(rate.Every(50*time.Millisecond), 20),

// closedOrderQueryLimiter is used for the closed orders query rate limit, 1 request per second
closedOrderQueryLimiter: rate.NewLimiter(rate.Every(1*time.Second), 1),
Expand Down

0 comments on commit cf4fb0e

Please sign in to comment.