-
Notifications
You must be signed in to change notification settings - Fork 2k
Product update broken for Binance ? #1794
Comments
On Travis, the build 2117.2 from Tuesday is the last one who succeeded. The last Travis build 2166 silently failed on Binance. It seems the product list update for Binance randomly fail or succeed. Since Travis run frequently enough, it's not too much of a problem (the list is recent enough), but it should be fixed. Also, there seem to have a lot of other bug in these Travis script that should be cared of. |
Okay, I've looked more into it. I have good news and bad news. The good news is that I've found the bug origin: the Binance API returns an array of filter, with each filter being of a different type. The code searches the filters by index in this array, instead of by id. The bad news is: the Current code of // 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(); However,
Solution ?I see two solutions:
@DeviaVir what do you think ? |
Changes with the previous version: - Binance filters are selected by type rather than by index. It fixes DeviaVir#1794 - No more useless removal of trailing zeros of 'increment' and 'asset_increment' - Binance notional filter is set in `product.min_total` rather than roughly modifying `product.min_size`. It fixes DeviaVir#1793
* Engine: Split code about check of minimal order size into a function The function avoid code duplication and is more easily readable. Small behavior change: the new function accept products with both `min_size` and `min_total`. Previously, only the first one available was checked. * Binance: rewrite update-products to fix bugs Changes with the previous version: - Binance filters are selected by type rather than by index. It fixes DeviaVir#1794 - No more useless removal of trailing zeros of 'increment' and 'asset_increment' - Binance notional filter is set in `product.min_total` rather than roughly modifying `product.min_size`. It fixes DeviaVir#1793
Under Node 8.12 (I've not tested others),
./extensions/exchanges/binance/update-products.sh
is broken:@DeviaVir How do you update the product list ? Does it works for you ?
Also, what do you think about integrating directly at the start of Zenbot ?
The text was updated successfully, but these errors were encountered: