mirror of
https://github.com/theodore-song/polymarket-analyst.git
synced 2026-07-29 08:57:44 +00:00
Limit agent analysis to top 500 active markets
This commit is contained in:
+17
-16
@@ -340,7 +340,7 @@ footer{margin-top:34px;padding-top:22px;border-top:1px solid var(--border);color
|
||||
<nav class="topnav">
|
||||
<div class="brand">
|
||||
<div class="logo">🏆</div>
|
||||
<div><div class="brand-name">Polymarket Arena</div><div class="brand-sub">10 agents · strategies, copycats & whales</div><div class="build-badge">Top 5,000 analysis · v18</div></div>
|
||||
<div><div class="brand-name">Polymarket Arena</div><div class="brand-sub">10 agents · strategies, copycats & whales</div><div class="build-badge">Top 500 active · v19</div></div>
|
||||
</div>
|
||||
<div class="tabs" id="tabs">
|
||||
<button class="tab" data-tab="overview">Overview</button>
|
||||
@@ -362,7 +362,7 @@ footer{margin-top:34px;padding-top:22px;border-top:1px solid var(--border);color
|
||||
<div class="personal-banner" id="personalBanner">
|
||||
<b>Personal research mode.</b> This copy is for your own analysis, paper tracking, and manual trade research only. It does not pool money, onboard investors, custody funds, bypass eligibility rules, or place orders without your manual approval.
|
||||
</div>
|
||||
<div class="live-build-banner"><b>Build v18 active:</b> agents rank the live Polymarket universe, analyze the top 5,000 by activity/liquidity/gap, and use a selective BUY fallback so core agents do not sit entirely in cash.</div>
|
||||
<div class="live-build-banner"><b>Build v19 active:</b> agents load the 500 most active Polymarket markets, rank them by activity/liquidity/gap, and use a selective BUY fallback so core agents do not sit entirely in cash.</div>
|
||||
|
||||
<!-- ============ OVERVIEW ============ -->
|
||||
<section class="tabpanel" data-tab="overview">
|
||||
@@ -377,10 +377,10 @@ footer{margin-top:34px;padding-top:22px;border-top:1px solid var(--border);color
|
||||
<g fill="#d9b4ff"><circle cx="380" cy="40" r="6"/></g>
|
||||
</svg>
|
||||
<h1>Ten AI agents race to <span class="grad">beat the market</span></h1>
|
||||
<p>Each cycle ranks the active Polymarket universe, then deeply analyzes only the top 5,000 markets by activity, liquidity, timing, and estimated price gap before agents trade.</p>
|
||||
<p>Each cycle loads the 500 most active Polymarket markets, ranks them by activity, liquidity, timing, and estimated price gap, then lets agents trade from that tighter pool.</p>
|
||||
<div class="badges">
|
||||
<span class="hbadge">🏆 10 competing agents</span>
|
||||
<span class="hbadge">Top 5,000 market analysis</span>
|
||||
<span class="hbadge">Top 500 active markets</span>
|
||||
<span class="hbadge">Ranked by activity + gap</span>
|
||||
<span class="hbadge">Live Polymarket data</span>
|
||||
</div>
|
||||
@@ -717,8 +717,8 @@ footer{margin-top:34px;padding-top:22px;border-top:1px solid var(--border);color
|
||||
<div class="card" style="margin-top:16px">
|
||||
<div class="card-h"><h3>The live cycle</h3></div>
|
||||
<ol class="steps">
|
||||
<li><b>Fetch</b> — page through every active Polymarket market and tag each by category.</li>
|
||||
<li><b>Score</b> — rank every market 0–100 by conviction and estimate its edge vs. a fair-value model.</li>
|
||||
<li><b>Fetch</b> — load the 500 most active Polymarket markets and tag each by category.</li>
|
||||
<li><b>Score</b> — rank those active markets 0–100 by conviction and estimate edge vs. a fair-value model.</li>
|
||||
<li><b>Suggest</b> — surface the strongest picks per category with a plain-English rationale.</li>
|
||||
<li><b>Compete</b> — the strategy agents trade the same suggestions their own way, stop-loss weak positions, scale out through gain-stop tiers, exit stale or fading trades, then snapshot equity.</li>
|
||||
</ol>
|
||||
@@ -743,7 +743,7 @@ footer{margin-top:34px;padding-top:22px;border-top:1px solid var(--border);color
|
||||
</section>
|
||||
|
||||
<footer>
|
||||
Build top-5000-analysis-v18 · Paper trading only · Live prices from Polymarket's public Gamma API · Not financial advice ·
|
||||
Build top-500-active-v19 · Paper trading only · Live prices from Polymarket's public Gamma API · Not financial advice ·
|
||||
<a class="market-link" href="https://github.com/theodore-song/polymarket-analyst" target="_blank" rel="noopener">Source on GitHub</a>
|
||||
</footer>
|
||||
</div>
|
||||
@@ -770,7 +770,7 @@ const EXIT_STALE_DAYS = 10;
|
||||
const EXIT_RESOLUTION_DAYS = 2;
|
||||
const AGENTS_KEY = "pma_agents_v2";
|
||||
const SUG_KEY = "pma_suggestions_v5";
|
||||
const SUGGESTION_ENGINE_VERSION = 18;
|
||||
const SUGGESTION_ENGINE_VERSION = 19;
|
||||
const FOCUS_KEY = "pma_focus_v1";
|
||||
const VIEW_KEY = "pma_view_v1";
|
||||
const PF_SORT_KEY = "pma_portfolio_sort_v1";
|
||||
@@ -1000,7 +1000,8 @@ const MIN_ENTRY_DAYS=3.0;
|
||||
const EDGE_SCALE=0.13;
|
||||
const MAX_STRATEGY_POSITIONS=16;
|
||||
const MAX_ACTIVE_MARKET_PAGES=1000;
|
||||
const MARKET_ANALYSIS_LIMIT=5000;
|
||||
const MARKET_ANALYSIS_LIMIT=500;
|
||||
const ACTIVE_MARKET_FETCH_LIMIT=500;
|
||||
const SUGGESTION_TOTAL=900;
|
||||
const SUGGESTION_PER_CATEGORY=180;
|
||||
const VISIBLE_SUGGESTIONS=900;
|
||||
@@ -1101,7 +1102,7 @@ function analyzeMarket(m,realWorldSignals={}){
|
||||
const selectiveTradeReady=edge>=MIN_SELECTIVE_ENTRY_EDGE&&conviction>=58&&m.volume>=MIN_VOLUME&&m.liquidity>=MIN_LIQUIDITY&&evidence.score>=0.42&&m.yes_price>=0.08&&m.yes_price<=0.92;
|
||||
const tradeReady=strictTradeReady||selectiveTradeReady;
|
||||
let side=edgeYes>=0?"YES":"NO",entry=side==="YES"?p:m.no_price,rationale;
|
||||
if(selectiveTradeReady&&!strictTradeReady){rationale=`Selective BUY from top-5,000 scan: raw gap ${(edge*100).toFixed(1)}c, conviction ${Math.round(conviction)}, high activity/liquidity, and evidence ${Math.round(evidence.score*100)}. Net edge is conservative, so sizing stays disciplined.`;}
|
||||
if(selectiveTradeReady&&!strictTradeReady){rationale=`Selective BUY from top-500 active scan: raw gap ${(edge*100).toFixed(1)}c, conviction ${Math.round(conviction)}, high activity/liquidity, and evidence ${Math.round(evidence.score*100)}. Net edge is conservative, so sizing stays disciplined.`;}
|
||||
else if(tradeReady&&edgeYes>0){rationale=`Trade-ready after costs: fair value ${pct(fair)} vs market ${pct(p)} leaves ${(absNet*100).toFixed(1)}c net edge for YES after liquidity, chase, and ${m.category} evidence checks.`;}
|
||||
else if(tradeReady&&edgeYes<0){rationale=`Trade-ready after costs: fair value ${pct(fair)} vs market ${pct(p)} makes YES look overpriced; NO has ${(absNet*100).toFixed(1)}c net edge after penalties.`;}
|
||||
else{rationale=`Watch only: raw gap ${(edge*100).toFixed(1)}c becomes ${(absNet*100).toFixed(1)}c after friction/chase/category penalties, so agents need stronger evidence before buying.`;}
|
||||
@@ -1990,7 +1991,7 @@ async function backtestWhales(st,dates){
|
||||
}
|
||||
SIM_DAY=null;
|
||||
}
|
||||
/* Full day-by-day backtest: for each of the past 7 days, rebuild every market's
|
||||
/* Full day-by-day backtest: for each of the past 7 days, rebuild each sampled market's
|
||||
state from that day's real price (+ correct time-to-resolution), re-run the
|
||||
scoring engine, and step every strategy agent through a day of trading.
|
||||
NOTE: volume/liquidity signals use current values as a proxy — Polymarket
|
||||
@@ -2061,10 +2062,10 @@ async function runDailyCycle(){
|
||||
return {suggestions:(loadSuggestions().suggestions||[]).length,skipped:true,hour};
|
||||
}
|
||||
SNAP_TS=nowIso();
|
||||
setStatus("loading market universe for top-5,000 ranking…",true);
|
||||
const markets=await fetchMarkets(Infinity,100,count=>setStatus(`ranking active markets (${count}) before top-5,000 analysis…`,true));
|
||||
setStatus("loading the 500 most active markets…",true);
|
||||
const markets=await fetchMarkets(Math.ceil(ACTIVE_MARKET_FETCH_LIMIT/100),100,count=>setStatus(`loaded ${Math.min(count,ACTIVE_MARKET_FETCH_LIMIT).toLocaleString()} of 500 active markets…`,true));
|
||||
const analysisMarkets=selectMarketsForAnalysis(markets);
|
||||
setStatus(`selected top ${analysisMarkets.length.toLocaleString()} markets for analysis…`,true);
|
||||
setStatus(`analyzing ${analysisMarkets.length.toLocaleString()} most-active markets…`,true);
|
||||
setStatus("checking real-world context…",true);
|
||||
const realWorldSignals=await fetchRealWorldSignals(analysisMarkets);
|
||||
setStatus("analyzing expected value…",true);
|
||||
@@ -2465,8 +2466,8 @@ function renderSuggestions(){
|
||||
const scanned=Number(data.market_count||0).toLocaleString();
|
||||
const analyzed=Number(data.analyzed_count||data.market_count||0).toLocaleString();
|
||||
$("focusNote").textContent=focus==="All"
|
||||
? `Scanned ${scanned} active markets, analyzed the top ${analyzed} by activity/liquidity/gap, and kept ${all.length} ideas (${buyCount} BUY, ${watchCount} WATCH). Showing ${filtered.length}; agents trade only EV+ ideas after liquidity, chase, and real-world evidence checks. Avg evidence ${evAvg}.`
|
||||
: `Scanned ${scanned} active markets and analyzed the top ${analyzed}. Showing ${filtered.length} of ${pool.length} ${focus} ideas; agents only open EV+ BUY ${focus} positions while this is selected.`;
|
||||
? `Loaded the ${scanned} most active markets, analyzed ${analyzed} by activity/liquidity/gap, and kept ${all.length} ideas (${buyCount} BUY, ${watchCount} WATCH). Showing ${filtered.length}; agents trade only EV+ ideas after liquidity, chase, and real-world evidence checks. Avg evidence ${evAvg}.`
|
||||
: `Loaded the ${scanned} most active markets and analyzed ${analyzed}. Showing ${filtered.length} of ${pool.length} ${focus} ideas; agents only open EV+ BUY ${focus} positions while this is selected.`;
|
||||
if(!filtered.length){root.innerHTML=`<div class="empty" style="grid-column:1/-1">No ${esc(focus)} suggestions in this live batch.</div>`;return;}
|
||||
root.innerHTML=filtered.map(s=>{
|
||||
const col=catColor(s.category);
|
||||
|
||||
Reference in New Issue
Block a user