Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Fixed to make proper use of the MIN_NOTIONAL parameter. #1693

Merged
merged 15 commits into from
Aug 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions extensions/exchanges/binance/update-products.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ new ccxt.binance().fetch_markets().then(function(markets) {
break
}

var min_size = Number(market.info.filters[1].minQty);
var minNotional = Number(market.info.filters[2].minNotional);
// Orders must be strictly greater than minNotional
if (min_size <= minNotional) {
min_size += Number(assetStepSize);
}
min_size = min_size.toString();
// The MIN_NOTIONAL filter defines the minimum notional value allowed for an order on a symbol.
// An orders notional value is the price * quantity.
// In order to know the Value it is necessary to know the price which does not come on this JSon.
// But I have the maxPrice which seems to be: price * 10
var maxPrice = Number(market.info.filters[0].maxPrice);
var curPrice = maxPrice / 10;
var minNotional = Number(market.info.filters[2].minNotional);
var minNotionalQty = minNotional / curPrice;
var minQty = Number(market.info.filters[1].minQty);
var min_size = Math.max(minQty, minNotionalQty).toString();

products.push({
id: market.id,
Expand Down