update
This commit is contained in:
parent
83c9033967
commit
04783937df
@ -212,8 +212,8 @@ class Settings(BaseSettings):
|
|||||||
hyperliquid_trading_enabled: bool = False # Hyperliquid 实盘交易开关(默认关闭)
|
hyperliquid_trading_enabled: bool = False # Hyperliquid 实盘交易开关(默认关闭)
|
||||||
|
|
||||||
# Hyperliquid 环境变量(由 clawfi-hyperliquid-skill 安装脚本注入)
|
# Hyperliquid 环境变量(由 clawfi-hyperliquid-skill 安装脚本注入)
|
||||||
# CLAWFI_WALLET_ADDRESS - 主钱包地址
|
clawfi_wallet_address: Optional[str] = None # 主钱包地址
|
||||||
# CLAWFI_PRIVATE_KEY - Agent 专用私钥
|
clawfi_private_key: Optional[str] = None # Agent 专用私钥
|
||||||
|
|
||||||
# Hyperliquid 风险控制
|
# Hyperliquid 风险控制
|
||||||
hyperliquid_max_total_leverage: float = 10.0 # 总杠杆上限(≤10x,ClawFi 强制规则)
|
hyperliquid_max_total_leverage: float = 10.0 # 总杠杆上限(≤10x,ClawFi 强制规则)
|
||||||
|
|||||||
@ -28,14 +28,14 @@ class HyperliquidTradingService:
|
|||||||
|
|
||||||
self.settings = get_settings()
|
self.settings = get_settings()
|
||||||
|
|
||||||
# 从环境变量加载认证信息
|
# 从 settings 加载认证信息
|
||||||
self.wallet_address = os.getenv("CLAWFI_WALLET_ADDRESS")
|
self.wallet_address = self.settings.clawfi_wallet_address
|
||||||
self.private_key = os.getenv("CLAWFI_PRIVATE_KEY")
|
self.private_key = self.settings.clawfi_private_key
|
||||||
|
|
||||||
if not self.wallet_address or not self.private_key:
|
if not self.wallet_address or not self.private_key:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"缺少 Hyperliquid 认证信息。请运行: "
|
"缺少 Hyperliquid 认证信息。请在 .env 中设置: "
|
||||||
"npx clawfi-hyperliquid-skill --wallet=0x... --key=0x..."
|
"CLAWFI_WALLET_ADDRESS 和 CLAWFI_PRIVATE_KEY"
|
||||||
)
|
)
|
||||||
|
|
||||||
# 风控配置
|
# 风控配置
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user