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
+1 -1
View File
@@ -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 }}
@@ -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
+14 -10
View File
@@ -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
+2 -2
View File
@@ -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,
+93 -30
View File
@@ -341,7 +341,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 · 5 core + 5 aggressive</div><div class="build-badge">Adaptive strategy 65 · capital-efficient protected sizing · build 125</div></div>
<div><div class="brand-name">Polymarket Arena</div><div class="brand-sub">10 agents · 5 core + 5 aggressive</div><div class="build-badge">Adaptive strategy 65 · duration-aware protected returns · build 126</div></div>
</div>
<div class="tabs" id="tabs">
<button class="tab" data-tab="overview">Overview</button>
@@ -363,7 +363,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 125 active:</b> Strategy 65 keeps directional capital locked because its forward evidence remains negative after exact costs. Protected entries now require at least 0.05% modeled return per locked day, while short-duration and immediate conversion or merge opportunities can use 6-10% verified sizing inside the unchanged 12% event cap. Complete negative-risk conversions and binary merges realize atomically; settlement bundles remain intact unless verified live bids realize at least 85% of their guaranteed profit. Phones and computers display the same read-only autonomous state. Profits are not guaranteed.</div>
<div class="live-build-banner"><b>Build 126 active:</b> Strategy 65 keeps directional capital locked because its forward evidence remains negative after exact costs. Protected entries now adapt their hurdle to expected lock time: 0.03% per day through 7 days, 0.04% through 30, 0.05% through 90, and 0.075% beyond 90 days. Every entry also needs at least $0.50 of executable locked profit, exact depth and fees, and a 0.10c per-unit safety margin. Duration-aware 6-10% sizing remains inside the 12% event cap. Phones and computers display the same read-only autonomous state. Profits are not guaranteed.</div>
<!-- ============ OVERVIEW ============ -->
<section class="tabpanel" data-tab="overview">
@@ -745,7 +745,7 @@ footer{margin-top:34px;padding-top:22px;border-top:1px solid var(--border);color
</section>
<footer>
Build 125 · Adaptive strategy 65 · Exact-fee complete-NO conversion · Evidence-first bounded snapshots · Six-hour bounded probation with matched executable exits · Serialized self-chained five-minute slots with cron recovery · Oldest-first bounded learning transport · Restart-safe offline runtime · Exact-fee directional learning · Capital-efficient, event-capped verified bundles · Duration-aware protected sizing · Atomic verified bundle-profit recycling · Conservative intact-bundle accounting · Contest-deduplicated sports shadow research · Corrected one-decision-per-event settlement audit · Autonomous runtime 2 · Offline runtime 3 · Maker research 3 · Agent learning 3 · Paper trading only · Live prices from Polymarket's public Gamma and CLOB APIs · Not financial advice ·
Build 126 · Adaptive strategy 65 · Exact-fee complete-NO conversion · Evidence-first bounded snapshots · Six-hour bounded probation with matched executable exits · Serialized self-chained five-minute slots with cron recovery · Oldest-first bounded learning transport · Restart-safe offline runtime · Exact-fee directional learning · Duration-aware, event-capped verified bundles · Scale-aware executable-profit floor · Atomic verified bundle-profit recycling · Conservative intact-bundle accounting · Contest-deduplicated sports shadow research · Corrected one-decision-per-event settlement audit · Autonomous runtime 2 · Offline runtime 3 · Maker research 3 · Agent learning 3 · Paper trading only · Live prices from Polymarket's public Gamma and CLOB APIs · 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>
@@ -774,7 +774,7 @@ const POLITICS_TREND_MIN_HOLD_HOURS = 72;
const EXIT_CONFIRM_HOURS = 6;
const AGENTS_KEY = "pma_agents_v2";
const SUG_KEY = "pma_suggestions_v5";
const BUILD_VERSION = 125;
const BUILD_VERSION = 126;
const AGENT_LEARNING_VERSION = 3;
const SUGGESTION_ENGINE_VERSION = 65;
const MAKER_STRATEGY_VERSION = 3;
@@ -1467,10 +1467,31 @@ function bundleEventKey(item={}){
const id=String(item.bundle_id||"");
const match=id.match(/^(?:bundle|dominance):([^:]+)/);return match?match[1]:id;
}
function bundleExpectedLockDays(item={}){
if(item.bundle_immediate_merge||item.bundle_immediate_convert)return 1;
const days=Number(item.days_to_resolution);
return Number.isFinite(days)&&days>0?Math.max(1,days):365;
}
function bundleMinimumDailyReturn(item={}){
if(item.bundle_immediate_merge||item.bundle_immediate_convert)return BUNDLE_IMMEDIATE_MIN_DAILY_RETURN;
const days=bundleExpectedLockDays(item);
if(days<=BUNDLE_SHORT_LOCK_DAYS)return BUNDLE_MIN_DAILY_RETURN;
if(days<=BUNDLE_MEDIUM_LOCK_DAYS)return BUNDLE_MEDIUM_MIN_DAILY_RETURN;
if(days<=BUNDLE_LONG_LOCK_DAYS)return BUNDLE_LONG_MIN_DAILY_RETURN;
return BUNDLE_EXTENDED_MIN_DAILY_RETURN;
}
function bundleCapitalEfficiency(item={}){
const netReturn=Math.max(0,Number(item.net_edge)||0),days=Number(item.days_to_resolution);
const lockDays=item.bundle_immediate_merge||item.bundle_immediate_convert?1:(Number.isFinite(days)&&days>0?Math.max(1,days):365);
return netReturn/lockDays;
return Math.max(0,Number(item.net_edge)||0)/bundleExpectedLockDays(item);
}
function bundleClearsCapitalEfficiency(item={}){
return Number(item.bundle_capital_efficiency)>=bundleMinimumDailyReturn(item);
}
function bundleExecutionTotalProfit(item={}){
return Math.max(0,Number(item.bundle_net_profit_per_unit??item.profit)||0)*Math.max(0,Number(item.execution_units??item.units)||0);
}
function bundleClearsExecutionProfit(item={}){
return Number(item.bundle_net_profit_per_unit??item.profit)>=NEG_RISK_MIN_NET_PROFIT
&&bundleExecutionTotalProfit(item)>=BUNDLE_MIN_EXECUTION_PROFIT;
}
function bundlePositionCapPct(item={}){
if(item.bundle_immediate_merge||item.bundle_immediate_convert)return BUNDLE_IMMEDIATE_POSITION_CAP_PCT;
@@ -1623,16 +1644,19 @@ async function verifyExecutableBundles(candidates){
const estimatedCost=Number(candidate.bundle_cost_per_unit),requiredUnits=bundleMinimumExecutionUnits(Math.max(estimatedCost,0.01));
const minimumUnits=Math.max(requiredUnits,...(candidate.bundle_legs||[]).map(leg=>Number(books.get(String(leg.token_id||""))&&books.get(String(leg.token_id||"")).min_order_size||0)));
const quote=maximizeBundleExecution(candidate,books,minimumUnits),cost=quote.cost,profit=quote.profit,netReturn=quote.net_return;
const executionTotalProfit=Number.isFinite(profit)?profit*quote.units:0;
return Object.assign({},candidate,{bundle_legs:quote.legs,execution_units:quote.units,execution_notional:Number.isFinite(quote.notional)?+quote.notional.toFixed(2):null,
execution_total_profit:+executionTotalProfit.toFixed(4),
bundle_cost_per_unit:Number.isFinite(cost)?+cost.toFixed(6):null,bundle_net_profit_per_unit:Number.isFinite(profit)?+profit.toFixed(6):null,
edge:Number.isFinite(netReturn)?+netReturn.toFixed(6):null,net_edge:Number.isFinite(netReturn)?+netReturn.toFixed(6):null,
bundle_capital_efficiency:Number.isFinite(netReturn)?+bundleCapitalEfficiency(Object.assign({},candidate,{net_edge:netReturn})).toFixed(8):0,
bundle_min_daily_return:+bundleMinimumDailyReturn(candidate).toFixed(8),
depth_verified:quote.depth_verified,fees_verified:false,trade_ready:false,entry_candidate:false,opportunity_actionable:false,watch_only:true,audited_observation_only:true,
execution_model:"live-order-book-vwap",verification_status:quote.depth_verified?"depth-verified":"insufficient-depth"});
});
const potentiallyActionable=depthChecked.filter(candidate=>candidate.depth_verified
&&Number(candidate.bundle_net_profit_per_unit)>=NEG_RISK_MIN_NET_PROFIT&&Number(candidate.net_edge)>=NEG_RISK_MIN_NET_RETURN
&&Number(candidate.bundle_capital_efficiency)>=BUNDLE_MIN_DAILY_RETURN
&&bundleClearsExecutionProfit(candidate)&&Number(candidate.net_edge)>=NEG_RISK_MIN_NET_RETURN
&&bundleClearsCapitalEfficiency(candidate)
&&(candidate.bundle_legs||[]).every(leg=>leg.fee_config_valid));
const feeCheckIds=new Set(potentiallyActionable.map(candidate=>String(candidate.bundle_id||candidate.market_id||"")));
const reportedFees=await fetchBundleFeeSchedules(potentiallyActionable.flatMap(candidate=>candidate.bundle_legs.map(leg=>leg.condition_id)));
@@ -1642,12 +1666,13 @@ async function verifyExecutableBundles(candidates){
const feesVerified=feeConfigValid&&feeCheckAttempted&&(candidate.bundle_legs||[]).every(leg=>{
const reported=reportedFees.get(String(leg.condition_id||""));return bundleFeeSchedulesMatch(leg.fee_schedule,reported);
});
const profitClears=Number(candidate.bundle_net_profit_per_unit)>=NEG_RISK_MIN_NET_PROFIT;
const unitProfitClears=Number(candidate.bundle_net_profit_per_unit)>=NEG_RISK_MIN_NET_PROFIT;
const totalProfitClears=bundleExecutionTotalProfit(candidate)>=BUNDLE_MIN_EXECUTION_PROFIT;
const returnClears=Number(candidate.net_edge)>=NEG_RISK_MIN_NET_RETURN;
const capitalEfficient=Number(candidate.bundle_capital_efficiency)>=BUNDLE_MIN_DAILY_RETURN;
const actionable=candidate.depth_verified&&feesVerified&&capitalEfficient&&profitClears&&returnClears;
const capitalEfficient=bundleClearsCapitalEfficiency(candidate);
const actionable=candidate.depth_verified&&feesVerified&&capitalEfficient&&unitProfitClears&&totalProfitClears&&returnClears;
const feeState=!feeConfigValid?"fee-schedule-unavailable":(!feeCheckAttempted?"fee-check-not-required":(feesVerified?"verified-market-specific":"fee-verification-unavailable"));
const blockState=!feeConfigValid?"fee-schedule-unavailable":(!profitClears?"profit-below-floor":(!returnClears?"return-below-floor":(!capitalEfficient?"capital-efficiency-too-low":feeState)));
const blockState=!feeConfigValid?"fee-schedule-unavailable":(!unitProfitClears?"profit-below-floor":(!totalProfitClears?"total-profit-below-floor":(!returnClears?"return-below-floor":(!capitalEfficient?"capital-efficiency-too-low":feeState))));
const friction=(candidate.bundle_legs||[]).reduce((sum,leg)=>sum+Number(leg.fee_per_share||0),0);
return Object.assign({},candidate,{fees_verified:feesVerified,fee_check_attempted:feeCheckAttempted,fee_model:feeState,trade_ready:actionable,entry_candidate:actionable,
opportunity_actionable:actionable,watch_only:!actionable,audited_observation_only:!actionable,
@@ -1655,7 +1680,7 @@ async function verifyExecutableBundles(candidates){
friction:+friction.toFixed(6),drivers:[...(candidate.drivers||[]).filter(driver=>driver!=="positive margin after estimated costs"),
"live order-book VWAP",capitalEfficient?"capital lock return clears floor":"capital lock return below floor",
feesVerified?"CLOB-verified fee schedule":(feeCheckAttempted?"fee verification blocks entry":"economic gate blocks fee check")],
rationale:`${candidate.rationale} Live verification modeled ${Number(candidate.execution_units||0).toFixed(2)} equal units (${candidate.execution_notional==null?"unavailable":fmtUSD(candidate.execution_notional)}) across every leg and applied the taker fee curve at each consumed ask. ${actionable?`All legs had sufficient depth, their CLOB fee state matched Gamma, and executable worst-case profit is ${Number(candidate.bundle_net_profit_per_unit).toFixed(4)} per unit after ${friction.toFixed(4)} in fees per unit, above the ${(BUNDLE_MIN_DAILY_RETURN*100).toFixed(2)}% daily locked-capital floor.`:`Entry is blocked: ${candidate.depth_verified?blockState:"one or more legs lacked sufficient ask depth"}.`}`});
rationale:`${candidate.rationale} Live verification modeled ${Number(candidate.execution_units||0).toFixed(2)} equal units (${candidate.execution_notional==null?"unavailable":fmtUSD(candidate.execution_notional)}) across every leg and applied the taker fee curve at each consumed ask. ${actionable?`All legs had sufficient depth, their CLOB fee state matched Gamma, and executable worst-case profit is ${Number(candidate.bundle_net_profit_per_unit).toFixed(4)} per unit / ${fmtUSD(bundleExecutionTotalProfit(candidate))} total after ${friction.toFixed(4)} in fees per unit, above the ${(bundleMinimumDailyReturn(candidate)*100).toFixed(3)}% daily hurdle for a ${bundleExpectedLockDays(candidate).toFixed(1)}-day lock.`:`Entry is blocked: ${candidate.depth_verified?blockState:"one or more legs lacked sufficient ask depth"}.`}`});
}).sort(compareBundleOpportunities);
}
async function fetchNegativeRiskBundles(limit=NEG_RISK_EVENT_SCAN_LIMIT){
@@ -1702,6 +1727,10 @@ async function fetchNegativeRiskBundles(limit=NEG_RISK_EVENT_SCAN_LIMIT){
actionable_events:new Set(unique.map(bundleEventKey).filter(Boolean)).size,returned_events:new Set(prioritized.map(bundleEventKey).filter(Boolean)).size,
closest_margin_cents:closest?+(Number(closest.bundle_net_profit_per_unit)*100).toFixed(2):null,
closest_return_pct:closest?+(Number(closest.net_edge)*100).toFixed(3):null,
closest_total_profit:closest?+bundleExecutionTotalProfit(closest).toFixed(2):null,
closest_daily_return_pct:closest?+(Number(closest.bundle_capital_efficiency)*100).toFixed(4):null,
closest_required_daily_return_pct:closest?+(bundleMinimumDailyReturn(closest)*100).toFixed(4):null,
closest_expected_lock_days:closest?+bundleExpectedLockDays(closest).toFixed(2):null,
closest_title:closest?closest.question:null,closest_url:closest?closest.url:null}};
}
async function fetchRewardMakerCandidates(limit=60){
@@ -1751,7 +1780,7 @@ const SIGNAL_ROUND_TRIP_COST=0.005;
const SIGNAL_UNKNOWN_FEE_FALLBACK=0.04;
const NEG_RISK_EVENT_SCAN_LIMIT=1000;
const NEG_RISK_MIN_LIQUIDITY=1000;
const NEG_RISK_MIN_NET_PROFIT=0.003;
const NEG_RISK_MIN_NET_PROFIT=0.001;
const NEG_RISK_MIN_NET_RETURN=0.0015;
const BUNDLE_BOOK_BATCH_SIZE=200;
const BUNDLE_DEPTH_CANDIDATE_LIMIT=80;
@@ -1767,7 +1796,15 @@ const BUNDLE_MIN_NOTIONAL=50;
const BUNDLE_MIN_UNITS=5;
const BUNDLE_MAX_VERIFIED_NOTIONAL=1000;
const BUNDLE_EVENT_CAP_PCT=0.12;
const BUNDLE_MIN_DAILY_RETURN=0.0005;
const BUNDLE_MIN_EXECUTION_PROFIT=0.50;
const BUNDLE_IMMEDIATE_MIN_DAILY_RETURN=0.0001;
const BUNDLE_MIN_DAILY_RETURN=0.0003;
const BUNDLE_MEDIUM_MIN_DAILY_RETURN=0.0004;
const BUNDLE_LONG_MIN_DAILY_RETURN=0.0005;
const BUNDLE_EXTENDED_MIN_DAILY_RETURN=0.00075;
const BUNDLE_SHORT_LOCK_DAYS=7;
const BUNDLE_MEDIUM_LOCK_DAYS=30;
const BUNDLE_LONG_LOCK_DAYS=90;
const BUNDLE_BASE_POSITION_CAP_PCT=0.06;
const BUNDLE_HIGH_EFFICIENCY_POSITION_CAP_PCT=0.08;
const BUNDLE_IMMEDIATE_POSITION_CAP_PCT=0.10;
@@ -2322,9 +2359,9 @@ function compactSuggestionForSync(s){
conversion_verification_status:s.conversion_verification_status,
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_legs:s.bundle_legs,
bundle_capital_efficiency:s.bundle_capital_efficiency,
bundle_capital_efficiency:s.bundle_capital_efficiency,bundle_min_daily_return:s.bundle_min_daily_return,
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_units:s.execution_units,execution_notional:s.execution_notional,execution_total_profit:s.execution_total_profit,verification_status:s.verification_status,
days_to_resolution:s.days_to_resolution,event_key:s.event_key,game_start:s.game_start,hours_to_start:s.hours_to_start,
end_date:s.end_date,target_horizon_days:s.target_horizon_days,resolution_week_strategy_version:s.resolution_week_strategy_version,
sports_contest_strategy_version:s.sports_contest_strategy_version,entry_fee:s.entry_fee,
@@ -4547,6 +4584,7 @@ function openNegativeRiskBundle(p,cfg,s,stake,decision){
||(s.bundle_immediate_convert&&!s.bundle_conversion_terms_verified)
||!(verifiedUnits>0)||!(unitCost>0)||!(Number(s.bundle_net_profit_per_unit)>0))return null;
const units=+Math.min(verifiedUnits,Math.max(0,stake)/unitCost).toFixed(2);if(units<=0)return null;
if(units*Number(s.bundle_net_profit_per_unit)<BUNDLE_MIN_EXECUTION_PROFIT)return null;
const bundleSide=s.bundle_side||s.side||"NO";
const openedAt=cycleIso(),positions=legs.map(leg=>{
const entry=Number(leg.entry_price),current=Number(leg.current_price),cost=+(units*entry).toFixed(2),side=leg.side||bundleSide;
@@ -4633,7 +4671,8 @@ function openPositions(p,cfg,rankedSugs,focus,decision,avoidMarketIds,peerStats=
if(!s.learning_allowed)return reject(s.learning_block_reason==="historical"?"historical_prior":"learning");
if(s.quality==="bundle-arb"){
if(!Array.isArray(s.bundle_legs)||s.bundle_legs.length<2||!(Number(s.bundle_net_profit_per_unit)>0))return reject("bundle_integrity");
if(Number(s.bundle_capital_efficiency)<BUNDLE_MIN_DAILY_RETURN)return reject("bundle_capital_efficiency");
if(!bundleClearsExecutionProfit(s))return reject("bundle_execution_profit");
if(!bundleClearsCapitalEfficiency(s))return reject("bundle_capital_efficiency");
if((p.positions||[]).length+s.bundle_legs.length>maxPositions)return reject("portfolio_limit");
if((p.positions||[]).some(pos=>pos.bundle_id===s.bundle_id))return reject("already_held");
if(bundleEventExposure(p,bundleEventKey(s))>=eqBefore*BUNDLE_EVENT_CAP_PCT-BUNDLE_MIN_NOTIONAL)return reject("bundle_event_cap");
@@ -5534,7 +5573,7 @@ function renderSuggestions(){
const analyzed=Number(data.analyzed_count||data.market_count||0).toLocaleString();
const audit=data.opportunity_audit||null;
const auditText=audit&&audit.status==="ok"
?` Bundle scanner checked ${Number(audit.events_scanned||0).toLocaleString()} events and ${Number(audit.evaluated_structures||0).toLocaleString()} complete, exclusivity-pair, dominance, and binary-complement structures, depth-tested ${Number(audit.depth_checked_structures||0)}, and found ${Number(audit.depth_verified_structures||0)} with $50 depth; ${Number(audit.fee_check_eligible_structures||0)} reached exact fee verification and ${Number(audit.actionable_bundles||0)} cleared every profit gate. Exclusive NO pairs: ${Number(audit.exclusive_pair_structures||0)} depth-tested, ${Number(audit.exclusive_pair_depth_verified||0)} depth-verified, ${Number(audit.actionable_exclusive_pairs||0)} actionable.${audit.closest_exclusive_pair_margin_cents!=null?` Closest pair margin: ${Number(audit.closest_exclusive_pair_margin_cents)>=0?"+":""}${Number(audit.closest_exclusive_pair_margin_cents).toFixed(2)}c (${Number(audit.closest_exclusive_pair_return_pct)>=0?"+":""}${Number(audit.closest_exclusive_pair_return_pct).toFixed(2)}%).`:""} Exact complete-NO conversion: ${Number(audit.conversion_candidates_scanned||0)} discovered, ${Number(audit.conversion_structures||0)} depth-tested in its reserved lane, ${Number(audit.conversion_terms_verified||0)} adapter-verified, ${Number(audit.conversion_depth_verified||0)} depth-verified, ${Number(audit.conversion_fee_verified||0)} CLOB-fee-verified, ${Number(audit.actionable_conversions||0)} actionable.${audit.closest_conversion_margin_cents!=null?` Closest conversion margin: ${Number(audit.closest_conversion_margin_cents)>=0?"+":""}${Number(audit.closest_conversion_margin_cents).toFixed(2)}c (${Number(audit.closest_conversion_return_pct)>=0?"+":""}${Number(audit.closest_conversion_return_pct).toFixed(2)}%).`:""}${audit.closest_margin_cents!=null?` Closest overall depth-tested margin: ${Number(audit.closest_margin_cents)>=0?"+":""}${Number(audit.closest_margin_cents).toFixed(2)}c per bundle.`:""}`
?` Bundle scanner checked ${Number(audit.events_scanned||0).toLocaleString()} events and ${Number(audit.evaluated_structures||0).toLocaleString()} complete, exclusivity-pair, dominance, and binary-complement structures, depth-tested ${Number(audit.depth_checked_structures||0)}, and found ${Number(audit.depth_verified_structures||0)} with $50 depth; ${Number(audit.fee_check_eligible_structures||0)} reached exact fee verification and ${Number(audit.actionable_bundles||0)} cleared every profit gate. Exclusive NO pairs: ${Number(audit.exclusive_pair_structures||0)} depth-tested, ${Number(audit.exclusive_pair_depth_verified||0)} depth-verified, ${Number(audit.actionable_exclusive_pairs||0)} actionable.${audit.closest_exclusive_pair_margin_cents!=null?` Closest pair margin: ${Number(audit.closest_exclusive_pair_margin_cents)>=0?"+":""}${Number(audit.closest_exclusive_pair_margin_cents).toFixed(2)}c (${Number(audit.closest_exclusive_pair_return_pct)>=0?"+":""}${Number(audit.closest_exclusive_pair_return_pct).toFixed(2)}%).`:""} Exact complete-NO conversion: ${Number(audit.conversion_candidates_scanned||0)} discovered, ${Number(audit.conversion_structures||0)} depth-tested in its reserved lane, ${Number(audit.conversion_terms_verified||0)} adapter-verified, ${Number(audit.conversion_depth_verified||0)} depth-verified, ${Number(audit.conversion_fee_verified||0)} CLOB-fee-verified, ${Number(audit.actionable_conversions||0)} actionable.${audit.closest_conversion_margin_cents!=null?` Closest conversion margin: ${Number(audit.closest_conversion_margin_cents)>=0?"+":""}${Number(audit.closest_conversion_margin_cents).toFixed(2)}c (${Number(audit.closest_conversion_return_pct)>=0?"+":""}${Number(audit.closest_conversion_return_pct).toFixed(2)}%).`:""}${audit.closest_margin_cents!=null?` Closest overall: ${Number(audit.closest_margin_cents)>=0?"+":""}${Number(audit.closest_margin_cents).toFixed(2)}c per unit, ${fmtUSD(Number(audit.closest_total_profit||0))} total, ${Number(audit.closest_daily_return_pct||0).toFixed(3)}% per day versus a ${Number(audit.closest_required_daily_return_pct||0).toFixed(3)}% hurdle over ${Number(audit.closest_expected_lock_days||0).toFixed(1)} days.`:""}`
:(audit?" Bundle scanner was unavailable during this cycle; the site did not treat cached bundle prices as executable.":"");
$("focusNote").textContent=focus==="All"
? `Loaded the ${scanned} most active markets, analyzed ${analyzed}, and kept ${all.length} ideas (${buyCount} TRADE READY, ${watchCount} WATCH). Showing ${filtered.length}; directional signals remain WATCH until their own event-clustered cohorts earn positive promotion. Complete bundles are trade ready only after every leg clears a live $50 order-book depth check and the CLOB fee state agrees with the market-specific taker curve while preserving a positive worst-case payout margin. Cash is retained when neither condition is met. Avg evidence ${evAvg}.${auditText}`
@@ -7003,8 +7042,10 @@ window.PMA_ENGINE_DIAGNOSTICS=Object.freeze({
autonomousScanMinutes:5,bundleOpportunityTelemetry:true,bundleDepthCandidateLimit:BUNDLE_DEPTH_CANDIDATE_LIMIT,
bundleMinimumNotional:BUNDLE_MIN_NOTIONAL,bundleRequiresDepthVerification:true,bundleRequiresClobFeeVerification:true,
dominanceBundleLogic:"same-event nested threshold or calendar-deadline YES/NO pairs with identical normalized terms",
negativeRiskMinimumNetReturnPct:NEG_RISK_MIN_NET_RETURN*100,bundleEventCapPct:BUNDLE_EVENT_CAP_PCT*100,
bundleMinimumDailyReturnPct:BUNDLE_MIN_DAILY_RETURN*100,
negativeRiskMinimumNetReturnPct:NEG_RISK_MIN_NET_RETURN*100,negativeRiskMinimumProfitPerUnitCents:NEG_RISK_MIN_NET_PROFIT*100,
bundleMinimumExecutionProfit:BUNDLE_MIN_EXECUTION_PROFIT,bundleEventCapPct:BUNDLE_EVENT_CAP_PCT*100,
bundleDailyReturnHurdlesPct:{immediate:BUNDLE_IMMEDIATE_MIN_DAILY_RETURN*100,short:BUNDLE_MIN_DAILY_RETURN*100,
medium:BUNDLE_MEDIUM_MIN_DAILY_RETURN*100,long:BUNDLE_LONG_MIN_DAILY_RETURN*100,extended:BUNDLE_EXTENDED_MIN_DAILY_RETURN*100},
bundleRanking:"net return per locked day, then raw executable edge",
pairedMakerQuotes:"research-only-immediate-lock-or-exit",makerStrategyVersion:MAKER_STRATEGY_VERSION,
makerShadowHorizonHours:MAKER_SHADOW_HORIZON_HOURS,makerLegacyQuoteExpiryHours:MAKER_QUOTE_EXPIRY_HOURS,makerMinimumLockMarginPct:MAKER_MIN_LOCK_MARGIN*100,
@@ -7778,8 +7819,21 @@ function runEngineSelfTest(){
const invalidDeadlineRejected=parseDominanceDeadline("Will Acme launch by February 30, 2026?")===null;
[bundleSuggestion,yesBundleSuggestion,dominanceSuggestion,deadlineSuggestion].filter(Boolean).forEach(suggestion=>Object.assign(suggestion,{
depth_verified:true,fees_verified:true,fee_model:"verified-zero-fee",execution_model:"fixture-vwap",verification_status:"executable",execution_units:1000,
bundle_capital_efficiency:BUNDLE_MIN_DAILY_RETURN*2,
bundle_capital_efficiency:BUNDLE_EXTENDED_MIN_DAILY_RETURN*2,
}));
const shortDurationEfficiency={days_to_resolution:5,bundle_capital_efficiency:0.00035};
const extendedDurationEfficiency={days_to_resolution:180,bundle_capital_efficiency:0.00035};
const scalableSlimMargin={bundle_net_profit_per_unit:0.0018,execution_units:400};
const dustSlimMargin={bundle_net_profit_per_unit:0.0018,execution_units:100};
const slimMarginCandidate=Object.assign({},dominanceSuggestion,{bundle_id:"dominance:slim-margin:a:b",bundle_event_id:"slim-margin",
bundle_cost_per_unit:0.9982,bundle_net_profit_per_unit:0.0018,net_edge:0.001803,execution_units:400,
bundle_legs:[
Object.assign({},dominanceSuggestion.bundle_legs[0],{entry_price:0.069,current_price:0.068}),
Object.assign({},dominanceSuggestion.bundle_legs[1],{entry_price:0.9292,current_price:0.928}),
]});
const fullSlimMarginBook=defaultPortfolio(),reducedSlimMarginBook=defaultPortfolio();
const fullSlimMarginOpen=openNegativeRiskBundle(fullSlimMarginBook,agentById("diversifier"),slimMarginCandidate,400,{mode:"Fixture"});
const reducedSlimMarginOpen=openNegativeRiskBundle(reducedSlimMarginBook,agentById("diversifier"),slimMarginCandidate,200,{mode:"Fixture"});
const capitalEfficiencyOrder=[
Object.assign({},dominanceSuggestion,{bundle_id:"dominance:slow-event:a:b",bundle_event_id:"slow-event",net_edge:0.03,days_to_resolution:30}),
Object.assign({},dominanceSuggestion,{bundle_id:"dominance:fast-event:a:b",bundle_event_id:"fast-event",net_edge:0.02,days_to_resolution:5}),
@@ -7829,14 +7883,14 @@ function runEngineSelfTest(){
const eventBurstExposure=bundleEventExposure(eventBurstBook,"event-burst");
const unverifiedBundleBook=defaultPortfolio(),unverifiedBundleOpen=openNegativeRiskBundle(unverifiedBundleBook,AGENTS.find(a=>a.id==="value"),
Object.assign({},bundleSuggestion,{depth_verified:false,verification_status:"top-of-book-estimate"}),100,null);
const depthCappedBundleBook=defaultPortfolio(),depthCappedBundle=Object.assign({},bundleSuggestion,{execution_units:50});
const depthCappedBundleBook=defaultPortfolio(),depthCappedBundle=Object.assign({},bundleSuggestion,{execution_units:100});
openNegativeRiskBundle(depthCappedBundleBook,AGENTS.find(a=>a.id==="value"),depthCappedBundle,400,null);
const repricedBoundaryUnits=bundleMinimumExecutionUnits(0.996041,50.04);
const repricedBoundaryUnits=bundleMinimumExecutionUnits(0.99,50.04);
const repricedBoundaryCandidate=Object.assign({},dominanceSuggestion,{market_id:"repriced-boundary",bundle_id:"repriced-boundary",
bundle_cost_per_unit:0.996041,bundle_net_profit_per_unit:0.003959,execution_units:repricedBoundaryUnits,
bundle_cost_per_unit:0.99,bundle_net_profit_per_unit:0.01,net_edge:0.010101,execution_units:repricedBoundaryUnits,
bundle_legs:[
{market_id:"repriced-boundary-a",question:"Boundary A",side:"YES",token_id:"boundary-a",entry_price:0.990693,current_price:0.9895},
{market_id:"repriced-boundary-b",question:"Boundary B",side:"NO",token_id:"boundary-b",entry_price:0.005348,current_price:0.006},
{market_id:"repriced-boundary-a",question:"Boundary A",side:"YES",token_id:"boundary-a",entry_price:0.984,current_price:0.983},
{market_id:"repriced-boundary-b",question:"Boundary B",side:"NO",token_id:"boundary-b",entry_price:0.006,current_price:0.007},
]});
const repricedBoundaryBook=defaultPortfolio();
const repricedBoundaryOpen=openNegativeRiskBundle(repricedBoundaryBook,AGENTS.find(a=>a.id==="value"),repricedBoundaryCandidate,400,null);
@@ -8393,6 +8447,15 @@ function runEngineSelfTest(){
derivesLegacyBundleEventKey:bundleEventKey({bundle_id:"dominance:legacy-event:market-a:market-b"})==="legacy-event",
capsUnderlyingEventExposure:eventCapBook.positions.length===2&&eventCapBook.lastDecision.rejectionCounts.bundle_event_cap===1,
blocksLowReturnPerLockedDay:slowCapitalBook.positions.length===0&&slowCapitalBook.lastDecision.rejectionCounts.bundle_capital_efficiency===1,
shortLocksUseProductiveHurdle:bundleMinimumDailyReturn(shortDurationEfficiency)===0.0003
&&bundleClearsCapitalEfficiency(shortDurationEfficiency),
longLocksRequireMoreReturn:bundleMinimumDailyReturn(extendedDurationEfficiency)===0.00075
&&!bundleClearsCapitalEfficiency(extendedDurationEfficiency),
scalesSlimMarginsToMeaningfulProfit:bundleClearsExecutionProfit(scalableSlimMargin)
&&Math.abs(bundleExecutionTotalProfit(scalableSlimMargin)-0.72)<0.000001,
rejectsDustProfitDespitePositiveUnitMargin:!bundleClearsExecutionProfit(dustSlimMargin),
actualOpenedSizeMustPreserveProfitFloor:Boolean(fullSlimMarginOpen&&fullSlimMarginBook.positions.length===2
&&reducedSlimMarginOpen===null&&reducedSlimMarginBook.positions.length===0),
durationAwareSizingScalesProtectedCapital:highEfficiencyBook.positions.length===2
&&highEfficiencyCost>=799.9&&highEfficiencyCost<=800.1&&bundlePositionCapPct(highEfficiencyBundle)===0.08,
sameCycleEventBurstStaysWithinCap:eventBurstExposure<=STARTING_BALANCE*BUNDLE_EVENT_CAP_PCT+0.01
@@ -8418,7 +8481,7 @@ function runEngineSelfTest(){
&&scalableBundleQuote.net_return>0.05,
stopsSizingAtShallowestBundleLeg:depthLimitedBundleQuote.units>=119.9&&depthLimitedBundleQuote.units<=120
&&depthLimitedBundleQuote.notional<=BUNDLE_MAX_VERIFIED_NOTIONAL,
liveRepricingRoundsUpToMinimumNotional:repricedBoundaryUnits===50.21&&repricedBoundaryUnits*0.996041>=BUNDLE_MIN_NOTIONAL+0.009,
liveRepricingRoundsUpToMinimumNotional:repricedBoundaryUnits===50.52&&repricedBoundaryUnits*0.99>=BUNDLE_MIN_NOTIONAL+0.009,
repricedMinimumNotionalOpensAtomically:Boolean(repricedBoundaryOpen&&repricedBoundaryBook.positions.length===2
&&repricedBoundaryOpen.cost>=BUNDLE_MIN_NOTIONAL),
intactBundleDoesNotShowArtificialLoss:conservativeBundleRawValue<conservativeBundleCost
@@ -8431,7 +8494,7 @@ function runEngineSelfTest(){
&&undersizedBoundaryBook.lastDecision.rejectionCounts.bundle_execution===1,
blocksUnverifiedBundleEntry:unverifiedBundleOpen===null&&unverifiedBundleBook.positions.length===0&&unverifiedBundleBook.cash===STARTING_BALANCE,
capsOpenedUnitsToVerifiedDepth:depthCappedBundleBook.positions.length===3
&&depthCappedBundleBook.positions.every(position=>position.shares===50),
&&depthCappedBundleBook.positions.every(position=>position.shares===100),
rejectsNonBinaryMarketLabels:nonBinaryMarketRejected,
rejectsNonBinaryBundleLabels:nonBinaryBundleRejected,
identifiesAboveThresholdDominance:Boolean(dominanceSuggestion&&dominanceSuggestion.bundle_logic==="threshold-dominance"
+1 -1
View File
@@ -2,7 +2,7 @@ const GAMMA = "https://gamma-api.polymarket.com";
const EVENT_LIMIT = Math.max(20, Math.min(1000, Number(process.env.NEG_RISK_EVENTS || 300)));
const COST_CENTS = Math.max(0, Math.min(5, Number(process.env.NEG_RISK_COST_CENTS || 0.5)));
const MIN_LIQUIDITY = Math.max(0, Number(process.env.NEG_RISK_MIN_LIQUIDITY || 1000));
const MIN_NET_PROFIT = Math.max(0, Number(process.env.NEG_RISK_MIN_NET_PROFIT || 0.003));
const MIN_NET_PROFIT = Math.max(0, Number(process.env.NEG_RISK_MIN_NET_PROFIT || 0.001));
const MIN_NET_RETURN = Math.max(0, Number(process.env.NEG_RISK_MIN_NET_RETURN || 0.0015));
async function fetchJson(url, attempts = 3) {
+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:/);
+6 -2
View File
@@ -39,10 +39,12 @@ const compacted = compactSuggestion({
neg_risk_market_id: "0xmarket", neg_risk_fee_bips: 25, neg_risk_metadata_fee_bips: 25,
neg_risk_question_count: 3, conversion_verification_status: "verified-onchain", bundle_cost_per_unit: 1.95,
bundle_payout_per_unit: 1.995, bundle_settlement_payout_per_unit: 2,
bundle_net_profit_per_unit: 0.05, bundle_capital_efficiency: 0.0025, bundle_legs: [{ market_id: "1", side: "YES" }],
bundle_net_profit_per_unit: 0.05, bundle_capital_efficiency: 0.0025, bundle_min_daily_return: 0.0001,
bundle_legs: [{ market_id: "1", side: "YES" }],
fees_enabled: false, fee_schedule: { rate: 0, exponent: 1, takerOnly: true },
depth_verified: true, fees_verified: true, fee_model: "verified-market-specific", execution_model: "live-order-book-vwap",
execution_units: 250, execution_notional: 237.5, verification_status: "executable", promoted_for_agents: ["value"],
execution_units: 250, execution_notional: 237.5, execution_total_profit: 12.5,
verification_status: "executable", promoted_for_agents: ["value"],
});
assert.equal(compacted.signal_type, "bundle-arb");
assert.equal(compacted.entry_candidate, true);
@@ -60,9 +62,11 @@ assert.equal(compacted.neg_risk_question_count, 3);
assert.equal(compacted.conversion_verification_status, "verified-onchain");
assert.equal(compacted.bundle_settlement_payout_per_unit, 2);
assert.equal(compacted.bundle_capital_efficiency, 0.0025);
assert.equal(compacted.bundle_min_daily_return, 0.0001);
assert.equal(compacted.bundle_legs.length, 1);
assert.equal(compacted.fee_schedule.rate, 0);
assert.equal(compacted.execution_units, 250);
assert.equal(compacted.execution_total_profit, 12.5);
assert.equal(compacted.verification_status, "executable");
assert.deepEqual(compacted.promoted_for_agents, ["value"]);
+1 -1
View File
@@ -1,4 +1,4 @@
const CACHE_NAME = "polymarket-arena-build-125";
const CACHE_NAME = "polymarket-arena-build-126";
const APP_SHELL = ["/", "/index.html", "/personal.html", "/cycle-worker.js"];
self.addEventListener("install", event => {