← back to Bertha
chore(alshi-dash): update 1 file (.js) [+147]
a77b8b4a8d22e53c99e7005f406ece4183b5abc9 · 2026-02-25 01:03:59 +0000 · DW Commit Agent
Files touched
Diff
commit a77b8b4a8d22e53c99e7005f406ece4183b5abc9
Author: DW Commit Agent <commit-agent@dw-agents.com>
Date: Wed Feb 25 01:03:59 2026 +0000
chore(alshi-dash): update 1 file (.js) [+147]
---
kalshi-dash/server.js | 147 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 147 insertions(+)
diff --git a/kalshi-dash/server.js b/kalshi-dash/server.js
index 9646c9f..7e03364 100644
--- a/kalshi-dash/server.js
+++ b/kalshi-dash/server.js
@@ -4239,6 +4239,9 @@ const server = http.createServer(async (req, res) => {
'/api/auth/google',
'/api/auth/google-config',
'/api/health',
+ '/api/portfauxlio',
+ '/api/portfauxlio/charts',
+ '/api/portfauxlio/swot',
];
const isPublic = publicPaths.includes(urlPath);
@@ -7478,6 +7481,78 @@ const PORTFOLIO_STRATEGIES = {
/pope|vatican|catholic|referendum|independence|separatist|social movement|protest|migration|refugee/i.test(sig.reasoning + ' ' + sig.market_title),
etf_broad_market: (sig) => Math.abs(sig.edge) >= 0.08 && sig.confidence >= 0.50 && (sig.mc_consistent || sig.ai_enhanced),
+
+ // ═══ SECTOR-BASED PORTFOLIOS (IDs 51-100): Granular sub-sector filters ═══
+
+ // — Energy & Commodities (51-55) —
+ lng_exports: (sig) => /lng|liquefied natural gas|natural gas export|gas terminal|lng shipment|henry hub/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ oil_price_band: (sig) => /\boil\b|crude|brent|wti|petroleum|barrel|oil price|oil production/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ natgas_seasonal: (sig) => /natural gas|natgas|gas price|gas storage|heating season|gas futures/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ opec_decisions: (sig) => /opec|oil cartel|production cut|oil output|saudi.*oil|oil supply/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ power_grid: (sig) => /power grid|blackout|electricity|energy grid|brownout|utility|power outage|grid fail/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+
+ // — AI & Tech Stocks (56-60) —
+ semiconductor: (sig) => /semiconductor|chip|nvidia|tsmc|intel|amd|chip act|wafer|fab\b|gpu shortage/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ ai_regulation: (sig) => /ai regulation|ai safety|ai executive order|ai bill|regulate.*ai|ai governance|ai act/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ tech_earnings: (sig) => /tech.*earning|earning.*tech|apple.*revenue|google.*revenue|meta.*revenue|amazon.*revenue|magnificent seven|big tech.*report/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ autonomous_vehicles: (sig) => /autonomous|self.driving|robotaxi|waymo|cruise|lidar|adas|driverless/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ cloud_market: (sig) => /cloud computing|aws|azure|google cloud|cloud revenue|saas|cloud market|cloud spend/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+
+ // — Crypto & Digital (61-65) —
+ btc_price_bands: (sig) => /bitcoin|btc|bitcoin price|btc.*\$|bitcoin.*\$|bitcoin.*above|bitcoin.*below/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ eth_upgrades: (sig) => /ethereum|eth\b|eth.*upgrade|ethereum.*upgrade|ethereum.*merge|eth.*fork|ether.*price/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ crypto_regulation: (sig) => /crypto.*regulat|sec.*crypto|crypto.*ban|crypto.*bill|digital asset.*law|crypto.*legal|stablecoin.*act/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ stablecoin_policy: (sig) => /stablecoin|usdt|usdc|tether|circle|stablecoin.*regulat|stablecoin.*bill|cbdc/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ defi_events: (sig) => /defi|decentralized finance|dex|uniswap|aave|compound|liquidity pool|yield farm|tvl/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+
+ // — Macro Economics (66-70) —
+ cpi_monthly: (sig) => /\bcpi\b|consumer price|inflation.*rate|inflation.*report|core inflation|price index/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ nfp_monthly: (sig) => /nonfarm|non.farm|payroll|jobs report|jobs.*added|employment.*report|unemployment.*rate|jobless.*claim/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ housing_data: (sig) => /housing|home.*sale|home.*price|mortgage|existing home|housing start|case.shiller|real estate.*data/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ gdp_quarterly: (sig) => /\bgdp\b|gross domestic|economic growth|gdp.*quarter|gdp.*annual|recession.*gdp/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ yield_spread: (sig) => /yield curve|yield spread|inverted yield|2.year.*10.year|treasury spread|curve inversion/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+
+ // — Finance & Markets (71-75) —
+ sp500_levels: (sig) => /s&p|s&p 500|sp500|spx|s&p.*above|s&p.*below|stock market.*level/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ fed_rate_path: (sig) => /fed.*rate|interest rate|fomc|rate cut|rate hike|federal funds|fed.*meeting|monetary policy|powell.*rate/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ bank_stress: (sig) => /bank.*stress|bank.*fail|banking crisis|bank run|fdic|bank.*collapse|regional bank|svb|silicon valley bank/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ bond_yields: (sig) => /bond.*yield|treasury.*yield|10.year.*yield|bond.*market|treasury.*rate|bond.*price/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ volatility_index: (sig) => /\bvix\b|volatility index|volatility.*spike|cboe|fear.*index|market.*volatility/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+
+ // — Politics & Policy (76-80) —
+ state_elections: (sig) => /KXSEN|KXGOV|state election|governor.*race|senate.*race|state house|state legislature|primary.*election/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ congress_votes: (sig) => /KXCONG|KXHOUSE|congress.*vote|house.*vote|senate.*vote|bill.*pass|legislation.*vote|floor vote/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ tariff_policy: (sig) => /tariff|trade war|import duty|trade deficit|trade policy|customs duty|trade agreement|wto/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ immigration_policy: (sig) => /immigration|border|migrant|asylum|deportation|visa|daca|immigration.*reform|border.*wall/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ tax_legislation: (sig) => /tax.*bill|tax.*reform|tax.*cut|tax.*hike|tax.*code|irs|estate tax|capital gains.*tax|corporate tax/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+
+ // — Sports (81-85) —
+ nba_outcomes: (sig) => /KXNBA|\bnba\b|basketball|nba.*final|nba.*champion|nba.*mvp|nba.*draft/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ nfl_outcomes: (sig) => /KXNFL|\bnfl\b|football|super bowl|nfl.*draft|nfl.*champion|quarterback|touchdown/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ soccer_global: (sig) => /soccer|football.*world|world cup|premier league|champions league|mls|fifa|la liga|bundesliga/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ mlb_outcomes: (sig) => /KXMLB|\bmlb\b|baseball|world series|mlb.*draft|home run|batting|pitcher/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ combat_sports: (sig) => /\bufc\b|\bmma\b|boxing|fight.*night|ufc.*champion|knockout|title fight|heavyweight/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+
+ // — Health & Science (86-90) —
+ fda_approvals: (sig) => /fda.*approv|fda.*reject|drug.*approv|new drug|biologic.*approv|fda.*review|pdufa/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ disease_tracking: (sig) => /outbreak|pandemic|epidemic|covid|h5n1|bird flu|mpox|disease.*spread|cdc.*alert|who.*emergency/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ biotech_catalysts: (sig) => /biotech|clinical trial|phase 3|gene therapy|mrna|crispr|drug.*trial|biotech.*stock/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ health_metrics: (sig) => /life expectancy|obesity|opioid|drug overdose|health.*metric|public health|mortality rate|vaccination rate/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ space_milestones: (sig) => /spacex|nasa|rocket.*launch|mars|moon.*landing|starship|artemis|blue origin|orbit|satellite.*launch/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+
+ // — Media & Culture (91-95) —
+ box_office: (sig) => /box office|movie.*gross|film.*revenue|opening weekend|blockbuster|cinema.*sales/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ awards_shows: (sig) => /oscar|grammy|emmy|golden globe|academy award|best picture|best actor|awards.*ceremony/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ streaming_subs: (sig) => /netflix.*subscriber|disney.*subscriber|streaming.*war|subscriber.*count|streaming.*growth|hulu|paramount/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ social_trends: (sig) => /viral|tiktok|social media.*trend|influencer|twitter.*trend|internet.*culture|meme/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ reality_outcomes: (sig) => /reality tv|bachelor|survivor|big brother|reality.*show|dancing.*stars|masked singer/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+
+ // — Global & Geopolitics (96-100) —
+ global_conflicts: (sig) => /war\b|invasion|ceasefire|military.*conflict|armed conflict|escalation|airstrike|troops.*deploy/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ sanctions_policy: (sig) => /sanction|embargo|trade restriction|asset freeze|sanctions.*russia|sanctions.*china|sanctions.*iran/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ climate_extremes: (sig) => /climate.*extreme|extreme weather|heat.*record|cold.*record|flood|wildfire|hurricane.*category|tornado|drought/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ forex_events: (sig) => /forex|currency.*crisis|dollar.*index|yen|euro.*dollar|fx.*rate|currency.*devaluation|exchange rate/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
+ geopolitical_shock: (sig) => /black swan|geopolitical.*shock|coup|assassination|regime.*change|emergency.*declaration|martial law|unexpected.*event/i.test((sig.market_id || '') + ' ' + (sig.market_title || '') + ' ' + (sig.reasoning || '')),
};
// Position sizing per strategy — differentiated risk profiles
@@ -7538,6 +7613,78 @@ const PORTFOLIO_SIZING = {
etf_govreform: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 3))),
etf_global_social: (edge, conf) => Math.max(1, Math.min(2, Math.round(conf * 2))),
etf_broad_market: (edge, conf) => Math.max(2, Math.min(6, Math.round(edge * 15 + conf * 3))),
+
+ // ═══ SECTOR-BASED SIZING (IDs 51-100): Conservative niche bets ═══
+
+ // — Energy & Commodities (51-55) — Moderate sizing, energy can be volatile
+ lng_exports: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 4))),
+ oil_price_band: (edge, conf) => Math.max(1, Math.min(4, Math.round(edge * 15))),
+ natgas_seasonal: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 3))),
+ opec_decisions: (edge, conf) => Math.max(1, Math.min(3, Math.round(edge * 12))),
+ power_grid: (edge, conf) => Math.max(1, Math.min(2, Math.round(conf * 3))),
+
+ // — AI & Tech Stocks (56-60) — Slightly larger, higher conviction sector
+ semiconductor: (edge, conf) => Math.max(1, Math.min(4, Math.round(conf * 5))),
+ ai_regulation: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 4))),
+ tech_earnings: (edge, conf) => Math.max(2, Math.min(5, Math.round(edge * 18))),
+ autonomous_vehicles: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 3))),
+ cloud_market: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 4))),
+
+ // — Crypto & Digital (61-65) — Volatile, keep positions smaller
+ btc_price_bands: (edge, conf) => Math.max(1, Math.min(4, Math.round(edge * 16))),
+ eth_upgrades: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 3))),
+ crypto_regulation: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 4))),
+ stablecoin_policy: (edge, conf) => Math.max(1, Math.min(2, Math.round(conf * 3))),
+ defi_events: (edge, conf) => Math.max(1, Math.min(2, Math.round(edge * 10))),
+
+ // — Macro Economics (66-70) — Data-driven, moderate confidence sizing
+ cpi_monthly: (edge, conf) => Math.max(1, Math.min(4, Math.round(conf * 5))),
+ nfp_monthly: (edge, conf) => Math.max(1, Math.min(4, Math.round(conf * 5))),
+ housing_data: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 4))),
+ gdp_quarterly: (edge, conf) => Math.max(1, Math.min(4, Math.round(edge * 15))),
+ yield_spread: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 4))),
+
+ // — Finance & Markets (71-75) — Established signals, moderate-to-large
+ sp500_levels: (edge, conf) => Math.max(2, Math.min(5, Math.round(edge * 20))),
+ fed_rate_path: (edge, conf) => Math.max(2, Math.min(5, Math.round(conf * 6))),
+ bank_stress: (edge, conf) => Math.max(1, Math.min(3, Math.round(edge * 12))),
+ bond_yields: (edge, conf) => Math.max(1, Math.min(4, Math.round(conf * 5))),
+ volatility_index: (edge, conf) => Math.max(1, Math.min(4, Math.round(edge * 18))),
+
+ // — Politics & Policy (76-80) — Binary outcomes, confidence-weighted
+ state_elections: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 4))),
+ congress_votes: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 4))),
+ tariff_policy: (edge, conf) => Math.max(1, Math.min(3, Math.round(edge * 12))),
+ immigration_policy: (edge, conf) => Math.max(1, Math.min(2, Math.round(conf * 3))),
+ tax_legislation: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 3))),
+
+ // — Sports (81-85) — Event-driven, fixed small sizing
+ nba_outcomes: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 4))),
+ nfl_outcomes: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 4))),
+ soccer_global: (edge, conf) => Math.max(1, Math.min(2, Math.round(conf * 3))),
+ mlb_outcomes: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 3))),
+ combat_sports: (edge, conf) => Math.max(1, Math.min(2, Math.round(conf * 3))),
+
+ // — Health & Science (86-90) — High-impact but rare, small positions
+ fda_approvals: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 4))),
+ disease_tracking: (edge, conf) => Math.max(1, Math.min(3, Math.round(edge * 12))),
+ biotech_catalysts: (edge, conf) => Math.max(1, Math.min(3, Math.round(edge * 10))),
+ health_metrics: (edge, conf) => Math.max(1, Math.min(2, Math.round(conf * 2))),
+ space_milestones: (edge, conf) => Math.max(1, Math.min(2, Math.round(conf * 3))),
+
+ // — Media & Culture (91-95) — Fun bets, keep small
+ box_office: (edge, conf) => Math.max(1, Math.min(2, Math.round(conf * 3))),
+ awards_shows: (edge, conf) => Math.max(1, Math.min(2, Math.round(conf * 3))),
+ streaming_subs: (edge, conf) => Math.max(1, Math.min(2, Math.round(conf * 2))),
+ social_trends: (edge, conf) => Math.max(1, Math.min(2, Math.round(edge * 8))),
+ reality_outcomes: (edge, conf) => Math.max(1, Math.min(2, Math.round(conf * 2))),
+
+ // — Global & Geopolitics (96-100) — High uncertainty, conservative
+ global_conflicts: (edge, conf) => Math.max(1, Math.min(3, Math.round(edge * 12))),
+ sanctions_policy: (edge, conf) => Math.max(1, Math.min(2, Math.round(conf * 3))),
+ climate_extremes: (edge, conf) => Math.max(1, Math.min(3, Math.round(edge * 10))),
+ forex_events: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 4))),
+ geopolitical_shock: (edge, conf) => Math.max(1, Math.min(2, Math.round(edge * 8))),
};
let tradeCounter = 0; // For wildcard portfolio
← abc207c chore(alshi-dash): update 1 file (.js) [+46]
·
back to Bertha
·
chore(kalshi-dash): update 1 file (.js) [+22] a460d1b →