feat: add XRP and SOL symbols (4 coins total)

This commit is contained in:
root 2026-02-28 10:11:05 +00:00
parent 3155e8848b
commit 0ac2225979
5 changed files with 8 additions and 8 deletions

View File

@ -35,7 +35,7 @@ logging.basicConfig(
logger = logging.getLogger("collector") logger = logging.getLogger("collector")
BINANCE_FAPI = "https://fapi.binance.com/fapi/v1" BINANCE_FAPI = "https://fapi.binance.com/fapi/v1"
SYMBOLS = ["BTCUSDT", "ETHUSDT"] SYMBOLS = ["BTCUSDT", "ETHUSDT", "XRPUSDT", "SOLUSDT"]
HEADERS = {"User-Agent": "Mozilla/5.0 ArbitrageEngine/3.0"} HEADERS = {"User-Agent": "Mozilla/5.0 ArbitrageEngine/3.0"}
BATCH_SIZE = 200 BATCH_SIZE = 200

View File

@ -23,7 +23,7 @@ app.add_middleware(
app.include_router(auth_router) app.include_router(auth_router)
BINANCE_FAPI = "https://fapi.binance.com/fapi/v1" BINANCE_FAPI = "https://fapi.binance.com/fapi/v1"
SYMBOLS = ["BTCUSDT", "ETHUSDT"] SYMBOLS = ["BTCUSDT", "ETHUSDT", "XRPUSDT", "SOLUSDT"]
HEADERS = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"} HEADERS = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"}
# 简单内存缓存history/stats 60秒rates 3秒 # 简单内存缓存history/stats 60秒rates 3秒
@ -424,7 +424,7 @@ async def get_signal_indicators(
@app.get("/api/signals/latest") @app.get("/api/signals/latest")
async def get_signal_latest(user: dict = Depends(get_current_user)): async def get_signal_latest(user: dict = Depends(get_current_user)):
result = {} result = {}
for sym in ["BTCUSDT", "ETHUSDT"]: for sym in SYMBOLS:
row = await async_fetchrow( row = await async_fetchrow(
"SELECT ts, cvd_fast, cvd_mid, cvd_day, cvd_fast_slope, atr_5m, atr_percentile, " "SELECT ts, cvd_fast, cvd_mid, cvd_day, cvd_fast_slope, atr_5m, atr_percentile, "
"vwap_30m, price, p95_qty, p99_qty, score, signal " "vwap_30m, price, p95_qty, p99_qty, score, signal "
@ -440,7 +440,7 @@ async def get_signal_latest(user: dict = Depends(get_current_user)):
async def get_market_indicators(user: dict = Depends(get_current_user)): async def get_market_indicators(user: dict = Depends(get_current_user)):
"""返回最新的market_indicators数据V5.1新增4个数据源""" """返回最新的market_indicators数据V5.1新增4个数据源"""
result = {} result = {}
for sym in ["BTCUSDT", "ETHUSDT"]: for sym in SYMBOLS:
indicators = {} indicators = {}
for ind_type in ["long_short_ratio", "top_trader_position", "open_interest_hist", "coinbase_premium"]: for ind_type in ["long_short_ratio", "top_trader_position", "open_interest_hist", "coinbase_premium"]:
row = await async_fetchrow( row = await async_fetchrow(

View File

@ -9,7 +9,7 @@ import aiohttp
import psycopg2 import psycopg2
from psycopg2.extras import Json from psycopg2.extras import Json
SYMBOLS = ["BTCUSDT", "ETHUSDT"] SYMBOLS = ["BTCUSDT", "ETHUSDT", "XRPUSDT", "SOLUSDT"]
INTERVAL_SECONDS = 300 INTERVAL_SECONDS = 300
PG_HOST = os.getenv("PG_HOST", "127.0.0.1") PG_HOST = os.getenv("PG_HOST", "127.0.0.1")

View File

@ -34,7 +34,7 @@ logging.basicConfig(
) )
logger = logging.getLogger("signal-engine") logger = logging.getLogger("signal-engine")
SYMBOLS = ["BTCUSDT", "ETHUSDT"] SYMBOLS = ["BTCUSDT", "ETHUSDT", "XRPUSDT", "SOLUSDT"]
LOOP_INTERVAL = 15 # 秒从5改15CPU降60%,信号质量无影响) LOOP_INTERVAL = 15 # 秒从5改15CPU降60%,信号质量无影响)
# 窗口大小(毫秒) # 窗口大小(毫秒)

View File

@ -9,7 +9,7 @@ import {
ReferenceLine, CartesianGrid, Legend ReferenceLine, CartesianGrid, Legend
} from "recharts"; } from "recharts";
type Symbol = "BTC" | "ETH"; type Symbol = "BTC" | "ETH" | "XRP" | "SOL";
interface IndicatorRow { interface IndicatorRow {
ts: number; ts: number;
@ -456,7 +456,7 @@ export default function SignalsPage() {
<p className="text-slate-500 text-xs mt-0.5">100 + + </p> <p className="text-slate-500 text-xs mt-0.5">100 + + </p>
</div> </div>
<div className="flex gap-1.5"> <div className="flex gap-1.5">
{(["BTC", "ETH"] as Symbol[]).map(s => ( {(["BTC", "ETH", "XRP", "SOL"] as Symbol[]).map(s => (
<button key={s} onClick={() => setSymbol(s)} <button key={s} onClick={() => setSymbol(s)}
className={`px-4 py-1.5 rounded-lg border text-sm font-medium transition-colors ${symbol === s ? "bg-blue-600 text-white border-blue-600" : "border-slate-200 text-slate-600 hover:border-blue-400"}`}> className={`px-4 py-1.5 rounded-lg border text-sm font-medium transition-colors ${symbol === s ? "bg-blue-600 text-white border-blue-600" : "border-slate-200 text-slate-600 hover:border-blue-400"}`}>
{s} {s}