From 974a957f588be3a56cf1099455367eef3bbd24d1 Mon Sep 17 00:00:00 2001 From: Theodore Song Date: Sat, 22 Aug 2026 21:42:47 -0400 Subject: [PATCH] Adapt protected returns to capital lock duration --- .github/workflows/autonomous-cycle.yml | 2 +- .../workflows/release-protected-routing.yml | 16 +-- README.md | 24 ++-- api/state.js | 4 +- index.html | 123 +++++++++++++----- scripts/evaluate-neg-risk.mjs | 2 +- scripts/test-autonomous-runtime.mjs | 28 +++- scripts/test-server-state.mjs | 8 +- sw.js | 2 +- 9 files changed, 148 insertions(+), 61 deletions(-) diff --git a/.github/workflows/autonomous-cycle.yml b/.github/workflows/autonomous-cycle.yml index c1b63f3..7b3ac36 100644 --- a/.github/workflows/autonomous-cycle.yml +++ b/.github/workflows/autonomous-cycle.yml @@ -35,7 +35,7 @@ jobs: - run: node scripts/run-autonomous-cycle.mjs env: ARENA_URL: https://polymarket-site-eta.vercel.app - EXPECTED_BUILD: "125" + EXPECTED_BUILD: "126" RUNTIME_BRANCH: runtime-state RUNTIME_STATE_PATH: runtime/state.json GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-protected-routing.yml b/.github/workflows/release-protected-routing.yml index f6b4473..d5bf75d 100644 --- a/.github/workflows/release-protected-routing.yml +++ b/.github/workflows/release-protected-routing.yml @@ -1,4 +1,4 @@ -name: Release capital-efficient protected sizing after Vercel quota reset +name: Release duration-aware protected returns after Vercel quota reset on: schedule: @@ -26,23 +26,23 @@ jobs: env: ARENA_URL: https://polymarket-site-eta.vercel.app run: | - if curl --fail --silent --show-error "${ARENA_URL}/?sizing_preflight=${GITHUB_RUN_ID}" | grep -q 'bundlePositionCapPct'; then - echo "Capital-efficient protected sizing is already live." + if curl --fail --silent --show-error "${ARENA_URL}/?duration_preflight=${GITHUB_RUN_ID}" | grep -q 'bundleMinimumDailyReturn'; then + echo "Duration-aware protected returns are already live." exit 0 fi - printf 'Protected sizing deployment retry from run %s at %s\n' "$GITHUB_RUN_ID" "$(date -u +%FT%TZ)" > .capital-efficient-release-trigger + printf 'Duration-aware protected return deployment retry from run %s at %s\n' "$GITHUB_RUN_ID" "$(date -u +%FT%TZ)" > .duration-aware-release-trigger git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add .capital-efficient-release-trigger - git commit -m "Retry capital-efficient protected sizing deployment" + git add .duration-aware-release-trigger + git commit -m "Retry duration-aware protected returns deployment" git push origin HEAD:main - name: Verify the exact sizing revision in production env: ARENA_URL: https://polymarket-site-eta.vercel.app run: | for attempt in $(seq 1 40); do - if curl --fail --silent --show-error "${ARENA_URL}/?sizing_wait=${GITHUB_RUN_ID}-${attempt}" | grep -q 'bundlePositionCapPct'; then - echo "Capital-efficient protected sizing is live." + if curl --fail --silent --show-error "${ARENA_URL}/?duration_wait=${GITHUB_RUN_ID}-${attempt}" | grep -q 'bundleMinimumDailyReturn'; then + echo "Duration-aware protected returns are live." exit 0 fi sleep 30 diff --git a/README.md b/README.md index bc4aeed..de98483 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Offline cycles can apply calibration already earned from live observations, but the evidence ledger is read-only: cached prices cannot grade pending signals, expire horizons, or create new observations. -Build 125 targets five-minute slots with a serialized, self-chained GitHub Actions runtime. +Build 126 targets five-minute slots with a serialized, self-chained GitHub Actions runtime. The mutable snapshot stays on the dedicated `runtime-state` branch, which is explicitly excluded from Vercel Git deployments through `git.deploymentEnabled`. This prevents high-frequency state commits from @@ -70,7 +70,7 @@ Polymarket event key. Related Ethereum or Bitcoin contracts cannot create several simultaneous copies of one move, and outcomes from the same underlying three-hour shock window count as one learner event. -Each Build 125 cycle also scans the 1,000 most-active Polymarket events for +Each Build 126 cycle also scans the 1,000 most-active Polymarket events for complete negative-risk bundles and logically nested threshold or deadline pairs, plus same-market YES/NO complements whose equal shares have a fixed $1 redemption value. Polymarket's documented complete-set merge converts equal @@ -111,23 +111,27 @@ and immediate merge or conversion paths use at most 10%. Strategy 65 ranks verif structures by net return per expected locked day before raw edge, and caps active cost from one underlying event at 12% of the owning portfolio's equity. This prevents several related threshold pairs from monopolizing the non-directional book. New bundles must -also clear a 0.05% daily locked-capital return floor, approximately 18.25% simple or 20% compounded annualized, -so a tiny spread cannot immobilize capital for months. Existing paper bundles are +clear a duration-aware daily hurdle: 0.03% through 7 days, 0.04% through 30 days, +0.05% through 90 days, and 0.075% beyond 90 days. Immediate merge and conversion +paths use a 0.01% hurdle. Exact executable sizing must also preserve at least a +0.10-cent per-unit safety margin and $0.50 of total locked profit. This admits a +small margin only when verified depth can scale it into meaningful profit, while +demanding substantially more from positions that immobilize capital for months. Existing paper bundles are never retroactively enlarged against depth their original simulated fill would already have consumed. Each live cycle also prices an atomic exit across every bid level needed to sell every leg of each intact bundle. It verifies every condition's exact fee schedule again and exits only when net proceeds realize at least 85% of the remaining guaranteed settlement profit. Missing depth, mismatched fees, or a smaller profit capture leave the guarantee intact; cached offline cycles cannot -execute this recycling path. A bundle can enter Value Discipline only when that fee check -passes and the resulting worst-case payout clears both the three-tenths-cent -profit floor and the 0.15% return floor. Top-of-book gaps, missing books, +execute this recycling path. A bundle can enter its designated protected owner only when that fee check +passes and the resulting worst-case payout clears the 0.10-cent per-unit buffer, +$0.50 total executable-profit floor, and 0.15% return floor. Top-of-book gaps, missing books, incomplete fee schedules, and unavailable fee verification remain audit-only. The Suggestions view stores scan, depth, fee, actionable, and closest executable-margin counts so an empty lane is evidence rather than an ambiguous failure. -Build 125 retains the directional learner's exact-fee policy, which replaced the blanket half-cent cost with +Build 126 retains the directional learner's exact-fee policy, which replaced the blanket half-cent cost with the market's Gamma fee schedule at both the entry and future checkpoint, plus a separate half-cent round-trip slippage allowance. Fee-free markets pay only the slippage allowance; an unavailable fee schedule gets a conservative four-cent @@ -160,7 +164,7 @@ target fell to -44.14% in validation and remained negative in holdout, so it cannot authorize capital. The reproducible result is stored in `research/settlement-calibration-exact-fee-5000-audit.json`. -Build 125 retains Build 100's retirement of the old 3-6 day resolution-window +Build 126 retains Build 100's retirement of the old 3-6 day resolution-window capital permission. That audit clustered confidence by event but still averaged several correlated contracts inside each event, while production could choose only one. The corrected replay chooses the highest-volume eligible contract per event and @@ -280,7 +284,7 @@ evidence proves an edge. Run `npm run evaluate:sports-favorites` for the retired pregame favorite audit. Its 12-hour, 60%-75% cohort had positive point estimates but did not establish a -reliable confidence bound, so Build 125 no longer allocates capital to that rule. +reliable confidence bound, so Build 126 no longer allocates capital to that rule. Strategy 65 also tracks the exact-fee settlement calibration's three-day Sports NO cohort as a zero-capital forward lane. The corrected 5,000-market run diff --git a/api/state.js b/api/state.js index d1edc95..435fbae 100644 --- a/api/state.js +++ b/api/state.js @@ -297,10 +297,10 @@ export function compactSuggestion(s) { bundle_cost_per_unit: s.bundle_cost_per_unit, bundle_payout_per_unit: s.bundle_payout_per_unit, bundle_settlement_payout_per_unit: s.bundle_settlement_payout_per_unit, bundle_net_profit_per_unit: s.bundle_net_profit_per_unit, - bundle_capital_efficiency: s.bundle_capital_efficiency, + bundle_capital_efficiency: s.bundle_capital_efficiency, bundle_min_daily_return: s.bundle_min_daily_return, bundle_legs: s.bundle_legs, depth_verified: s.depth_verified, fees_verified: s.fees_verified, fee_model: s.fee_model, execution_model: s.execution_model, execution_units: s.execution_units, - execution_notional: s.execution_notional, verification_status: s.verification_status, + execution_notional: s.execution_notional, execution_total_profit: s.execution_total_profit, verification_status: s.verification_status, days_to_resolution: s.days_to_resolution, end_date: s.end_date, game_start: s.game_start, hours_to_start: s.hours_to_start, target_horizon_days: s.target_horizon_days, resolution_week_strategy_version: s.resolution_week_strategy_version, diff --git a/index.html b/index.html index 8c2f400..f92b38d 100644 --- a/index.html +++ b/index.html @@ -341,7 +341,7 @@ footer{margin-top:34px;padding-top:22px;border-top:1px solid var(--border);color