mirror of
https://github.com/theodore-song/polymarket-analyst.git
synced 2026-08-24 13:08:10 +00:00
Diversify verified bundle search by event
This commit is contained in:
@@ -103,7 +103,7 @@ function observations(market, points) {
|
||||
}
|
||||
if (!complete) continue;
|
||||
const future = {};
|
||||
for (const hours of [24, 72]) {
|
||||
for (const hours of [6, 24, 72]) {
|
||||
const next = atOrAfter(points, current.t + hours * HOUR);
|
||||
if (next && next.t - (current.t + hours * HOUR) <= 3 * HOUR) future[hours] = next.p;
|
||||
}
|
||||
@@ -203,11 +203,13 @@ function evaluateHorizon(horizon) {
|
||||
}
|
||||
|
||||
const compact = (stats) => Object.fromEntries(Object.entries(stats).map(([key, value]) => [key, Number.isFinite(value) ? +value.toFixed(5) : value]));
|
||||
const horizons = [24, 72].map(evaluateHorizon).map((result) => ({ ...result,
|
||||
const horizons = [6, 24, 72].map(evaluateHorizon).map((result) => ({ ...result,
|
||||
candidates: result.candidates.map((candidate) => ({ rule: candidate.rule, passesHoldout: candidate.passesHoldout,
|
||||
train: compact(candidate.train), validation: compact(candidate.validation), test: compact(candidate.test) })) }));
|
||||
const passedByHorizon = horizons.map((result) => new Set(result.candidates.filter((candidate) => candidate.passesHoldout).map((candidate) => candidate.rule.id)));
|
||||
const durableRuleIds = [...passedByHorizon[0]].filter((id) => passedByHorizon[1].has(id));
|
||||
const passedByHorizon = Object.fromEntries(horizons.map((result) => [result.horizon,
|
||||
new Set(result.candidates.filter((candidate) => candidate.passesHoldout).map((candidate) => candidate.rule.id))]));
|
||||
const probationRuleIds = [...passedByHorizon[6]];
|
||||
const durableRuleIds = [...passedByHorizon[24]].filter((id) => passedByHorizon[72].has(id));
|
||||
|
||||
console.log(JSON.stringify({ generatedAt: new Date().toISOString(), requestedMarkets: MARKET_LIMIT, fetchedMarkets: markets.length,
|
||||
historiesWithData: histories.filter((result) => result && !result.error && result.points).length,
|
||||
@@ -215,4 +217,4 @@ console.log(JSON.stringify({ generatedAt: new Date().toISOString(), requestedMar
|
||||
methodology: { costCents: COST * 100, observationSpacingHours: 12, split: "60% train / 20% validation / 20% untouched holdout",
|
||||
clusterUnit: "Polymarket event", candidateRules: rules.length,
|
||||
promotionGate: "positive event-clustered 90% lower bound with minimum support in train, validation, and holdout" },
|
||||
durableRuleIds, horizons }, null, 2));
|
||||
probationRuleIds, durableRuleIds, horizons }, null, 2));
|
||||
|
||||
@@ -8,6 +8,7 @@ const workflow = fs.readFileSync(new URL("../.github/workflows/autonomous-cycle.
|
||||
const runner = fs.readFileSync(new URL("./run-autonomous-cycle.mjs", import.meta.url), "utf8");
|
||||
const resolutionAudit = JSON.parse(fs.readFileSync(new URL("../research/resolution-week-no-audit.json", import.meta.url), "utf8"));
|
||||
const sportsContestAudit = JSON.parse(fs.readFileSync(new URL("../research/sports-contest-no-exploration-audit.json", import.meta.url), "utf8"));
|
||||
const adaptiveAudit = JSON.parse(fs.readFileSync(new URL("../research/adaptive-strategy-64-audit.json", import.meta.url), "utf8"));
|
||||
const build = Number(index.match(/const BUILD_VERSION = (\d+);/)?.[1]);
|
||||
|
||||
assert.equal(build, 121);
|
||||
@@ -79,6 +80,8 @@ assert.match(index, /const BUNDLE_MAX_VERIFIED_NOTIONAL=400;/);
|
||||
assert.match(index, /const BUNDLE_EVENT_CAP_PCT=0\.12;/);
|
||||
assert.match(index, /const BUNDLE_MIN_DAILY_RETURN=0\.0002;/);
|
||||
assert.match(index, /function compareBundleOpportunities\(a,b\)/);
|
||||
assert.match(index, /function prioritizeIndependentBundles\(candidates,limit=Infinity\)/);
|
||||
assert.match(index, /prioritizesIndependentEventsBeforeAlternates:/);
|
||||
assert.match(index, /function bundleEventExposure\(portfolio,eventKey\)/);
|
||||
assert.match(index, /prioritizesReturnPerLockedDay:/);
|
||||
assert.match(index, /capsUnderlyingEventExposure:/);
|
||||
@@ -108,6 +111,11 @@ assert.ok(sportsContestAudit.corrected_5000_market_result.validation.lower_95 <
|
||||
assert.equal(sportsContestAudit.production_constraints.initial_position_pct, 0.5);
|
||||
assert.equal(sportsContestAudit.production_constraints.total_lane_cap_pct, 3);
|
||||
assert.equal(sportsContestAudit.production_constraints.exact_entry_fee_required, true);
|
||||
assert.equal(adaptiveAudit.strategy, 64);
|
||||
assert.equal(adaptiveAudit.fetched_markets, 500);
|
||||
assert.deepEqual(adaptiveAudit.probation_rule_ids, []);
|
||||
assert.deepEqual(adaptiveAudit.durable_rule_ids, []);
|
||||
assert.ok(adaptiveAudit.horizons.every((row) => row.validation_selected === 0 && row.holdout_passed === 0));
|
||||
assert.match(index, /function sportsContestKey\(m\)/);
|
||||
assert.match(index, /function sportsContestNoSuggestions\(markets\)/);
|
||||
assert.match(index, /const SPORTS_FAVORITE_MAX_NEW_PER_CYCLE=1;/);
|
||||
|
||||
Reference in New Issue
Block a user