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

opts.order_type is undefined when Bitfinex API is down! unable to call buy, retrying in 10s #262

Closed
nao0811ta opened this issue Jun 11, 2017 · 9 comments
Labels

Comments

@nao0811ta
Copy link

nao0811ta commented Jun 11, 2017

Code

108     buy: function (opts, cb) {
109       var func_args = [].slice.call(arguments)
110       var client = authedClient()
111       if (c.bitfinex.wallet === 'exchange' && typeof opts.order_type === 'maker') {
112         opts.type = 'exchange limit'
113       }
114       else if (c.bitfinex.wallet === 'exchange' && typeof opts.order_type === 'taker') {
115         opts.type = 'exchange market'
116       }
117       if (typeof opts.post_only === 'undefined') {
118          opts.post_only = true
129        }
......
128       var params = {
129         symbol,
130         amount,
131         price,
132         exchange,
133         side,
134         type,
135         is_hidden,
136         is_postonly
137       }
138 console.error(params)

Result of

[ec2-user@ip-10-166-11-188 zen4-bit-2]$ ./zenbot.sh buy
{ symbol: 'ETCUSD',
  amount: '7.55683975',
  price: '19.6040',
  exchange: 'bitfinex',
  side: 'buy',
  type: undefined,
  is_hidden: false,
  is_postonly: true }

Bitfinex API is down! unable to call buy, retrying in 10s
placing order...
@nao0811ta nao0811ta reopened this Jun 11, 2017
@DeviaVir DeviaVir added the bug label Jun 11, 2017
@DeviaVir
Copy link
Owner

@nedievas any chance you can take a look into this?

DeviaVir pushed a commit that referenced this issue Jun 11, 2017
@nao0811ta
Copy link
Author

@nedievas
Thank you
I have a question
err.toString('') have to be err.toString().match('')?

FYI, I testing bitfinex backfill with v2 api. it seems well.
After testing , I will upload.

@nedievas
Copy link
Contributor

@nao0811ta string.match(regexp).

Good. I'm thinking of websockets also.

@nao0811ta nao0811ta reopened this Jun 11, 2017
@nao0811ta
Copy link
Author

Your new code is err.toString(regex)

@nao0811ta
Copy link
Author

still can't buy

Bitfinex API is down! unable to call buy, retryin
g in 10s
placing order...
placing order...
placing order...

@nao0811ta
Copy link
Author

typeof opts.order_type === 'maker'
to be
c.order_type === 'maker'

@nedievas
Copy link
Contributor

Still it is not fixed. I will give a fix in a few seconds.

@nao0811ta
Copy link
Author

c.bitfinex.wallet === 'exchange' && c.order_type === 'maker'

err && err.match && err.match(/Error: Invalid order: not enough exchange balance$/)

@nedievas
Copy link
Contributor

pull

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants