Fix tab switching + $100K paper trading capital

Tab IDs now match JavaScript: tab-backtest instead of tab-bt.
Paper trading increased to $100,000 ($10K per strategy, $30K reserve).
Server default paper metrics updated to $100K.
This commit is contained in:
ramseshk
2026-08-04 04:26:38 +00:00
parent f26892f8b2
commit 7a5fdf2f8d
3 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ def read_paper_metrics() -> dict:
return json.load(f)
except (json.JSONDecodeError, IOError):
pass
return {"status": "waiting", "mode": "paper", "strategies": {}, "trades": [], "equity_history": [], "total_pnl": 0, "total_equity": 5000}
return {"status": "waiting", "mode": "paper", "strategies": {}, "trades": [], "equity_history": [], "total_pnl": 0, "total_equity": 100000}
# ═══════════════════════════════════════════════════════════
+3 -3
View File
@@ -84,9 +84,9 @@ footer{text-align:center;padding:20px;font-size:10px;color:#3f3f46}footer a{colo
<div class="totals"><div class="label" style="font-size:10px;color:var(--text);text-transform:uppercase;letter-spacing:0.5px">Portfolio PnL</div><div class="pnl" id="stpnl">$0.00</div><div class="sub" id="stpct">0.00%</div></div>
</div>
<div class="tabs">
<button class="tab on" id="tab-live" onclick="sw('live')">Live Trading<span class="data-badge testnet">Testnet</span></button>
<button class="tab" id="tab-paper" onclick="sw('paper')">Paper Trading<span class="data-badge mainnet">Mainnet</span></button>
<button class="tab" id="tab-bt" onclick="sw('backtest')">Backtesting</button>
<button class="tab on" id="tab-live" onclick="sw('live')">Live<span class="data-badge testnet">Testnet</span></button>
<button class="tab" id="tab-paper" onclick="sw('paper')">Paper<span class="data-badge mainnet">Mainnet</span></button>
<button class="tab" id="tab-backtest" onclick="sw('backtest')">Backtest</button>
</div>
<!-- LIVE -->
+9 -9
View File
@@ -22,8 +22,8 @@ log = logging.getLogger("ftdt-paper")
MAINNET_API = "https://api.hyperliquid.xyz/info"
METRICS_FILE = "/tmp/ftdt-paper-metrics.json"
STARTING_CAPITAL = 5000.0 # 1000 USDC per strategy × 5 BTC, +500 for ETH
RESERVE = 1000.0
STARTING_CAPITAL = 100000.0 # $100,000 paper trading capital
RESERVE = 30000.0
TAKER_FEE = 0.0005 # 5 bps taker (realistic for paper fills)
SLIPPAGE_BPS = 1.0 # 1 bps slippage
@@ -31,49 +31,49 @@ SLIPPAGE_BPS = 1.0 # 1 bps slippage
STRATEGIES = {
"Order Book Imbalance": {
"allocation": 1000.0, "instrument": "BTC", "pnl": 0.0,
"allocation": 10000.0, "instrument": "BTC", "pnl": 0.0,
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
"signals": [], "type": "reversal", "size": 0.002,
"description": "L2 bid/ask volume skew — buys when bids dominate, sells when asks dominate. Mean-reverting at volume extremes.",
},
"Iceberg Detection": {
"allocation": 1000.0, "instrument": "BTC", "pnl": 0.0,
"allocation": 10000.0, "instrument": "BTC", "pnl": 0.0,
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
"signals": [], "type": "momentum", "size": 0.001,
"description": "Detects whale accumulation (many small buys over time). Follows the smart money flow.",
},
"Funding Rate Arb": {
"allocation": 1000.0, "instrument": "BTC", "pnl": 0.0,
"allocation": 10000.0, "instrument": "BTC", "pnl": 0.0,
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
"signals": [], "type": "carry", "size": 0.005,
"description": "Delta-neutral carry trade — shorts perp when funding rate is high, collects hourly payments.",
},
"Pairs Trading": {
"allocation": 1000.0, "instrument": "ETH", "pnl": 0.0,
"allocation": 10000.0, "instrument": "ETH", "pnl": 0.0,
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
"signals": [], "type": "stat_arb", "size": 0.05,
"description": "BTC/ETH spread mean reversion — trades when Z-score exceeds 1.5 sigma. Pairs converge back to equilibrium.",
},
"Avellaneda-Stoikov": {
"allocation": 1000.0, "instrument": "BTC", "pnl": 0.0,
"allocation": 10000.0, "instrument": "BTC", "pnl": 0.0,
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
"signals": [], "type": "market_making", "size": 0.001,
"description": "Dual-sided quoting at best bid/ask — captures spread via stochastic control. Simulated fill when spread is crossed.",
},
"Momentum Breakout": {
"allocation": 1000.0, "instrument": "BTC", "pnl": 0.0,
"allocation": 10000.0, "instrument": "BTC", "pnl": 0.0,
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
"signals": [], "type": "momentum", "size": 0.002,
"description": "Bollinger Band (2σ) breakout — enters when price breaks bands with volume confirmation.",
},
"Mean Reversion": {
"allocation": 1000.0, "instrument": "BTC", "pnl": 0.0,
"allocation": 10000.0, "instrument": "BTC", "pnl": 0.0,
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
"signals": [], "type": "reversal", "size": 0.002,