-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
46 lines (34 loc) · 1.22 KB
/
Copy pathconfig.py
File metadata and controls
46 lines (34 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from pydantic import field_validator
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
# Telegram listener
telegram_api_id: int = 0
telegram_api_hash: str = ""
telegram_phone: str = ""
# Telegram control bot
telegram_control_bot_token: str = ""
telegram_chat_id: int = 0
# Solana
solana_rpc_url: str = ""
jito_rpc_url: str = "https://mainnet.block-engine.jito.wtf/api/v1"
wallet_private_key: str = ""
# Trading parameters
max_position_pct: float = 0.05
max_concurrent_positions: int = 3
daily_loss_limit_pct: float = 0.20
time_sl_hours: float = 2.0
# Signal channels (comma-separated string → list)
signal_channels: list[str] = []
@field_validator("signal_channels", mode="before")
@classmethod
def parse_channels(cls, v: str | list) -> list[str]:
if isinstance(v, str):
return [c.strip() for c in v.split(",") if c.strip()]
return v
# Safety switches
dry_run: bool = True
paper_trade: bool = True
# Signal filtering
min_conviction: int = 6
settings = Settings()