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

binance order placement must not retry a MIN_NOTIONAL issue #1123

Closed
wants to merge 2 commits into from
Closed
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
8 changes: 6 additions & 2 deletions extensions/exchanges/binance/exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ module.exports = function container (get, set, clear) {
delete opts.order_type
var order = {}
client.createOrder(joinProduct(opts.product_id), opts.type, opts.side, this.roundToNearest(opts.size, opts), opts.price, args).then(result => {
if (result && result.message === 'Insufficient funds') {
// catch errors which does not allow a retry like:
// "Filter failure: MIN_NOTIONAL" => reported as code -1013
if (result && result.message.match(new RegExp(/Insufficient funds|MIN_NOTIONAL/))) {
order = {
status: 'rejected',
reject_reason: 'balance'
Expand Down Expand Up @@ -199,7 +201,9 @@ module.exports = function container (get, set, clear) {
delete opts.order_type
var order = {}
client.createOrder(joinProduct(opts.product_id), opts.type, opts.side, this.roundToNearest(opts.size, opts), opts.price, args).then(result => {
if (result && result.message === 'Insufficient funds') {
// catch errors which does not allow a retry like:
// "Filter failure: MIN_NOTIONAL" => reported as code -1013
if (result && result.message.match(new RegExp(/Insufficient funds|MIN_NOTIONAL/))) {
order = {
status: 'rejected',
reject_reason: 'balance'
Expand Down