Error: PERCENT_PRICE_BY_SIDE / Code:1013

Hi,

I am trying to create an order programmatically on binance using golang. But kept on encountering this error: code 1013, PERCENT_PRICE_BY_SIDE. Cannot find anything on google about it or their documentation.

Below is my code:

buyResponse, err := client.NewCreateOrderService().Symbol("BTCUSDT").
		Side(binance.SideTypeBuy).Type(binance.OrderTypeLimit).
		TimeInForce(binance.TimeInForceTypeGTC).Quantity("0.0001").
		Price("2.5").Do(context.Background());

Hi,

The error PERCENT_PRICE_BY_SIDE means that your buy request falls outside the acceptable price range based on the average of previous trades.
For a detailed explanation of this filter, you can refer to the filter documentation available here: Binance API Documentation

I would also suggest you to check the average price of BTCUSDT by using the NewAvgPriceService function.
This will help you select a valid purchase price within the acceptable range for BTCUSDT.