From 8032688acba041dd81878570c304f887ce8ea001 Mon Sep 17 00:00:00 2001 From: Oleg Sheynin Date: Tue, 5 Nov 2024 23:39:28 -0500 Subject: [PATCH] crypto_exch_stat --- market_data/relative_liquidity/Dockerfile | 2 +- release_version.txt | 2 +- research/crypto_exch_stats/.dockerignore | 3 +++ research/crypto_exch_stats/Dockerfile | 29 +++++++++++++++++++++ research/crypto_exch_stats/requirements.txt | 7 +++++ research/crypto_exch_stats/run.sh | 16 ++++++++++++ 6 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 research/crypto_exch_stats/.dockerignore create mode 100644 research/crypto_exch_stats/Dockerfile create mode 100644 research/crypto_exch_stats/requirements.txt create mode 100755 research/crypto_exch_stats/run.sh diff --git a/market_data/relative_liquidity/Dockerfile b/market_data/relative_liquidity/Dockerfile index e6c8a92..08332bd 100644 --- a/market_data/relative_liquidity/Dockerfile +++ b/market_data/relative_liquidity/Dockerfile @@ -17,7 +17,7 @@ CMD [ \ "cvttpy/apps/md/rel_lqdt_server.py", \ "--port=5678", \ "--db_file=/app/data/rel_liquidity.db", \ - "--log_file=/logs/%%T.REL_LIQUIDITY_SVC.log" \ + "--log_file=/logs/%T.REL_LIQUIDITY_SVC.log" \ ] diff --git a/release_version.txt b/release_version.txt index 5d8a667..275500a 100644 --- a/release_version.txt +++ b/release_version.txt @@ -1 +1 @@ -0.0.3,alpaca_qat loader from disted version \ No newline at end of file +0.0.4,crypto_exch_stats \ No newline at end of file diff --git a/research/crypto_exch_stats/.dockerignore b/research/crypto_exch_stats/.dockerignore new file mode 100644 index 0000000..a4f7c14 --- /dev/null +++ b/research/crypto_exch_stats/.dockerignore @@ -0,0 +1,3 @@ +.git +**/__pycache__ +.pipenv \ No newline at end of file diff --git a/research/crypto_exch_stats/Dockerfile b/research/crypto_exch_stats/Dockerfile new file mode 100644 index 0000000..a15fb4c --- /dev/null +++ b/research/crypto_exch_stats/Dockerfile @@ -0,0 +1,29 @@ +FROM python:3.12-slim + +WORKDIR / +COPY docker_dev/research/crypto_exch_stats/requirements.txt / + +RUN pip install --upgrade pip --root-user-action=ignore +RUN pip install -r /requirements.txt --root-user-action=ignore + +COPY cvttpy /cvttpy + +# Shared Volumes +RUN mkdir -p /app/data +RUN mkdir /logs + +ENV PYTHONPATH=/ +CMD [ \ + "python3.12", \ + "cvttpy/apps//research/exchange_trading_stats.py", \ + "--config=http://cloud23.cvtt.vpn:6789/apps/tests/listen_market_data", \ + "--active_exchanges=OKX,GEMINI,BITSTAMP,COINBASE_AT,BNBSPOT,KRAKEN", \ + "--instruments=OKX:PAIR-BTC-USDT,GEMINI:PAIR-BTC-USD,BITSTAMP:PAIR-BTC-USD,COINBASE:PAIR-BTC-USD,BNBSPOT:PAIR-BTC-USDT,KRAKEN:PAIR-BTC-USD", \ + "--db_file=/app/data/exchange_trading_stats.db", \ + "--log_level=INFO", \ + "--log_file=/logs/%T.EXCHANGE_TRADING_STATS.log" \ +] + +# ---------- No BNBSPOT from USA +# "--active_exchanges=OKX,GEMINI,BITSTAMP,COINBASE_AT,KRAKEN", \ +# "--instruments=OKX:PAIR-BTC-USDT,GEMINI:PAIR-BTC-USD,BITSTAMP:PAIR-BTC-USD,COINBASE:PAIR-BTC-USD,KRAKEN:PAIR-BTC-USD", \ diff --git a/research/crypto_exch_stats/requirements.txt b/research/crypto_exch_stats/requirements.txt new file mode 100644 index 0000000..9db6792 --- /dev/null +++ b/research/crypto_exch_stats/requirements.txt @@ -0,0 +1,7 @@ +aiohttp>=3.7.4.post0 +nest-asyncio>=1.5.5 +numpy>=1.24.1 +hjson>=3.1.0 +pandas>=1.5.3 +sortedcontainers>=2.4.0 +redis>=5.0.8 \ No newline at end of file diff --git a/research/crypto_exch_stats/run.sh b/research/crypto_exch_stats/run.sh new file mode 100755 index 0000000..bbf3016 --- /dev/null +++ b/research/crypto_exch_stats/run.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +Cmd="docker run" +Cmd+=" -d" +# Cmd+=" --rm" +Cmd+=" --pull=always" +Cmd+=" --network=host" +Cmd+=" --name=crypto_exch_stats" +Cmd+=" --volume=${HOME}/prod/data:/app/data" +Cmd+=" --volume=${HOME}/prod/logs:/logs" +Cmd+=" cloud21.cvtt.vpn:5500/crypto_exch_stats:latest" + +echo ${Cmd} +eval ${Cmd} +# Cmd+=" cloud21.cvtt.vpn:5500/relative_liquidity:latest" +