ctubio / Krypto-trading-bot

Self-hosted crypto trading bot (automated high frequency market making) written in C++
https://127.0.0.1:3000
Other
3.37k stars 823 forks source link

Issue to fetch data from Bitfinex! #451

Closed Camille92 closed 6 years ago

Camille92 commented 6 years ago

Hi Carles,

I tried to trade on new markets on Bitfinex, but after a short success and an update of the bot (from a rather old version), I can't make those markets work.

I don't know if it comes from Bitfinex or the bot but I get that:

│ K version 0day.
│ 21:13:08.576672 DB /data/db/K.4.YYW.USD.db loaded OK.
│ 21:13:08.576933 UI ready over HTTP on external port 3013.
│ 21:13:08.577421 QP Warrrrning: using default values for Quoting Parameters.
│ 21:13:08.577587 DB loaded 0 historical Trades.
│ 21:13:08.577733 DB loaded 0 STDEV Periods.
│ 21:13:08.579391 DB loaded TBP = 0.00000000 YYW.
│ 
21:13:08.702405 CF Errrror: Unable to fetch data from BITFINEX symbol "yywusd".-
K crashed with exit code 1.. Respawning..

Maybe you can try on your side and tell me if you have the same issue!

Best,

Camille

Camille92 commented 6 years ago

Well now I have the issue on all the markets, so I guess it's a more general bug :/

ctubio commented 6 years ago

here works

│ 22:17:21.758105 QP Warrrrning: using default values for Quoting Parameters.
│ 22:17:21.930498 DB loaded 0 historical Trades.
│ 22:17:22.007268 DB loaded 0 STDEV Periods.
│ 22:17:22.842722 GW BITFINEX allows client IP.
│ 22:17:22.843026 GW BITFINEX:
│ - autoBot: no
│ - symbols: yywusd
│ - minTick: 0.00001000
│ - minSize: 146.00000000
│ - makeFee: 0.00000000
│ - takeFee: 0.00000000.
│ 22:17:23.302765 GW BITFINEX WS Info {"event":"info","version":2}.
│ 22:17:23.405115 GW BITFINEX WS Streaming channel 110062:trades.
│ 22:17:23.405745 GW BITFINEX WS Streaming wallet and orders OK 0:"auth".
│ 22:17:23.965167 GW BITFINEX WS Streaming channel 113244:book.
Camille92 commented 6 years ago

Thank you!

Can it be a timer error then?

ctubio commented 6 years ago

no timers here yet

maybe can you see if curl form that machine outputs something somewhat similar to:

 $ curl -vvv https://api.bitfinex.com/v1/pubticker/yywusd
*   Trying 104.16.171.181...
* TCP_NODELAY set
* Connected to api.bitfinex.com (104.16.171.181) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-ECDSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: OU=Domain Control Validated; OU=PositiveSSL Multi-Domain; CN=ssl453718.cloudflaressl.com
*  start date: Aug  8 00:00:00 2017 GMT
*  expire date: Feb 14 23:59:59 2018 GMT
*  subjectAltName: host "api.bitfinex.com" matched cert's "*.bitfinex.com"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=COMODO CA Limited; CN=COMODO ECC Domain Validation Secure Server CA 2
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x559bf1bf6da0)
> GET /v1/pubticker/yywusd HTTP/1.1
> Host: api.bitfinex.com
> User-Agent: curl/7.52.1
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 200
< date: Fri, 01 Dec 2017 22:26:07 GMT
< content-type: application/json; charset=utf-8
< set-cookie: __cfduid=d5edd02283977fac7750a50549843c8a31512167166; expires=Sat, 01-Dec-18 22:26:06 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
< etag: W/"7104315776d90b41fa0293d3b3b4a348"
< cache-control: max-age=0, private, must-revalidate
< x-request-id: c6d3cd52-1944-4433-8fec-08036505b015
< x-runtime: 0.008192
< x-frame-options: SAMEORIGIN
< server: cloudflare-nginx
< cf-ray: 3c6977590e8c56ed-IAD
<
* Curl_http_done: called premature == 0
* Connection #0 to host api.bitfinex.com left intact
{"mid":"0.17215","bid":"0.1719","ask":"0.1724","last_price":"0.1718","low":"0.074","high":"0.295","volume":"17290717.55928331","timestamp":"1512167166.962528"}
Camille92 commented 6 years ago

Well I guess I have my answer

*   Trying 104.16.171.181...
* Connected to api.bitfinex.com (104.16.171.181) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 596 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_ECDSA_AES_128_GCM_SHA256
*    server certificate verification OK
*    server certificate status verification SKIPPED
*    common name: ssl453718.cloudflaressl.com (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: EC
*    certificate version: #3
*    subject: OU=Domain Control Validated,OU=PositiveSSL Multi-Domain,CN=ssl453718.cloudflaressl.com
*    start date: Tue, 08 Aug 2017 00:00:00 GMT
*    expire date: Wed, 14 Feb 2018 23:59:59 GMT
*    issuer: C=GB,ST=Greater Manchester,L=Salford,O=COMODO CA Limited,CN=COMODO ECC Domain Validation Secure Server CA 2
*    compression: NULL
* ALPN, server accepted to use http/1.1
> GET /v1/pubticker/yywusd HTTP/1.1
> Host: api.bitfinex.com
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 429 Too Many Requests
< Date: Fri, 01 Dec 2017 22:27:48 GMT
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: close
< Set-Cookie: __cfduid=dd3e72e8848bc4b43afaf37687efbf1331512167268; expires=Sat, 01-Dec-18 22:27:48 GMT; path=/; domain=.bitfinex.com; HttpOnly
< Retry-After: 15
< Cache-Control: no-cache
< Server: cloudflare-nginx
< CF-RAY: 3c6979d2b84756f9-IAD
< 
* Closing connection 0
{ "error": "ERR_RATE_LIMIT" }
ctubio commented 6 years ago

:sob: let me know anything you consider it could help you avoid this; meanwhile i will try to output this (or possible other) errors at initialy fetching data more clearly

thanks'¡''

Camille92 commented 6 years ago

Haha no worries,

Thank you for helping me finding th problem!

ctubio commented 6 years ago

btw it says the ban last 60 seconds :S https://www.bitfinex.com/posts/188; not sure that is true xD

Camille92 commented 6 years ago

Yes I've seen that, I think the bug is not corrected.

I'm going to do a clean reinstall and try again.

I updated the bot from 10 days ago, so maybe something in-between provoked the problem.

Le 1 déc. 2017 23:42, "Carles Tubio" notifications@github.com a écrit :

btw it says the ban last 60 seconds :S https://www.bitfinex.com/posts/188

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ctubio/Krypto-trading-bot/issues/451#issuecomment-348633795, or mute the thread https://github.com/notifications/unsubscribe-auth/AGizFmmQU5bEyUSZBqd4Tk-sHNJhp5LWks5s8IDmgaJpZM4Qy7Ph .