Giter VIP home page Giter VIP logo

binance-proxy's People

Contributors

abanchev avatar bschneppe avatar fmhc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

binance-proxy's Issues

Binance Ban IP

hello, I don't think it s an issue, but i don't understand why thats happening.
I have 4 bots running behind binance_proxy

configured like this on the config file

{
    "exchange": {
        "name": "binance",
        "key": "",
        "secret": "",
        "ccxt_config": {
            "enableRateLimit": false,
            "urls": {
                "api": {
                    "public": "http://proxy:8080/api/v3"
                }
            }
        },
        "ccxt_async_config": {
            "enableRateLimit": false
        }
    }
}

but since yesterday, I get error message on all 4 FT instances :

requests.exceptions.HTTPError: 418 Client Error: I'm a teapot for url: http://proxy:8080/api/v3/exchangeInfo
.....
ccxt.base.errors.DDoSProtection: binance 418 I'm a teapot {"code":-1003,"msg":"Way too much request weight used; IP banned until 1635504416554. Please use the websocket for live updates to avoid bans."}

I thought the proxy was using websocket to get its market update. So i m not sure why this happens.

any idea ???

Build Issues

While building the container I ran into these, safe to ignore?

warning node-binance-api > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning node-binance-api > request > [email protected]: this library is no longer supported
warning node-binance-api > request > [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning node-binance-api > url > [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.

Error in FreqTrade

Im getting this error when starting the docker container with FreqTrade configured to use this:

freqtrade | 2021-09-08 01:47:29,807 - freqtrade.exchange.common - WARNING - Giving up retrying: _async_get_candle_history()

freqtrade | 2021-09-08 01:47:29,808 - freqtrade.exchange.common - WARNING - _async_get_candle_history() returned exception: "Could not fetch historical candle (OHLCV) data for pair XRP/USDT due to ExchangeNotAvailable. Message: binance GET http://127.0.0.1:8080/api/v3/exchangeInfo 404 Not Found {"detail":"Not Found"}"

This error repeats for all the pairs in my volume list.

error when start proxy-from source

ubuntu@instance-1755:~/binance-proxy$ npm start

[email protected] start /home/ubuntu/binance-proxy
node .

/home/ubuntu/binance-proxy/src/index.js:1
import getServer from "./server/index.js";
^^^^^^^^^

SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node .
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2022-02-28T17_45_55_945Z-debug.log

Plans to also support kraken?

Are you planning on supporting different APIs/exchanges? As far as I have seen there is also an kraken node package out there.

Managing concurrent exchanges in one instance might me difficult. But also supporting kraken should be relatively easy - don’t you think?

error

I'm getting this error from the docker log with a 10 freqtrade instances test after 3h

(node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '6' of undefined
    at Client.getCandles (file:///usr/src/app/src/client.js:50:46)
    at file:///usr/src/app/src/server/index.js:16:31
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at /usr/src/app/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
    at Function.handle (/usr/src/app/node_modules/express/lib/router/index.js:174:3)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
This error originated either by throwing inside of an async function without a catch block, 
or by rejecting a promise which was not handled with .catch(). 
To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` 
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 47318)

and i have been seeing a teapot message on another FT instance, so i guess i was IP-banned. can we have a better error handling / check if ban or maybe even an output signalling the current API weight / or think about throttling it down somehow?

Request : Publish on Docker Repo

hello, first of all thanks for the project. are you planning to push the docker image to docker hub or some repo where we can directly use docker-compose up directly from there without moving the files over?

Resource Usage

Is this kind of resource usage expected?

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                                      
 156297 root      20   0   10.9g 627964  21664 S  47.2  30.9   3:01.58 node .                                                                                                                           
 156655 root      20   0  837012 386568  36340 S  19.9  19.0   1:14.82 /root/freqtrade/.env/bin/python3.9 /root/freqtrade/.env/bin/freqtrade trade --sd-notify --user-data /root/.config/freqtrade/live-binance-bu+ 
 156682 root      20   0  837432 387408  36380 S  15.9  19.0   0:57.58 /root/freqtrade/.env/bin/python3.9 /root/freqtrade/.env/bin/freqtrade trade --sd-notify --user-data /root/.config/freqtrade/live-binance -c+ 
 152114 root      20   0  975528  30972  10132 S   0.3   1.5   0:02.37 /usr/bin/containerd

Error: Cannot find module '/usr/src/app'

Install proxy with Docker give the same error over and over again. changing workdir does not help.

binance_proxy | internal/modules/cjs/loader.js:905
binance_proxy | throw err;
binance_proxy | ^
binance_proxy |
binance_proxy | Error: Cannot find module '/usr/src/app'
binance_proxy | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
binance_proxy | at Function.Module._load (internal/modules/cjs/loader.js:746:27)
binance_proxy | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
binance_proxy | at internal/main/run_main_module.js:17:47 {
binance_proxy | code: 'MODULE_NOT_FOUND',
binance_proxy | requireStack: []
binance_proxy | }
binance_proxy | internal/modules/cjs/loader.js:905
binance_proxy | throw err;
binance_proxy | ^
binance_proxy |
binance_proxy | Error: Cannot find module '/usr/src/app'
binance_proxy | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
binance_proxy | at Function.Module._load (internal/modules/cjs/loader.js:746:27)
binance_proxy | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
binance_proxy | at internal/main/run_main_module.js:17:47 {
binance_proxy | code: 'MODULE_NOT_FOUND',
binance_proxy | requireStack: []
binance_proxy | }
binance_proxy | internal/modules/cjs/loader.js:905
binance_proxy | throw err;
binance_proxy | ^
binance_proxy |
binance_proxy | Error: Cannot find module '/usr/src/app'
binance_proxy | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
binance_proxy | at Function.Module._load (internal/modules/cjs/loader.js:746:27)
binance_proxy | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
binance_proxy | at internal/main/run_main_module.js:17:47 {
binance_proxy | code: 'MODULE_NOT_FOUND',
binance_proxy | requireStack: []
binance_proxy | }
binance_proxy | internal/modules/cjs/loader.js:905
binance_proxy | throw err;
binance_proxy | ^
binance_proxy |
binance_proxy | Error: Cannot find module '/usr/src/app'
binance_proxy | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
binance_proxy | at Function.Module._load (internal/modules/cjs/loader.js:746:27)
binance_proxy | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
binance_proxy | at internal/main/run_main_module.js:17:47 {
binance_proxy | code: 'MODULE_NOT_FOUND',
binance_proxy | requireStack: []
binance_proxy | }
binance_proxy | internal/modules/cjs/loader.js:905
binance_proxy | throw err;
binance_proxy | ^
binance_proxy |
binance_proxy | Error: Cannot find module '/usr/src/app'
binance_proxy | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
binance_proxy | at Function.Module._load (internal/modules/cjs/loader.js:746:27)
binance_proxy | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
binance_proxy | at internal/main/run_main_module.js:17:47 {
binance_proxy | code: 'MODULE_NOT_FOUND',
binance_proxy | requireStack: []
binance_proxy | }
binance_proxy | internal/modules/cjs/loader.js:905
binance_proxy | throw err;
binance_proxy | ^
binance_proxy |
binance_proxy | Error: Cannot find module '/usr/src/app'
binance_proxy | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
binance_proxy | at Function.Module._load (internal/modules/cjs/loader.js:746:27)
binance_proxy | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
binance_proxy | at internal/main/run_main_module.js:17:47 {
binance_proxy | code: 'MODULE_NOT_FOUND',
binance_proxy | requireStack: []
binance_proxy | }
binance_proxy exited with code 1

clarification for installation needed

Hi,

could you place a dummy setup including freqtrade on the repo?
Some things are not clear, having issues using your proxy.

Getting errors like that, despite copying it over.
It would be beneficial aswell if you didnt use the 8080 port since that is the default freqtrade port aswell.
Could you make the example with the container name instead of 127.0.0.1?

binance-proxy | internal/modules/cjs/loader.js:328
binance-proxy | throw err;
binance-proxy | ^
binance-proxy |
binance-proxy | Error: Cannot find module '/usr/src/app/src/index.js'. Please verify that the package.json has a valid "main" entry
binance-proxy | at tryPackage (internal/modules/cjs/loader.js:320:19)
binance-proxy | at Function.Module._findPath (internal/modules/cjs/loader.js:533:18)
binance-proxy | at resolveMainPath (internal/modules/run_main.js:16:25)
binance-proxy | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:70:24)
binance-proxy | at internal/main/run_main_module.js:17:47 {
binance-proxy | code: 'MODULE_NOT_FOUND',
binance-proxy | path: '/usr/src/app/package.json',
binance-proxy | requestPath: '/usr/src/app'
binance-proxy | }

Thx!

Errors in binance-proxy docker

Hi,
In binance-proxy docker I get the following error:
(node:1) UnhandledPromiseRejectionWarning: FetchError: request to https://api.binance.com/api/v3/klines?symbol=XTZUSDT&interval=5m failed, reason: getaddrinfo ENOTFOUND api.binance.com

at ClientRequest.<anonymous> (/usr/src/app/node_modules/node-fetch/lib/index.js:1483:11)

at ClientRequest.emit (events.js:400:28)

at TLSSocket.socketErrorListener (_http_client.js:475:9)

at TLSSocket.emit (events.js:400:28)

at emitErrorNT (internal/streams/destroy.js:106:8)

at emitErrorCloseNT (internal/streams/destroy.js:74:3)

at processTicksAndRejections (internal/process/task_queues.js:82:21)

(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 181)

I checked and my DNS servers are good, any idea how to solve it?

Thanks.

Docker-compose - Windows - Network_mode: host not supported

Hi abanchev,

thank you for your awesome work!
I ran into the problem that windows is not supporting the network_mode host.
I have changed the docker-compose file to
--- version: '3' services: proxy: build: . container_name: binance-proxy restart: unless-stopped ports: - "8080:8080"

Best
Björn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.