From fcbdf8162adaf359ec8544d5459e8c96b809a933 Mon Sep 17 00:00:00 2001 From: c9s Date: Mon, 7 Mar 2022 13:56:20 +0800 Subject: [PATCH] max: add env var MAX_QUERY_CLOSED_ORDERS_LIMIT --- pkg/exchange/max/exchange.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/exchange/max/exchange.go b/pkg/exchange/max/exchange.go index c1d61cfe9..28392b85b 100644 --- a/pkg/exchange/max/exchange.go +++ b/pkg/exchange/max/exchange.go @@ -142,7 +142,7 @@ func (e *Exchange) QueryMarkets(ctx context.Context) (types.MarketMap, error) { MaxQuantity: fixedpoint.NewFromInt(10000), // make it like 0.0001 StepSize: fixedpoint.NewFromFloat(1.0 / math.Pow10(m.BaseUnitPrecision)), - // used in the price formatter + // used in the price formatter MinPrice: fixedpoint.NewFromFloat(1.0 / math.Pow10(m.QuoteUnitPrecision)), MaxPrice: fixedpoint.NewFromInt(10000), TickSize: fixedpoint.NewFromFloat(1.0 / math.Pow10(m.QuoteUnitPrecision)), @@ -211,6 +211,10 @@ func (e *Exchange) queryRecentlyClosedOrders(ctx context.Context, symbol string, orderIDs := make(map[uint64]struct{}, limit*2) maxPages := 10 + if v, ok := util.GetEnvVarInt("MAX_QUERY_CLOSED_ORDERS_LIMIT"); ok { + limit = v + } + if v, ok := util.GetEnvVarInt("MAX_QUERY_CLOSED_ORDERS_NUM_OF_PAGES"); ok { maxPages = v }