Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitfinex: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b #441

Closed
Vyllonder opened this issue Nov 1, 2017 · 16 comments
Closed
Assignees

Comments

@Vyllonder
Copy link

Vyllonder commented Nov 1, 2017

Hi, Im trying to just make a order in Bitfinex.

The code is this

bitfinex.create_order('BTC/USD','LIMIT','buy','0.01','5500')`

Traceback (most recent call last):

`
  File "<ipython-input-4-4810d0cd0860>", line 1, in <module>
    runfile('C:/Users/Mario/Documents/bitfinexDeployed/ccxt1.py', wdir='C:/Users/Mario/Documents/bitfinexDeployed')

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
    execfile(filename, namespace)

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/Mario/Documents/bitfinexDeployed/ccxt1.py", line 15, in <module>
    bitfinex.create_order('BTC/USD','LIMIT','buy','0.01','5500')

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\bitfinex.py", line 237, in create_order
    result = self.privatePostOrderNew(self.extend(order, params))

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\bitfinex.py", line 420, in request
    response = self.fetch2(path, api, method, params, headers, body)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 225, in fetch2
    return self.fetch(request['url'], request['method'], request['headers'], request['body'])

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 277, in fetch
    self.handle_errors(e.code, e.reason, url, method, None, e.read().decode('utf-8'))

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte

Im running Python 3.6
Lot of thanks for this incredible API

@kroitor kroitor self-assigned this Nov 1, 2017
@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

Hi! Thanks for reporting! Will take a look into it asap!

@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

@Vyllonder what's your version of ccxt?

@Vyllonder
Copy link
Author

1.9.304

Thanks!

kroitor added a commit that referenced this issue Nov 1, 2017
@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

Can you please update to version 1.9.318+ and report with verbose mode enabled? We added some better error logging, so we should now see the reason why it complains...
Just put bitfinex.verbose = True before the create_order call and post your output here.

When posting use triple backticks to enclose your output for readability like so:

```
your output
```

@Vyllonder
Copy link
Author

runfile('C:/Users/Mario/Documents/bitfinexDeployed/ccxt1.py', wdir='C:/Users/Mario/Documents/bitfinexDeployed')
https://api.bitfinex.com/v1/symbols_details GET https://api.bitfinex.com/v1/symbols_details 
Request: {'User-Agent': 'ccxt/1.9.318 (+https://github.com/ccxt-dev/ccxt) Python/3.6.2', 'Accept-Encoding': 'gzip, deflate'} None
GET https://api.bitfinex.com/v1/symbols_details 
Response: Date: Wed, 01 Nov 2017 11:42:03 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: close
Set-Cookie: __cfduid=ddeea6793f60135b079cb77b2df50ffdd1509536522; expires=Thu, 01-Nov-18 11:42:02 GMT; path=/; domain=.bitfinex.com; HttpOnly
Strict-Transport-Security: max-age=31536000
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Vary: Accept-Encoding
Content-Encoding: gzip
ETag: "e6bfac2422649a90cc4d51070024ef14"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: f9f5593b-9d47-440a-81c3-ba7ee13ccc3a
X-Runtime: 0.093184
X-Frame-Options: SAMEORIGIN
Server: cloudflare-nginx
CF-RAY: 3b6e96a469488c64-VIE

 [{"pair":"btcusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.004","expiration":"NA"},{"pair":"ltcusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"ltcbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"ethusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"ethbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"etcbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"etcusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"rrtusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"98.0","expiration":"NA"},{"pair":"rrtbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"98.0","expiration":"NA"},{"pair":"zecusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"20000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"zecbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"20000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"xmrusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"xmrbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"dshusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"dshbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bccbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.004","expiration":"NA"},{"pair":"bcubtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bccusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.004","expiration":"NA"},{"pair":"bcuusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"xrpusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"50.0","expiration":"NA"},{"pair":"xrpbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"50.0","expiration":"NA"},{"pair":"iotusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"24.0","expiration":"NA"},{"pair":"iotbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"24.0","expiration":"NA"},{"pair":"ioteth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"24.0","expiration":"NA"},{"pair":"eosusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"20.0","expiration":"NA"},{"pair":"eosbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"20.0","expiration":"NA"},{"pair":"eoseth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"20.0","expiration":"NA"},{"pair":"sanusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"48.0","expiration":"NA"},{"pair":"sanbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"48.0","expiration":"NA"},{"pair":"saneth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"48.0","expiration":"NA"},{"pair":"omgusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"omgbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"omgeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"bchusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bchbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bcheth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"neousd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"0.4","expiration":"NA"},{"pair":"neobtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"0.4","expiration":"NA"},{"pair":"neoeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"0.4","expiration":"NA"},{"pair":"etpusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"etpbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"etpeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"qtmusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"qtmbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"qtmeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"bt1usd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.002","expiration":"NA"},{"pair":"bt2usd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.02","expiration":"NA"},{"pair":"bt1btc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.002","expiration":"NA"},{"pair":"bt2btc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.02","expiration":"NA"},{"pair":"avtusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"avtbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"avteth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"edousd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"edobtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"edoeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"btgusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.08","expiration":"NA"},{"pair":"btgbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.08","expiration":"NA"}]
https://api.bitfinex.com/v1/order/new POST https://api.bitfinex.com/v1/order/new 
Request: {'X-BFX-APIKEY': 'JK02gR0XL44OfAeuXmyXKpp7tAy7ve4CkCl1tv7h4Zp', 'X-BFX-PAYLOAD': 'eyJub25jZSI6IjE1MDk1MzY1MjEzNTkiLCJyZXF1ZXN0IjoiL3YxL29yZGVyL25ldyIsInN5bWJvbCI6IkJUQ1VTRCIsImFtb3VudCI6IjAuMDIiLCJzaWRlIjoiYnV5IiwidHlwZSI6IkxJTUlUIiwib2Nvb3JkZXIiOmZhbHNlLCJidXlfcHJpY2Vfb2NvIjowLCJzZWxsX3ByaWNlX29jbyI6MCwicHJpY2UiOiI1NTAwIn0=', 'X-BFX-SIGNATURE': '3c385d24b7a1c4d110b905b671f1d0c402473966fe17d2b39c0a182cf10d8941cd1a95497b688912b49e04f16cd70e4a', 'User-Agent': 'ccxt/1.9.318 (+https://github.com/ccxt-dev/ccxt) Python/3.6.2', 'Accept-Encoding': 'gzip, deflate'} None
Traceback (most recent call last):

  File "<ipython-input-5-4810d0cd0860>", line 1, in <module>
    runfile('C:/Users/Mario/Documents/bitfinexDeployed/ccxt1.py', wdir='C:/Users/Mario/Documents/bitfinexDeployed')

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
    execfile(filename, namespace)

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/Mario/Documents/bitfinexDeployed/ccxt1.py", line 15, in <module>
    bitfinex.create_order('BTC/USD','LIMIT','buy','0.02','5500')

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\bitfinex.py", line 237, in create_order
    result = self.privatePostOrderNew(self.extend(order, params))

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\bitfinex.py", line 420, in request
    response = self.fetch2(path, api, method, params, headers, body)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 235, in fetch2
    return self.fetch(request['url'], request['method'], request['headers'], request['body'])

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 293, in fetch
    self.handle_rest_errors(e, e.code, text, url, method)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 336, in handle_rest_errors
    self.raise_error(error, url, method, exception if exception else http_status_code, details)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 220, in raise_error
    details,

ExchangeNotAvailable: bitfinex POST https://api.bitfinex.com/v1/order/new 400 Bad Request  (possible reasons: invalid API keys, bad or old nonce, exchange is down or offline, on maintenance, DDoS protection, rate-limiting, )


@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

Ok, thx! The error is likely here:

# you're using uppercase letters here, it should be 'limit' instead of 'LIMIT'
#                                 ↓
bitfinex.create_order('BTC/USD','LIMIT','buy','0.01','5500')`

Just change it to lowercase. Let us know if it helped you or not.

@Vyllonder
Copy link
Author

https://api.bitfinex.com/v1/symbols_details GET https://api.bitfinex.com/v1/symbols_details 
Request: {'User-Agent': 'ccxt/1.9.318 (+https://github.com/ccxt-dev/ccxt) Python/3.6.2', 'Accept-Encoding': 'gzip, deflate'} None
GET https://api.bitfinex.com/v1/symbols_details 
Response: Date: Wed, 01 Nov 2017 11:52:43 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: close
Set-Cookie: __cfduid=d29cdc75739e2b9893c2f41e4d3e5b8b61509537163; expires=Thu, 01-Nov-18 11:52:43 GMT; path=/; domain=.bitfinex.com; HttpOnly
Strict-Transport-Security: max-age=31536000
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Vary: Accept-Encoding
Content-Encoding: gzip
ETag: "c499e938a8f01d44d9f4b2de1e55d88d"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 2899c100-4ede-4122-b514-666a21cbfae2
X-Runtime: 0.081876
X-Frame-Options: SAMEORIGIN
Server: cloudflare-nginx
CF-RAY: 3b6ea6480a028c82-VIE

 [{"pair":"btcusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.004","expiration":"NA"},{"pair":"ltcusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"ltcbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"ethusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"ethbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"etcbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"etcusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"rrtusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"98.0","expiration":"NA"},{"pair":"rrtbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"98.0","expiration":"NA"},{"pair":"zecusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"20000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"zecbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"20000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"xmrusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"xmrbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"dshusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"dshbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bccbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.004","expiration":"NA"},{"pair":"bcubtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bccusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.004","expiration":"NA"},{"pair":"bcuusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"xrpusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"50.0","expiration":"NA"},{"pair":"xrpbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"50.0","expiration":"NA"},{"pair":"iotusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"24.0","expiration":"NA"},{"pair":"iotbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"24.0","expiration":"NA"},{"pair":"ioteth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"24.0","expiration":"NA"},{"pair":"eosusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"20.0","expiration":"NA"},{"pair":"eosbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"20.0","expiration":"NA"},{"pair":"eoseth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"20.0","expiration":"NA"},{"pair":"sanusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"48.0","expiration":"NA"},{"pair":"sanbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"48.0","expiration":"NA"},{"pair":"saneth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"48.0","expiration":"NA"},{"pair":"omgusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"omgbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"omgeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"bchusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bchbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bcheth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"neousd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"0.4","expiration":"NA"},{"pair":"neobtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"0.4","expiration":"NA"},{"pair":"neoeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"0.4","expiration":"NA"},{"pair":"etpusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"etpbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"etpeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"qtmusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"qtmbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"qtmeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"bt1usd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.002","expiration":"NA"},{"pair":"bt2usd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.02","expiration":"NA"},{"pair":"bt1btc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.002","expiration":"NA"},{"pair":"bt2btc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.02","expiration":"NA"},{"pair":"avtusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"avtbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"avteth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"edousd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"edobtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"edoeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"btgusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.08","expiration":"NA"},{"pair":"btgbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.08","expiration":"NA"}]
https://api.bitfinex.com/v1/order/new POST https://api.bitfinex.com/v1/order/new 
Request: {'X-BFX-APIKEY': 'JK02gR0XL44OfAeuXmyXKpp7tAy7ve4CkCl1tv7h4Zp', 'X-BFX-PAYLOAD': 'eyJub25jZSI6IjE1MDk1MzcxNjE3NTQiLCJyZXF1ZXN0IjoiL3YxL29yZGVyL25ldyIsInN5bWJvbCI6IkJUQ1VTRCIsImFtb3VudCI6IjAuMDIiLCJzaWRlIjoiYnV5IiwidHlwZSI6ImV4Y2hhbmdlIGxpbWl0Iiwib2Nvb3JkZXIiOmZhbHNlLCJidXlfcHJpY2Vfb2NvIjowLCJzZWxsX3ByaWNlX29jbyI6MCwicHJpY2UiOiI1NTAwIn0=', 'X-BFX-SIGNATURE': 'd5dfce7e83a535c6c49a638d7f8add65e82a7d8e12c2790e8df233535e14d201288a2a1c84a240aaa2337a2f74b61cd1', 'User-Agent': 'ccxt/1.9.318 (+https://github.com/ccxt-dev/ccxt) Python/3.6.2', 'Accept-Encoding': 'gzip, deflate'} None
Traceback (most recent call last):

  File "<ipython-input-12-4810d0cd0860>", line 1, in <module>
    runfile('C:/Users/Mario/Documents/bitfinexDeployed/ccxt1.py', wdir='C:/Users/Mario/Documents/bitfinexDeployed')

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
    execfile(filename, namespace)

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/Mario/Documents/bitfinexDeployed/ccxt1.py", line 15, in <module>
    bitfinex.create_order('BTC/USD','limit','buy','0.02','5500')

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\bitfinex.py", line 237, in create_order
    result = self.privatePostOrderNew(self.extend(order, params))

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\bitfinex.py", line 420, in request
    response = self.fetch2(path, api, method, params, headers, body)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 235, in fetch2
    return self.fetch(request['url'], request['method'], request['headers'], request['body'])

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 293, in fetch
    self.handle_rest_errors(e, e.code, text, url, method)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 336, in handle_rest_errors
    self.raise_error(error, url, method, exception if exception else http_status_code, details)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 220, in raise_error
    details,

ExchangeNotAvailable: bitfinex POST https://api.bitfinex.com/v1/order/new 400 Bad Request  (possible reasons: invalid API keys, bad or old nonce, exchange is down or offline, on maintenance, DDoS protection, rate-limiting, )

Still continues. By the way, lot of thanks for yout attention!

kroitor added a commit that referenced this issue Nov 1, 2017
@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

We can't reproduce it on our side because it's unique to your particular situation, so we added more logging and we have to ask you to update to version 1.9.320 and repost the verbose output again. We have to dig for the reason until we find and fix the bug.

@Vyllonder
Copy link
Author

https://api.bitfinex.com/v1/symbols_details GET https://api.bitfinex.com/v1/symbols_details 
Request: {'User-Agent': 'ccxt/1.9.318 (+https://github.com/ccxt-dev/ccxt) Python/3.6.2', 'Accept-Encoding': 'gzip, deflate'} None
GET https://api.bitfinex.com/v1/symbols_details 
Response: Date: Wed, 01 Nov 2017 12:23:54 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: close
Set-Cookie: __cfduid=dfc286838501120cd63ed7c94720cd1f51509539034; expires=Thu, 01-Nov-18 12:23:54 GMT; path=/; domain=.bitfinex.com; HttpOnly
Strict-Transport-Security: max-age=31536000
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Vary: Accept-Encoding
Content-Encoding: gzip
ETag: "a2c3ef08f21cdc1937039fd0e8c3f59f"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: da2c6e14-2bc3-44f8-8844-5318a80729d5
X-Runtime: 0.104753
X-Frame-Options: SAMEORIGIN
Server: cloudflare-nginx
CF-RAY: 3b6ed3f4ef2059fc-VIE

 [{"pair":"btcusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.004","expiration":"NA"},{"pair":"ltcusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"ltcbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"ethusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"ethbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"etcbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"etcusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"rrtusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"98.0","expiration":"NA"},{"pair":"rrtbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"98.0","expiration":"NA"},{"pair":"zecusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"20000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"zecbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"20000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"xmrusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"xmrbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"dshusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"dshbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bccbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.004","expiration":"NA"},{"pair":"bcubtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bccusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.004","expiration":"NA"},{"pair":"bcuusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"xrpusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"50.0","expiration":"NA"},{"pair":"xrpbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"50.0","expiration":"NA"},{"pair":"iotusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"24.0","expiration":"NA"},{"pair":"iotbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"24.0","expiration":"NA"},{"pair":"ioteth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"24.0","expiration":"NA"},{"pair":"eosusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"20.0","expiration":"NA"},{"pair":"eosbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"20.0","expiration":"NA"},{"pair":"eoseth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"20.0","expiration":"NA"},{"pair":"sanusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"48.0","expiration":"NA"},{"pair":"sanbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"48.0","expiration":"NA"},{"pair":"saneth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"48.0","expiration":"NA"},{"pair":"omgusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"omgbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"omgeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"bchusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bchbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bcheth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"neousd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"0.4","expiration":"NA"},{"pair":"neobtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"0.4","expiration":"NA"},{"pair":"neoeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"0.4","expiration":"NA"},{"pair":"etpusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"etpbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"etpeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"qtmusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"qtmbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"qtmeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"bt1usd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.002","expiration":"NA"},{"pair":"bt2usd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.02","expiration":"NA"},{"pair":"bt1btc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.002","expiration":"NA"},{"pair":"bt2btc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.02","expiration":"NA"},{"pair":"avtusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"avtbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"avteth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"edousd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"edobtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"edoeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"btgusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.08","expiration":"NA"},{"pair":"btgbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.08","expiration":"NA"}]
https://api.bitfinex.com/v1/order/new POST https://api.bitfinex.com/v1/order/new 
Request: {'X-BFX-APIKEY': 'JK02gR0XL44OfAeuXmyXKpp7tAy7ve4CkCl1tv7h4Zp', 'X-BFX-PAYLOAD': 'eyJub25jZSI6IjE1MDk1MzkwMzI1NTciLCJyZXF1ZXN0IjoiL3YxL29yZGVyL25ldyIsInN5bWJvbCI6IkJUQ1VTRCIsImFtb3VudCI6IjAuMDIiLCJzaWRlIjoiYnV5IiwidHlwZSI6ImV4Y2hhbmdlIGxpbWl0Iiwib2Nvb3JkZXIiOmZhbHNlLCJidXlfcHJpY2Vfb2NvIjowLCJzZWxsX3ByaWNlX29jbyI6MCwicHJpY2UiOiI1NTAwIn0=', 'X-BFX-SIGNATURE': 'a88c8e72020a7b9e27b6ba25d113a094ebd12bef27abcb26800d2d82cb2773ae5542b050b2b263e6cfa94dc8d7c54c02', 'User-Agent': 'ccxt/1.9.318 (+https://github.com/ccxt-dev/ccxt) Python/3.6.2', 'Accept-Encoding': 'gzip, deflate'} None
Traceback (most recent call last):

  File "<ipython-input-18-4810d0cd0860>", line 1, in <module>
    runfile('C:/Users/Mario/Documents/bitfinexDeployed/ccxt1.py', wdir='C:/Users/Mario/Documents/bitfinexDeployed')

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
    execfile(filename, namespace)

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/Mario/Documents/bitfinexDeployed/ccxt1.py", line 15, in <module>
    bitfinex.create_order('BTC/USD','limit','buy','0.02','5500')

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\bitfinex.py", line 237, in create_order
    result = self.privatePostOrderNew(self.extend(order, params))

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\bitfinex.py", line 420, in request
    response = self.fetch2(path, api, method, params, headers, body)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 235, in fetch2
    return self.fetch(request['url'], request['method'], request['headers'], request['body'])

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 293, in fetch
    self.handle_rest_errors(e, e.code, message if message else text, url, method)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 336, in handle_rest_errors
    self.raise_error(error, url, method, exception if exception else http_status_code, details)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 220, in raise_error
    details,

ExchangeNotAvailable: bitfinex POST https://api.bitfinex.com/v1/order/new 400 Bad Request  (possible reasons: invalid API keys, bad or old nonce, exchange is down or offline, on maintenance, DDoS protection, rate-limiting, )

Keys are correct, Im getting the wallet via Rest

@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

@Vyllonder you reposted with the same 1.9.318, not 1.9.320. Sorry for bothering you, but we need to see the output you get with 1.9.320.

@Vyllonder
Copy link
Author

Vyllonder commented Nov 1, 2017

https://api.bitfinex.com/v1/symbols_details GET https://api.bitfinex.com/v1/symbols_details 
Request: {'User-Agent': 'ccxt/1.9.321 (+https://github.com/ccxt-dev/ccxt) Python/3.6.2', 'Accept-Encoding': 'gzip, deflate'} None
GET https://api.bitfinex.com/v1/symbols_details 
Response: Date: Wed, 01 Nov 2017 12:38:14 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: close
Set-Cookie: __cfduid=dc700b2545412a8061c1ddf3de3f5c79b1509539894; expires=Thu, 01-Nov-18 12:38:14 GMT; path=/; domain=.bitfinex.com; HttpOnly
Strict-Transport-Security: max-age=31536000
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Vary: Accept-Encoding
Content-Encoding: gzip
ETag: "543079bfce393d01b74245e4c68641f7"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 860f3bea-9b3c-4c06-80b0-64837c9bfbc0
X-Runtime: 0.116552
X-Frame-Options: SAMEORIGIN
Server: cloudflare-nginx
CF-RAY: 3b6ee8f21e03599c-VIE

 [{"pair":"btcusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.004","expiration":"NA"},{"pair":"ltcusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"ltcbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"ethusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"ethbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"etcbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"etcusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"rrtusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"98.0","expiration":"NA"},{"pair":"rrtbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"98.0","expiration":"NA"},{"pair":"zecusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"20000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"zecbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"20000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"xmrusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"xmrbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"dshusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"dshbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bccbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.004","expiration":"NA"},{"pair":"bcubtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bccusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.004","expiration":"NA"},{"pair":"bcuusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"xrpusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"50.0","expiration":"NA"},{"pair":"xrpbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"50.0","expiration":"NA"},{"pair":"iotusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"24.0","expiration":"NA"},{"pair":"iotbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"24.0","expiration":"NA"},{"pair":"ioteth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"24.0","expiration":"NA"},{"pair":"eosusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"20.0","expiration":"NA"},{"pair":"eosbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"20.0","expiration":"NA"},{"pair":"eoseth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"20.0","expiration":"NA"},{"pair":"sanusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"48.0","expiration":"NA"},{"pair":"sanbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"48.0","expiration":"NA"},{"pair":"saneth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"48.0","expiration":"NA"},{"pair":"omgusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"omgbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"omgeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"bchusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bchbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bcheth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"neousd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"0.4","expiration":"NA"},{"pair":"neobtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"0.4","expiration":"NA"},{"pair":"neoeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"0.4","expiration":"NA"},{"pair":"etpusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"etpbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"etpeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"qtmusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"qtmbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"qtmeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"bt1usd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.002","expiration":"NA"},{"pair":"bt2usd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.02","expiration":"NA"},{"pair":"bt1btc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.002","expiration":"NA"},{"pair":"bt2btc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.02","expiration":"NA"},{"pair":"avtusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"avtbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"avteth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"edousd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"edobtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"edoeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"btgusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.08","expiration":"NA"},{"pair":"btgbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.08","expiration":"NA"}]
https://api.bitfinex.com/v1/order/new POST https://api.bitfinex.com/v1/order/new 
Request: {'X-BFX-APIKEY': 'JK02gR0XL44OfAeuXmyXKpp7tAy7ve4CkCl1tv7h4Zp', 'X-BFX-PAYLOAD': 'eyJub25jZSI6IjE1MDk1Mzk4OTIzMTgiLCJyZXF1ZXN0IjoiL3YxL29yZGVyL25ldyIsInN5bWJvbCI6IkJUQ1VTRCIsImFtb3VudCI6IjAuMDIiLCJzaWRlIjoiYnV5IiwidHlwZSI6ImV4Y2hhbmdlIGxpbWl0Iiwib2Nvb3JkZXIiOmZhbHNlLCJidXlfcHJpY2Vfb2NvIjowLCJzZWxsX3ByaWNlX29jbyI6MCwicHJpY2UiOiI1NTAwIn0=', 'X-BFX-SIGNATURE': 'dad2eb6e46830232577c29dc80d50087d13c7ca97c759dd7719ca2c8cc50e44ac89f8dab17fd9ec625839707e61e7464', 'User-Agent': 'ccxt/1.9.321 (+https://github.com/ccxt-dev/ccxt) Python/3.6.2', 'Accept-Encoding': 'gzip, deflate'} None
Traceback (most recent call last):

  File "<ipython-input-1-4810d0cd0860>", line 1, in <module>
    runfile('C:/Users/Mario/Documents/bitfinexDeployed/ccxt1.py', wdir='C:/Users/Mario/Documents/bitfinexDeployed')

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
    execfile(filename, namespace)

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/Mario/Documents/bitfinexDeployed/ccxt1.py", line 15, in <module>
    bitfinex.create_order('BTC/USD','limit','buy','0.02','5500')

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\bitfinex.py", line 237, in create_order
    result = self.privatePostOrderNew(self.extend(order, params))

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\bitfinex.py", line 420, in request
    response = self.fetch2(path, api, method, params, headers, body)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 235, in fetch2
    return self.fetch(request['url'], request['method'], request['headers'], request['body'])

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 293, in fetch
    self.handle_rest_errors(e, e.code, message if message else text, url, method)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 336, in handle_rest_errors
    self.raise_error(error, url, method, exception if exception else http_status_code, details)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 220, in raise_error
    details,

ExchangeNotAvailable: bitfinex POST https://api.bitfinex.com/v1/order/new 400 Bad Request  (possible reasons: invalid API keys, bad or old nonce, exchange is down or offline, on maintenance, DDoS protection, rate-limiting, )

I have reinstalled everithing, this should be 321

kroitor added a commit that referenced this issue Nov 1, 2017
@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

@Vyllonder thx for your help! Really appreciate it! We're going to investigate further, will update on on this asap and deliver the fix very soon.

@Vyllonder
Copy link
Author

Perfect. Lot of thanks!!

@kroitor
Copy link
Member

kroitor commented Nov 2, 2017

@Vyllonder ok, we have uploaded a new version which should report the reason for bitfinex error clearly (at last). We are going to ask you to update to the most version 1.9.332+ and report verbose output with it again, please. Standing by for more info from you! Thx!

@Vyllonder
Copy link
Author

https://api.bitfinex.com/v1/symbols_details GET https://api.bitfinex.com/v1/symbols_details 
Request: {'User-Agent': 'ccxt/1.9.346 (+https://github.com/ccxt-dev/ccxt) Python/3.6.2', 'Accept-Encoding': 'gzip, deflate'} None
GET https://api.bitfinex.com/v1/symbols_details 
Response: Date: Thu, 02 Nov 2017 18:15:32 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: close
Set-Cookie: __cfduid=dd73432bd62e718b3dae0d00aa9d329531509646532; expires=Fri, 02-Nov-18 18:15:32 GMT; path=/; domain=.bitfinex.com; HttpOnly
Strict-Transport-Security: max-age=31536000
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Vary: Accept-Encoding
Content-Encoding: gzip
ETag: "6d3044d66e2a983b50c16eecfdad8b29"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 1766bb1f-7553-499d-a734-a16cccced28d
X-Runtime: 0.087751
X-Frame-Options: SAMEORIGIN
Server: cloudflare-nginx
CF-RAY: 3b79146a4fe68c82-VIE

 [{"pair":"btcusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.004","expiration":"NA"},{"pair":"ltcusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"ltcbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"ethusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"ethbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"etcbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"etcusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"1.0","expiration":"NA"},{"pair":"rrtusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"98.0","expiration":"NA"},{"pair":"rrtbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"98.0","expiration":"NA"},{"pair":"zecusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"20000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"zecbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"20000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"xmrusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"xmrbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.2","expiration":"NA"},{"pair":"dshusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"dshbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"5000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bccbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.004","expiration":"NA"},{"pair":"bcubtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bccusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.004","expiration":"NA"},{"pair":"bcuusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"xrpusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"52.0","expiration":"NA"},{"pair":"xrpbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"52.0","expiration":"NA"},{"pair":"iotusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"26.0","expiration":"NA"},{"pair":"iotbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"26.0","expiration":"NA"},{"pair":"ioteth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"26.0","expiration":"NA"},{"pair":"eosusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"20.0","expiration":"NA"},{"pair":"eosbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"20.0","expiration":"NA"},{"pair":"eoseth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"20.0","expiration":"NA"},{"pair":"sanusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"48.0","expiration":"NA"},{"pair":"sanbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"48.0","expiration":"NA"},{"pair":"saneth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"200000.0","minimum_order_size":"48.0","expiration":"NA"},{"pair":"omgusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"omgbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"omgeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"100000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"bchusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bchbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"bcheth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.04","expiration":"NA"},{"pair":"neousd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"0.4","expiration":"NA"},{"pair":"neobtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"0.4","expiration":"NA"},{"pair":"neoeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"0.4","expiration":"NA"},{"pair":"etpusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"etpbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"etpeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"10000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"qtmusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"qtmbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"qtmeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"2.0","expiration":"NA"},{"pair":"bt1usd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.002","expiration":"NA"},{"pair":"bt2usd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.02","expiration":"NA"},{"pair":"bt1btc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.002","expiration":"NA"},{"pair":"bt2btc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.02","expiration":"NA"},{"pair":"avtusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"avtbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"avteth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"4.0","expiration":"NA"},{"pair":"edousd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"6.0","expiration":"NA"},{"pair":"edobtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"6.0","expiration":"NA"},{"pair":"edoeth","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"50000.0","minimum_order_size":"6.0","expiration":"NA"},{"pair":"btgusd","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.08","expiration":"NA"},{"pair":"btgbtc","price_precision":5,"initial_margin":"30.0","minimum_margin":"15.0","maximum_order_size":"2000.0","minimum_order_size":"0.08","expiration":"NA"}]
https://api.bitfinex.com/v1/order/new POST https://api.bitfinex.com/v1/order/new 
Request: {'X-BFX-APIKEY': 'JK02gR0XL44OfAeuXmyXKpp7tAy7ve4CkCl1tv7h4Zp', 'X-BFX-PAYLOAD': 'eyJub25jZSI6IjE1MDk2NDY1MjU4NzIiLCJyZXF1ZXN0IjoiL3YxL29yZGVyL25ldyIsInN5bWJvbCI6IkxUQ1VTRCIsImFtb3VudCI6IjEiLCJzaWRlIjoic2VsbCIsInR5cGUiOiJleGNoYW5nZSBsaW1pdCIsIm9jb29yZGVyIjpmYWxzZSwiYnV5X3ByaWNlX29jbyI6MCwic2VsbF9wcmljZV9vY28iOjAsInByaWNlIjoiNTUwIn0=', 'X-BFX-SIGNATURE': '66e5248962ac8187cd2ebbc2c514b69a0674853aef5b225c5405057d5fabfe4f3184deee89f9228979aa5252f0b4d4a1', 'User-Agent': 'ccxt/1.9.346 (+https://github.com/ccxt-dev/ccxt) Python/3.6.2', 'Accept-Encoding': 'gzip, deflate'} None
Traceback (most recent call last):

  File "<ipython-input-6-4810d0cd0860>", line 1, in <module>
    runfile('C:/Users/Mario/Documents/bitfinexDeployed/ccxt1.py', wdir='C:/Users/Mario/Documents/bitfinexDeployed')

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
    execfile(filename, namespace)

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/Mario/Documents/bitfinexDeployed/ccxt1.py", line 15, in <module>
    bitfinex.create_order('LTC/USD','limit','sell','1','550')

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\bitfinex.py", line 237, in create_order
    result = self.privatePostOrderNew(self.extend(order, params))

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\bitfinex.py", line 420, in request
    response = self.fetch2(path, api, method, params, headers, body)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 238, in fetch2
    return self.fetch(request['url'], request['method'], request['headers'], request['body'])

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 295, in fetch
    self.handle_rest_errors(e, e.code, message if message else text, url, method)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 323, in handle_rest_errors
    self.raise_error(error, url, method, exception if exception else http_status_code, response)

  File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 220, in raise_error
    details,

ExchangeNotAvailable: bitfinex POST https://api.bitfinex.com/v1/order/new 400 Bad Request  {"message":"Nonce is too small."}

Thanks to you to all working you are doing!!

@kroitor
Copy link
Member

kroitor commented Nov 2, 2017

@Vyllonder ok, so, now we see that Bitfinex says "Nonce is too small". So, that's a nonce problem. Did you use the keypair anywhere else before? If you did, the software might have screwed the nonce number too high on that keypair. So, you can simply create a new keypair. And the problem will be gone. Or you can redefine the nonce.

See here how to redefine it:

Let me know if it helped you or not, plz.

@kroitor kroitor closed this as completed Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants