Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions aware-fund/services/analytics/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ COPY notifications/ ./notifications/
# Environment defaults
ENV CLICKHOUSE_HOST=clickhouse
ENV CLICKHOUSE_PORT=8123
ENV CLICKHOUSE_NATIVE_PORT=9000
ENV CLICKHOUSE_DATABASE=polybot
ENV SCORING_INTERVAL_SECONDS=3600
ENV MIN_TRADES=10
Expand Down
2 changes: 1 addition & 1 deletion aware-fund/services/analytics/nav_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def run_nav_calculation():
Called by scheduler or run_all.py every 5 minutes.
"""
ch_host = os.getenv('CLICKHOUSE_HOST', 'localhost')
ch_port = int(os.getenv('CLICKHOUSE_PORT', '9000'))
ch_port = int(os.getenv('CLICKHOUSE_NATIVE_PORT', '9000'))

logger.info("Starting NAV calculation...")

Expand Down
5 changes: 3 additions & 2 deletions aware-fund/services/analytics/run_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

Environment Variables:
CLICKHOUSE_HOST - ClickHouse host (default: localhost)
CLICKHOUSE_PORT - ClickHouse port (default: 8123)
CLICKHOUSE_PORT - ClickHouse HTTP port (default: 8123)
CLICKHOUSE_NATIVE_PORT - ClickHouse native TCP port, used by NAV calc (default: 9000)
CLICKHOUSE_DATABASE - Database name (default: polybot)
"""

Expand Down Expand Up @@ -692,7 +693,7 @@ def run_nav_calculation_job(ch_client) -> dict:

# NAVCalculator uses clickhouse_driver, not clickhouse_connect
ch_host = os.getenv('CLICKHOUSE_HOST', 'localhost')
ch_port = int(os.getenv('CLICKHOUSE_PORT', '9000'))
ch_port = int(os.getenv('CLICKHOUSE_NATIVE_PORT', '9000'))
driver_client = Client(host=ch_host, port=ch_port)

calculator = NAVCalculator(driver_client)
Expand Down
2 changes: 1 addition & 1 deletion aware-fund/services/analytics/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def run_insider_detection():

# Create ClickHouse client
ch_host = os.getenv('CLICKHOUSE_HOST', 'localhost')
ch_port = int(os.getenv('CLICKHOUSE_PORT', '9000'))
ch_port = int(os.getenv('CLICKHOUSE_NATIVE_PORT', '9000'))
client = Client(host=ch_host, port=ch_port)

# Run detection
Expand Down
1 change: 1 addition & 0 deletions deploy/docker-compose.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ services:
environment:
CLICKHOUSE_HOST: clickhouse
CLICKHOUSE_PORT: 8123
CLICKHOUSE_NATIVE_PORT: 9000
CLICKHOUSE_DATABASE: polybot
SCORING_INTERVAL_SECONDS: 3600
LOG_LEVEL: INFO
Expand Down
1 change: 1 addition & 0 deletions docker-compose.local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ services:
environment:
CLICKHOUSE_HOST: clickhouse
CLICKHOUSE_PORT: 8123
CLICKHOUSE_NATIVE_PORT: 9000
CLICKHOUSE_DATABASE: polybot
SCORING_INTERVAL_SECONDS: 3600
LOG_LEVEL: INFO
Expand Down