Filters
Filters define trading rules on a symbol or an exchange.
Filters come in three forms: symbol filters, exchange filters and asset filters.
Symbol filters
PRICE_FILTER
The PRICE_FILTER defines the price rules for a symbol. There are 3 parts:
minPricedefines the minimumprice/stopPriceallowed; disabled onminPrice== 0.maxPricedefines the maximumprice/stopPriceallowed; disabled onmaxPrice== 0.tickSizedefines the intervals that aprice/stopPricecan be increased/decreased by; disabled ontickSize== 0.
Any of the above variables can be set to 0, which disables that rule in the price filter. In order to pass the price filter, the following must be true for price/stopPrice of the enabled rules:
price>=minPriceprice<=maxPriceprice%tickSize== 0
/exchangeInfo format:
{
"filterType": "PRICE_FILTER",
"minPrice": "0.00000100",
"maxPrice": "100000.00000000",
"tickSize": "0.00000100"
}
PERCENT_PRICE
The PERCENT_PRICE filter defines the valid range for the price based on the average of the previous trades.
avgPriceMins is the number of minutes the average price is calculated over. 0 means the last price is used.
In order to pass the percent price, the following must be true for price:
price<=weightedAveragePrice*multiplierUpprice>=weightedAveragePrice*multiplierDown
/exchangeInfo format:
{
"filterType": "PERCENT_PRICE",
"multiplierUp": "1.3000",
"multiplierDown": "0.7000",
"avgPriceMins": 5
}
PERCENT_PRICE_BY_SIDE
The PERCENT_PRICE_BY_SIDE filter defines the valid range for the price based on the average of the previous trades.
avgPriceMins is the number of minutes the average price is calculated over. 0 means the last price is used.
There is a different range depending on whether the order is placed on the BUY side or the SELL side.
Buy orders will succeed on this filter if:
Order price<=weightedAveragePrice*bidMultiplierUpOrder price>=weightedAveragePrice*bidMultiplierDown
Sell orders will succeed on this filter if:
Order Price<=weightedAveragePrice*askMultiplierUpOrder Price>=weightedAveragePrice*askMultiplierDown
/exchangeInfo format:
{
"filterType": "PERCENT_PRICE_BY_SIDE",
"bidMultiplierUp": "1.2",
"bidMultiplierDown": "0.2",
"askMultiplierUp": "5",
"askMultiplierDown": "0.8",
"avgPriceMins": 1
}
LOT_SIZE
The LOT_SIZE filter defines the quantity (aka "lots" in auction terms) rules for a symbol. There are 3 parts:
minQtydefines the minimumquantity/icebergQtyallowed.maxQtydefines the maximumquantity/icebergQtyallowed.stepSizedefines the intervals that aquantity/icebergQtycan be increased/decreased by.
In order to pass the lot size, the following must be true for quantity/icebergQty:
quantity>=minQtyquantity<=maxQtyquantity%stepSize== 0
/exchangeInfo format:
{
"filterType": "LOT_SIZE",
"minQty": "0.00100000",
"maxQty": "100000.00000000",
"stepSize": "0.00100000"
}
MIN_NOTIONAL
The MIN_NOTIONAL filter defines the minimum notional value allowed for an order on a symbol.
An order's notional value is the price * quantity.
applyToMarket determines whether or not the MIN_NOTIONAL filter will also be applied to MARKET orders.
Since MARKET orders have no price, the average price is used over the last avgPriceMins minutes.
avgPriceMins is the number of minutes the average price is calculated over. 0 means the last price is used.
/exchangeInfo format:
{
"filterType": "MIN_NOTIONAL",
"minNotional": "0.00100000",
"applyToMarket": true,
"avgPriceMins": 5
}