Skip to content

Commit

Permalink
fix: minNotional (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisleekr authored Apr 12, 2023
1 parent ca00cd8 commit fdd1421
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

All notable changes to this project will be documented in this file.

## [Unreleased]
## [0.0.98] - 2023-04-13

- Added the prefix to environment parameter for `TRADINGVIEW` related - [#616](https://github.com/chrisleekr/binance-trading-bot/pull/616)
- Fixed the issue with minNotional - [#623](https://github.com/chrisleekr/binance-trading-bot/pull/623)

## [0.0.97] - 2023-03-21

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@
"stepSize": "0.01000000"
},
{
"filterType": "MIN_NOTIONAL",
"filterType": "NOTIONAL",
"minNotional": "10.00000000",
"applyToMarket": true,
"avgPriceMins": 5
"applyMinToMarket": true,
"maxNotional": "10000.00000000",
"applyMaxToMarket": false,
"avgPriceMins": 1
},
{
"filterType": "ICEBERG_PARTS",
Expand Down
11 changes: 10 additions & 1 deletion app/cronjob/trailingTradeHelper/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,23 @@ const cacheExchangeSymbols = async logger => {
const { symbols } = exchangeInfo;

const exchangeSymbols = symbols.reduce((acc, symbol) => {
// For backward compatibility, MIN_NOTIONAL is deprecated.
const minNotionalFilter = _.find(symbol.filters, {
filterType: 'MIN_NOTIONAL'
});

// New filter type is NOTIONAL.
const notionalFilter = _.find(symbol.filters, {
filterType: 'NOTIONAL'
});

acc[symbol.symbol] = {
symbol: symbol.symbol,
status: symbol.status,
quoteAsset: symbol.quoteAsset,
minNotional: parseFloat(minNotionalFilter.minNotional)
minNotional: minNotionalFilter
? parseFloat(minNotionalFilter.minNotional)
: parseFloat(notionalFilter.minNotional)
};

return acc;
Expand Down

0 comments on commit fdd1421

Please sign in to comment.