Adapt protected returns to capital lock duration

This commit is contained in:
Theodore Song
2026-08-22 21:42:47 -04:00
parent 2de28533d8
commit 974a957f58
9 changed files with 148 additions and 61 deletions
+22 -6
View File
@@ -16,13 +16,13 @@ const settlementCalibrationAudit = JSON.parse(fs.readFileSync(new URL("../resear
const sportsEvaluator = fs.readFileSync(new URL("./evaluate-sports-favorites.mjs", import.meta.url), "utf8");
const build = Number(index.match(/const BUILD_VERSION = (\d+);/)?.[1]);
assert.equal(build, 125);
assert.equal(build, 126);
assert.equal(vercelConfig.git?.deploymentEnabled?.["runtime-state"], false);
assert.equal(settlementCalibrationAudit.requested_markets, 5000);
assert.equal(settlementCalibrationAudit.train_passed, 0);
assert.equal(settlementCalibrationAudit.validation_selected, 0);
assert.equal(settlementCalibrationAudit.holdout_passed, 0);
assert.match(index, /Adaptive strategy 65 · capital-efficient protected sizing · build 125/);
assert.match(index, /Adaptive strategy 65 · duration-aware protected returns · build 126/);
assert.deepEqual([...ALLOWED_RUNTIME_KEYS].sort(), ["pma_agents_v2", "pma_suggestions_v5"]);
assert.match(index, /function collectPublicRuntimeItems\(\)/);
assert.match(index, /const PUBLIC_RUNTIME_KEYS=Object\.freeze\(\[AGENTS_KEY,SUG_KEY\]\)/);
@@ -72,10 +72,10 @@ assert.match(api, /Buffer\.from\(file\.content/);
assert.match(api, /searchParams\.set\("runtime", `\$\{Date\.now\(\)\}/);
assert.match(workflow, /cron: "2,7,12,17,22,27,32,37,42,47,52,57 \* \* \* \*"/);
assert.match(workflow, /contents: write/);
assert.match(workflow, /EXPECTED_BUILD: "125"/);
assert.match(workflow, /EXPECTED_BUILD: "126"/);
assert.equal((workflow.match(/if: always\(\)/g) || []).length, 2);
assert.match(routingReleaseWorkflow, /name: Release capital-efficient protected sizing after Vercel quota reset/);
assert.match(routingReleaseWorkflow, /bundlePositionCapPct/);
assert.match(routingReleaseWorkflow, /name: Release duration-aware protected returns after Vercel quota reset/);
assert.match(routingReleaseWorkflow, /bundleMinimumDailyReturn/);
assert.match(routingReleaseWorkflow, /cron: "25 1-23\/2 23 8 \*"/);
assert.match(workflow, /actions: write/);
assert.match(workflow, /cancel-in-progress: false/);
@@ -110,7 +110,15 @@ assert.doesNotMatch(index, /\/fee-rate\?token_id=/);
assert.match(index, /function maximizeBundleExecution\(candidate,books,minimumUnits\)/);
assert.match(index, /const BUNDLE_MAX_VERIFIED_NOTIONAL=1000;/);
assert.match(index, /const BUNDLE_EVENT_CAP_PCT=0\.12;/);
assert.match(index, /const BUNDLE_MIN_DAILY_RETURN=0\.0005;/);
assert.match(index, /const NEG_RISK_MIN_NET_PROFIT=0\.001;/);
assert.match(index, /const BUNDLE_MIN_EXECUTION_PROFIT=0\.50;/);
assert.match(index, /const BUNDLE_IMMEDIATE_MIN_DAILY_RETURN=0\.0001;/);
assert.match(index, /const BUNDLE_MIN_DAILY_RETURN=0\.0003;/);
assert.match(index, /const BUNDLE_MEDIUM_MIN_DAILY_RETURN=0\.0004;/);
assert.match(index, /const BUNDLE_LONG_MIN_DAILY_RETURN=0\.0005;/);
assert.match(index, /const BUNDLE_EXTENDED_MIN_DAILY_RETURN=0\.00075;/);
assert.match(index, /function bundleMinimumDailyReturn\(item=\{\}\)/);
assert.match(index, /function bundleClearsExecutionProfit\(item=\{\}\)/);
assert.match(index, /const BUNDLE_BASE_POSITION_CAP_PCT=0\.06;/);
assert.match(index, /const BUNDLE_HIGH_EFFICIENCY_POSITION_CAP_PCT=0\.08;/);
assert.match(index, /const BUNDLE_IMMEDIATE_POSITION_CAP_PCT=0\.10;/);
@@ -118,6 +126,7 @@ assert.match(index, /const BUNDLE_HIGH_EFFICIENCY_DAILY_RETURN=0\.002;/);
assert.match(index, /function bundlePositionCapPct\(item=\{\}\)/);
assert.match(index, /fee_check_eligible_structures:executableAudit\.filter\(candidate=>candidate\.fee_check_attempted\)\.length/);
assert.match(index, /"profit-below-floor"/);
assert.match(index, /"total-profit-below-floor"/);
assert.match(index, /"return-below-floor"/);
assert.match(index, /function compareBundleOpportunities\(a,b\)/);
assert.match(index, /function binaryComplementBundleSuggestions\(event,\{includeUnprofitable=false\}=\{\}\)/);
@@ -150,6 +159,8 @@ assert.match(index, /conversion_candidates_scanned:audited\.filter\(candidate=>c
assert.match(index, /actionable_conversions:unique\.filter\(candidate=>candidate\.bundle_immediate_convert\)\.length/);
assert.match(index, /Exact complete-NO conversion:/);
assert.match(api, /bundle_immediate_convert: s\.bundle_immediate_convert/);
assert.match(api, /bundle_min_daily_return: s\.bundle_min_daily_return/);
assert.match(api, /execution_total_profit: s\.execution_total_profit/);
assert.match(api, /neg_risk_market_id: s\.neg_risk_market_id, neg_risk_fee_bips: s\.neg_risk_fee_bips/);
assert.match(index, /reservesBinaryComplementDepthChecks:/);
assert.match(index, /reservesExactConversionDepthChecks:/);
@@ -176,6 +187,11 @@ assert.match(index, /atomicallyRecyclesEightySixPercentProfit:/);
assert.match(index, /prioritizesReturnPerLockedDay:/);
assert.match(index, /capsUnderlyingEventExposure:/);
assert.match(index, /blocksLowReturnPerLockedDay:/);
assert.match(index, /shortLocksUseProductiveHurdle:/);
assert.match(index, /longLocksRequireMoreReturn:/);
assert.match(index, /scalesSlimMarginsToMeaningfulProfit:/);
assert.match(index, /rejectsDustProfitDespitePositiveUnitMargin:/);
assert.match(index, /actualOpenedSizeMustPreserveProfitFloor:/);
assert.match(index, /durationAwareSizingScalesProtectedCapital:/);
assert.match(index, /sameCycleEventBurstStaysWithinCap:/);
assert.match(index, /sizesToLargestVerifiedProfitableFill:/);