abanchev / binance-proxy

62 stars 18 forks source link

Binance Ban IP #12

Open feydreva opened 2 years ago

feydreva commented 2 years ago

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 ???

hippocritical commented 2 years ago

this proxy does not fully proxy everything

if you start 4 bots at once then it will bypass the volume queries 4x (volumepairlist) and hence IP ban you.

you will have to delay the startups of your bots for that. dont ever start more than 2 bots within the same minute to be safe. I went to the 1m / bot approach even to never ever have issues then.

feydreva commented 2 years ago

how can I add a delay in between my service on my docker compose file ? is there a way to put a 2 min delay before it starts the next one ?

Also it is strange it only "bug" after 10 days and not at the start.

hippocritical commented 2 years ago

1st : create a file wait.sh in the same folder as your docker-compose file with this content:

!/bin/bash

[ "$SLEEP" ] && sleep $SLEEP

freqtrade $@

2nd: add that to your docker-compose file for every container, specify the wait timer you wish and refer to your now-incoming Dockerfile for the freqtrade container itself, not for the proxy (your Dockerfile name / location might vary, just adapt ...):

freqtrade1: environment: SLEEP: "1" build: context: . dockerfile: "Dockerfile"

3rd: refer to your Dockerfile in the docker-compose.yml and put in something like this:

FROM freqtradeorg/freqtrade:stable

USER root

RUN pip install pandas_ta

COPY wait.sh wait.sh RUN chmod +x wait.sh

USER ftuser

ENTRYPOINT ["/bin/bash", "./wait.sh"]