48 lines
1.5 KiB
Python
48 lines
1.5 KiB
Python
from pathlib import Path
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
ROOT_DIR = Path(__file__).resolve().parents[2]
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(
|
|
env_file=str(ROOT_DIR / ".env"),
|
|
env_file_encoding="utf-8",
|
|
extra="ignore",
|
|
)
|
|
|
|
wecom_webhook_url: str = ""
|
|
binance_fapi_base: str = "https://fapi.binance.com"
|
|
top_n: int = 30
|
|
volume_threshold: float = 10_000_000
|
|
change_threshold: float = 5.0
|
|
refresh_minutes: int = 240
|
|
host: str = "127.0.0.1"
|
|
port: int = 21450
|
|
db_path: str = str(ROOT_DIR / "data" / "monitor.db")
|
|
max_concurrency: int = 3
|
|
request_interval_sec: float = 0.15
|
|
ban_cooldown_sec: int = 90
|
|
max_retries: int = 5
|
|
candidate_pool: int = 150
|
|
# today: ticker24h=仅1次API(滚动24h); yesterday: klines=按8:00切日精确统计
|
|
today_data_mode: str = "ticker24h"
|
|
yesterday_data_mode: str = "klines"
|
|
chart_kline_limit: int = 300
|
|
chart_cache_minutes: int = 60
|
|
funding_history_limit: int = 90
|
|
funding_cache_minutes: int = 30
|
|
# 代理默认关闭;仅当 PROXY_ENABLED=true 时生效
|
|
proxy_enabled: bool = False
|
|
proxy_url: str = "socks5h://192.168.8.4:1081"
|
|
proxy_for: str = "binance" # binance | wecom | all
|
|
llm_base_url: str = "http://op.bz121.com"
|
|
llm_api_key: str = ""
|
|
llm_model: str = "gemma4:e4b"
|
|
llm_symbol_interval_sec: int = 180
|
|
llm_auto_on_startup: bool = True
|
|
|
|
|
|
settings = Settings()
|