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:
+1
-1
@@ -86,7 +86,7 @@ def read_paper_metrics() -> dict:
|
|||||||
return json.load(f)
|
return json.load(f)
|
||||||
except (json.JSONDecodeError, IOError):
|
except (json.JSONDecodeError, IOError):
|
||||||
pass
|
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}
|
||||||
|
|
||||||
|
|
||||||
# ═══════════════════════════════════════════════════════════
|
# ═══════════════════════════════════════════════════════════
|
||||||
|
|||||||
@@ -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 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>
|
||||||
<div class="tabs">
|
<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 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 Trading<span class="data-badge mainnet">Mainnet</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-bt" onclick="sw('backtest')">Backtesting</button>
|
<button class="tab" id="tab-backtest" onclick="sw('backtest')">Backtest</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- LIVE -->
|
<!-- LIVE -->
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ log = logging.getLogger("ftdt-paper")
|
|||||||
|
|
||||||
MAINNET_API = "https://api.hyperliquid.xyz/info"
|
MAINNET_API = "https://api.hyperliquid.xyz/info"
|
||||||
METRICS_FILE = "/tmp/ftdt-paper-metrics.json"
|
METRICS_FILE = "/tmp/ftdt-paper-metrics.json"
|
||||||
STARTING_CAPITAL = 5000.0 # 1000 USDC per strategy × 5 BTC, +500 for ETH
|
STARTING_CAPITAL = 100000.0 # $100,000 paper trading capital
|
||||||
RESERVE = 1000.0
|
RESERVE = 30000.0
|
||||||
TAKER_FEE = 0.0005 # 5 bps taker (realistic for paper fills)
|
TAKER_FEE = 0.0005 # 5 bps taker (realistic for paper fills)
|
||||||
SLIPPAGE_BPS = 1.0 # 1 bps slippage
|
SLIPPAGE_BPS = 1.0 # 1 bps slippage
|
||||||
|
|
||||||
@@ -31,49 +31,49 @@ SLIPPAGE_BPS = 1.0 # 1 bps slippage
|
|||||||
|
|
||||||
STRATEGIES = {
|
STRATEGIES = {
|
||||||
"Order Book Imbalance": {
|
"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",
|
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
|
||||||
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
||||||
"signals": [], "type": "reversal", "size": 0.002,
|
"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.",
|
"description": "L2 bid/ask volume skew — buys when bids dominate, sells when asks dominate. Mean-reverting at volume extremes.",
|
||||||
},
|
},
|
||||||
"Iceberg Detection": {
|
"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",
|
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
|
||||||
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
||||||
"signals": [], "type": "momentum", "size": 0.001,
|
"signals": [], "type": "momentum", "size": 0.001,
|
||||||
"description": "Detects whale accumulation (many small buys over time). Follows the smart money flow.",
|
"description": "Detects whale accumulation (many small buys over time). Follows the smart money flow.",
|
||||||
},
|
},
|
||||||
"Funding Rate Arb": {
|
"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",
|
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
|
||||||
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
||||||
"signals": [], "type": "carry", "size": 0.005,
|
"signals": [], "type": "carry", "size": 0.005,
|
||||||
"description": "Delta-neutral carry trade — shorts perp when funding rate is high, collects hourly payments.",
|
"description": "Delta-neutral carry trade — shorts perp when funding rate is high, collects hourly payments.",
|
||||||
},
|
},
|
||||||
"Pairs Trading": {
|
"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",
|
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
|
||||||
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
||||||
"signals": [], "type": "stat_arb", "size": 0.05,
|
"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.",
|
"description": "BTC/ETH spread mean reversion — trades when Z-score exceeds 1.5 sigma. Pairs converge back to equilibrium.",
|
||||||
},
|
},
|
||||||
"Avellaneda-Stoikov": {
|
"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",
|
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
|
||||||
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
||||||
"signals": [], "type": "market_making", "size": 0.001,
|
"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.",
|
"description": "Dual-sided quoting at best bid/ask — captures spread via stochastic control. Simulated fill when spread is crossed.",
|
||||||
},
|
},
|
||||||
"Momentum Breakout": {
|
"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",
|
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
|
||||||
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
||||||
"signals": [], "type": "momentum", "size": 0.002,
|
"signals": [], "type": "momentum", "size": 0.002,
|
||||||
"description": "Bollinger Band (2σ) breakout — enters when price breaks bands with volume confirmation.",
|
"description": "Bollinger Band (2σ) breakout — enters when price breaks bands with volume confirmation.",
|
||||||
},
|
},
|
||||||
"Mean Reversion": {
|
"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",
|
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
|
||||||
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
||||||
"signals": [], "type": "reversal", "size": 0.002,
|
"signals": [], "type": "reversal", "size": 0.002,
|
||||||
|
|||||||
Reference in New Issue
Block a user