mirror of
https://github.com/theodore-song/polymarket-analyst.git
synced 2026-08-24 13:08:10 +00:00
Prioritize capital-efficient independent bundles
This commit is contained in:
+66
-18
@@ -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 120 active:</b> Strategy 63 protects a dedicated evidence budget in every cloud snapshot, so pending observations and net-of-cost outcomes survive runner restarts instead of being displaced by repeated display text. Independently positive six-hour cohorts can enter bounded probation after at least 12 events and a lower confidence bound above 1%, using at most 0.5% per position and 1% per-agent total capital with a matching executable exit. Full directional sizing still requires positive 24-hour and 72-hour evidence, while one mature negative cohort can veto risk. Chart snapshots retain bounded time coverage, the public agents continue serialized five-minute cycles and restart-safe offline operation, and intact complete bundles remain depth-and-fee verified. Phones and computers display the same read-only autonomous state. Profits are not guaranteed.</div>
|
||||
<div class="live-build-banner"><b>Build 121 active:</b> Strategy 64 protects a dedicated evidence budget in every cloud snapshot, so pending observations and net-of-cost outcomes survive runner restarts instead of being displaced by repeated display text. Independently positive six-hour cohorts can enter bounded probation after at least 12 events and a lower confidence bound above 1%, using at most 0.5% per position and 1% per-agent total capital with a matching executable exit. Full directional sizing still requires positive 24-hour and 72-hour evidence, while one mature negative cohort can veto risk. Depth-and-fee-verified complete bundles are ranked by return per locked day and capped at 12% of Value Hunter equity per underlying event, preventing repeated threshold pairs from crowding out independent opportunities. 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 120 · Adaptive strategy 63 · 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 · Verified-capacity complete bundles · Conservative intact-bundle accounting · Contest-deduplicated sports exploration · 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 121 · Adaptive strategy 64 · 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 · Conservative intact-bundle accounting · Contest-deduplicated sports exploration · 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,17 +774,17 @@ 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 = 120;
|
||||
const BUILD_VERSION = 121;
|
||||
const AGENT_LEARNING_VERSION = 3;
|
||||
const SUGGESTION_ENGINE_VERSION = 63;
|
||||
const SUGGESTION_ENGINE_VERSION = 64;
|
||||
const MAKER_STRATEGY_VERSION = 3;
|
||||
const SHOCK_FADE_STRATEGY_VERSION = 4;
|
||||
const RESOLUTION_WEEK_NO_STRATEGY_VERSION = 3;
|
||||
const SPORTS_CONTEST_NO_STRATEGY_VERSION = 1;
|
||||
const PREVIOUS_STRATEGY_VERSION = 62;
|
||||
const PREVIOUS_STRATEGY_VERSION = 63;
|
||||
const DIRECTIONAL_SIGNAL_POLICY_VERSION = 2;
|
||||
const DIRECTIONAL_SIGNAL_COMPATIBLE_STRATEGY_MIN = 51;
|
||||
const DIRECTIONAL_SIGNAL_COMPATIBLE_STRATEGY_MAX = 63;
|
||||
const DIRECTIONAL_SIGNAL_COMPATIBLE_STRATEGY_MAX = 64;
|
||||
const LEGACY_BUILD_STRATEGY_LINEAGE = Object.freeze({40:40,41:40});
|
||||
function normalizedStrategyVersion(value){
|
||||
const version=Number(value||0);
|
||||
@@ -872,8 +872,13 @@ async function refreshTradeEmailStatus(){
|
||||
Five core and five aggressive strategies share the same live suggestion pool. */
|
||||
const AGENTS = [
|
||||
{id:"value", name:"Value Hunter", emoji:"🎯", color:"#7c8cff", kind:"strategy",
|
||||
blurb:"Runs the arena's non-directional book: complete negative-risk bundles plus paired resting YES/NO bids in calm, reward-scoring markets. A paired quote earns nothing until live prices cross each leg; two fills below $1 lock settlement value, while unmatched inventory is unwound after 24 hours.",
|
||||
rank:(s)=>[...s].sort((a,b)=>(Math.abs(b.net_edge||b.edge||0)*120+b.conviction+Number(b.evidence_score||0)*18)-(Math.abs(a.net_edge||a.edge||0)*120+a.conviction+Number(a.evidence_score||0)*18)),
|
||||
blurb:"Runs the arena's non-directional book: complete negative-risk bundles plus paired resting YES/NO bids in calm, reward-scoring markets. Verified bundles are prioritized by return per day of locked capital and capped by underlying event, so one threshold family cannot crowd out independent opportunities. A paired quote earns nothing until live prices cross each leg; two fills below $1 lock settlement value, while unmatched inventory is unwound after 24 hours.",
|
||||
rank:(s)=>[...s].sort((a,b)=>{
|
||||
const bundleOrder=Number(b.quality==="bundle-arb")-Number(a.quality==="bundle-arb");
|
||||
if(bundleOrder)return bundleOrder;
|
||||
if(a.quality==="bundle-arb")return compareBundleOpportunities(a,b);
|
||||
return (Math.abs(b.net_edge||b.edge||0)*120+b.conviction+Number(b.evidence_score||0)*18)-(Math.abs(a.net_edge||a.edge||0)*120+a.conviction+Number(a.evidence_score||0)*18);
|
||||
}),
|
||||
maxNew:4, maxFrac:0.055, minConv:58, kelly:0.24, targetExposure:0.62, drawdownExposure:0.42},
|
||||
{id:"momentum", name:"Momentum Chaser", emoji:"🚀", color:"#34d399", kind:"strategy",
|
||||
blurb:"Chases markets where attention and price are accelerating together. It prioritizes true positive-edge entries, then uses tightly sized trend probes when one-day and one-week price direction agree, spreads are narrow, and enough time remains before settlement.",
|
||||
@@ -1187,7 +1192,7 @@ function dominanceBundleSuggestions(event,{includeUnprofitable=false}={}){
|
||||
:`${superset.question} logically contains ${subset.question}`;
|
||||
const strategy=deadline?"Buying NO on the earlier deadline and YES on the later deadline":"Buying YES on the superset and NO on the subset";
|
||||
const quoteA=pair[0].quote,quoteB=pair[1].quote;
|
||||
candidates.push({market_id:bundleId,bundle_id:bundleId,bundle_side:"MIXED",bundle_logic:bundleLogic,
|
||||
candidates.push({market_id:bundleId,bundle_id:bundleId,bundle_event_id:String(event.id||""),bundle_side:"MIXED",bundle_logic:bundleLogic,
|
||||
question:`Dominance pair: ${event.title||(deadline?lower.stem.replace("{deadline}","___"):superset.stem.replace("{threshold}","___"))}`,event:event.title||"",url:legs[0].url,
|
||||
category:classifyCategory(eventTags),tags:eventTags.map(tag=>tag.label).filter(Boolean).slice(0,4),side:"MIXED",
|
||||
entry_price:+(cost/2).toFixed(4),yes_price:+(cost/2).toFixed(4),no_price:+(cost/2).toFixed(4),fair_value:+(payout/2).toFixed(4),
|
||||
@@ -1203,7 +1208,7 @@ function dominanceBundleSuggestions(event,{includeUnprofitable=false}={}){
|
||||
rationale:`${deadline?"Deadline":"Threshold"} dominance: ${relation}. ${strategy} costs ${cost.toFixed(3)} per pair against a guaranteed minimum payout of $1.00 when both use the same event terms. The preliminary margin is ${profit.toFixed(3)} (${(netReturn*100).toFixed(2)}%); a live depth and market-specific fee check is required before entry. Both live legs must open together and remain paired through settlement.`});
|
||||
}
|
||||
}
|
||||
return candidates.sort((a,b)=>b.net_edge-a.net_edge);
|
||||
return candidates.sort(compareBundleOpportunities);
|
||||
}
|
||||
function negativeRiskBundleSuggestion(event,{includeUnprofitable=false}={}){
|
||||
if(!event||!event.negRisk||event.enableNegRisk===false)return null;
|
||||
@@ -1239,7 +1244,7 @@ function negativeRiskBundleSuggestion(event,{includeUnprofitable=false}={}){
|
||||
if(!candidate)return null;
|
||||
const {side,legs,cost,payout,profit,netReturn}=candidate,minLiquidity=Math.min(...legs.map(leg=>leg.liquidity));
|
||||
const actionable=profit>=NEG_RISK_MIN_NET_PROFIT&&netReturn>=NEG_RISK_MIN_NET_RETURN;
|
||||
return {market_id:`bundle:${event.id}:${side.toLowerCase()}`,bundle_id:`bundle:${event.id}:${side.toLowerCase()}`,bundle_side:side,
|
||||
return {market_id:`bundle:${event.id}:${side.toLowerCase()}`,bundle_id:`bundle:${event.id}:${side.toLowerCase()}`,bundle_event_id:String(event.id||""),bundle_side:side,
|
||||
question:`Complete ${side} bundle: ${event.title||"multi-outcome event"}`,event:event.title||"",
|
||||
url:event.slug?`https://polymarket.com/event/${event.slug}`:"",category,tags:eventTags.map(t=>t.label).filter(Boolean).slice(0,4),
|
||||
side,entry_price:+(cost/legs.length).toFixed(4),yes_price:side==="YES"?+(cost/legs.length).toFixed(4):+(1-cost/legs.length).toFixed(4),
|
||||
@@ -1300,6 +1305,26 @@ function bundleQuoteIsActionable(quote){
|
||||
&"e.profit>=NEG_RISK_MIN_NET_PROFIT&"e.net_return>=NEG_RISK_MIN_NET_RETURN
|
||||
&"e.notional<=BUNDLE_MAX_VERIFIED_NOTIONAL+0.01);
|
||||
}
|
||||
function bundleEventKey(item={}){
|
||||
const explicit=String(item.bundle_event_id||"").trim();if(explicit)return explicit;
|
||||
const id=String(item.bundle_id||"");
|
||||
const match=id.match(/^(?:bundle|dominance):([^:]+)/);return match?match[1]:id;
|
||||
}
|
||||
function bundleCapitalEfficiency(item={}){
|
||||
const netReturn=Math.max(0,Number(item.net_edge)||0),days=Number(item.days_to_resolution);
|
||||
const lockDays=Number.isFinite(days)&&days>0?Math.max(1,days):365;
|
||||
return netReturn/lockDays;
|
||||
}
|
||||
function compareBundleOpportunities(a,b){
|
||||
return bundleCapitalEfficiency(b)-bundleCapitalEfficiency(a)
|
||||
||Number(b.net_edge||-Infinity)-Number(a.net_edge||-Infinity)
|
||||
||Number(b.bundle_net_profit_per_unit||-Infinity)-Number(a.bundle_net_profit_per_unit||-Infinity);
|
||||
}
|
||||
function bundleEventExposure(portfolio,eventKey){
|
||||
const key=String(eventKey||"");if(!key)return 0;
|
||||
return (portfolio&&portfolio.positions||[]).filter(pos=>pos.requires_complete_bundle&&bundleEventKey(pos)===key)
|
||||
.reduce((sum,pos)=>sum+Math.max(0,Number(pos.cost)||0),0);
|
||||
}
|
||||
function maximizeBundleExecution(candidate,books,minimumUnits){
|
||||
let best=bundleQuoteAtUnits(candidate,books,minimumUnits);if(!best.depth_verified)return best;
|
||||
const repricedMinimum=bundleMinimumExecutionUnits(best.cost,minimumUnits);
|
||||
@@ -1342,7 +1367,7 @@ async function fetchBundleFeeRates(tokenIds){
|
||||
await Promise.all(workers);return results;
|
||||
}
|
||||
async function verifyExecutableBundles(candidates){
|
||||
const shortlist=(candidates||[]).slice().sort((a,b)=>Number(b.net_edge||-Infinity)-Number(a.net_edge||-Infinity)).slice(0,BUNDLE_DEPTH_CANDIDATE_LIMIT);
|
||||
const shortlist=(candidates||[]).slice().sort(compareBundleOpportunities).slice(0,BUNDLE_DEPTH_CANDIDATE_LIMIT);
|
||||
const tokenIds=shortlist.flatMap(candidate=>(candidate.bundle_legs||[]).map(leg=>leg.token_id));
|
||||
const books=await fetchBundleBooks(tokenIds),depthChecked=shortlist.map(candidate=>{
|
||||
const estimatedCost=Number(candidate.bundle_cost_per_unit),requiredUnits=bundleMinimumExecutionUnits(Math.max(estimatedCost,0.01));
|
||||
@@ -1370,10 +1395,11 @@ async function verifyExecutableBundles(candidates){
|
||||
return Object.assign({},candidate,{fees_verified:feesVerified,fee_model:feeState,trade_ready:actionable,entry_candidate:actionable,
|
||||
opportunity_actionable:actionable,watch_only:!actionable,audited_observation_only:!actionable,
|
||||
verification_status:actionable?"executable":(candidate.depth_verified?feeState:candidate.verification_status),
|
||||
bundle_capital_efficiency:+bundleCapitalEfficiency(Object.assign({},candidate,{net_edge:netReturn})).toFixed(8),
|
||||
friction:+friction.toFixed(6),drivers:[...(candidate.drivers||[]).filter(driver=>driver!=="positive margin after estimated costs"),
|
||||
"live order-book VWAP",feesVerified?"CLOB-verified fee schedule":"fee check blocks entry"],
|
||||
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 and their CLOB fee state matched Gamma; executable worst-case profit is ${Number(candidate.bundle_net_profit_per_unit).toFixed(4)} per unit after ${friction.toFixed(4)} in fees per unit.`:`Entry is blocked: ${candidate.depth_verified?feeState:"one or more legs lacked sufficient ask depth"}.`}`});
|
||||
}).sort((a,b)=>Number(b.net_edge||-Infinity)-Number(a.net_edge||-Infinity));
|
||||
}).sort(compareBundleOpportunities);
|
||||
}
|
||||
async function fetchNegativeRiskBundles(limit=NEG_RISK_EVENT_SCAN_LIMIT){
|
||||
const events=[],pageSize=100;
|
||||
@@ -1387,7 +1413,7 @@ async function fetchNegativeRiskBundles(limit=NEG_RISK_EVENT_SCAN_LIMIT){
|
||||
const audited=events.flatMap(event=>{
|
||||
const complete=negativeRiskBundleSuggestion(event,{includeUnprofitable:true});
|
||||
return [...(complete?[complete]:[]),...dominanceBundleSuggestions(event,{includeUnprofitable:true})];
|
||||
}).sort((a,b)=>b.net_edge-a.net_edge);
|
||||
}).sort(compareBundleOpportunities);
|
||||
const executableAudit=await verifyExecutableBundles(audited);
|
||||
const candidates=executableAudit.filter(candidate=>candidate.opportunity_actionable);
|
||||
const seen=new Set();
|
||||
@@ -1455,6 +1481,7 @@ const BUNDLE_FEE_CONCURRENCY=8;
|
||||
const BUNDLE_MIN_NOTIONAL=50;
|
||||
const BUNDLE_MIN_UNITS=5;
|
||||
const BUNDLE_MAX_VERIFIED_NOTIONAL=400;
|
||||
const BUNDLE_EVENT_CAP_PCT=0.12;
|
||||
const SPORTS_FAVORITE_MIN_ENTRY=0.03;
|
||||
const SPORTS_FAVORITE_MAX_ENTRY=0.97;
|
||||
const SPORTS_FAVORITE_TARGET_LEAD_HOURS=72;
|
||||
@@ -1995,8 +2022,9 @@ function compactSuggestionForSync(s){
|
||||
trade_ready:s.trade_ready,entry_candidate:s.entry_candidate,audited_observation_only:s.audited_observation_only,
|
||||
adaptive_promotion:s.adaptive_promotion,adaptive_probation:s.adaptive_probation,
|
||||
probation_exit_hours:s.probation_exit_hours,promoted_for_agents:s.promoted_for_agents,watch_only:s.watch_only,jump_risk:s.jump_risk,
|
||||
requires_live:s.requires_live,bundle_id:s.bundle_id,bundle_side:s.bundle_side,bundle_logic:s.bundle_logic,bundle_cost_per_unit:s.bundle_cost_per_unit,
|
||||
requires_live:s.requires_live,bundle_id:s.bundle_id,bundle_event_id:s.bundle_event_id,bundle_side:s.bundle_side,bundle_logic:s.bundle_logic,bundle_cost_per_unit:s.bundle_cost_per_unit,
|
||||
bundle_payout_per_unit:s.bundle_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,
|
||||
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,
|
||||
days_to_resolution:s.days_to_resolution,event_key:s.event_key,game_start:s.game_start,hours_to_start:s.hours_to_start,
|
||||
@@ -4075,7 +4103,7 @@ function openNegativeRiskBundle(p,cfg,s,stake,decision){
|
||||
category:s.category,opened_at:openedAt,url:leg.url||s.url||"",peer_note:"",entry_reason:s.rationale||"",net_edge:s.net_edge,evidence_score:1,evidence_source_count:0,
|
||||
friction:s.friction,chase_penalty:0,quality:"bundle-arb",strategy_version:SUGGESTION_ENGINE_VERSION,build_version:BUILD_VERSION,
|
||||
momentum_strength:0,signal_strength:1,signal_confidence:1,signal_type:"bundle-arb",price_change_1d:0,price_change_1w:0,
|
||||
days_to_resolution:s.days_to_resolution,jump_risk:false,bundle_id:s.bundle_id,bundle_name:s.event||s.question,bundle_leg_count:legs.length,
|
||||
days_to_resolution:s.days_to_resolution,jump_risk:false,bundle_id:s.bundle_id,bundle_event_id:bundleEventKey(s),bundle_name:s.event||s.question,bundle_leg_count:legs.length,
|
||||
bundle_payout_per_unit:s.bundle_payout_per_unit,bundle_net_profit_per_unit:s.bundle_net_profit_per_unit,requires_complete_bundle:true,
|
||||
learning_score:0,learning_confidence:0,market_learning_score:0,market_learning_confidence:0,learning_state:"priced-bundle",market_learning_state:"priced-bundle",
|
||||
historical_prior_score:0,historical_prior_confidence:0,historical_prior_features:[],historical_requires_promotion:false,
|
||||
@@ -4147,6 +4175,7 @@ function openPositions(p,cfg,rankedSugs,focus,decision,avoidMarketIds,peerStats=
|
||||
if(!Array.isArray(s.bundle_legs)||s.bundle_legs.length<2||!(Number(s.bundle_net_profit_per_unit)>0))return reject("bundle_integrity");
|
||||
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");
|
||||
return true;
|
||||
}
|
||||
if(s.signal_type==="sports-contest-no-pilot"){
|
||||
@@ -4219,7 +4248,9 @@ function openPositions(p,cfg,rankedSugs,focus,decision,avoidMarketIds,peerStats=
|
||||
const investable=Math.min(p.cash-eq*d.reserve,exposureGap,cycleBudgetRemaining);
|
||||
if(investable<50)break;
|
||||
if(s.quality==="bundle-arb"){
|
||||
const bundleStake=boundedStakeForRisk(eq,Math.min(eq*Math.min(d.maxFrac,0.04),investable),cfg,s);
|
||||
const eventCapacity=Math.max(0,eq*BUNDLE_EVENT_CAP_PCT-bundleEventExposure(p,bundleEventKey(s)));
|
||||
if(eventCapacity<BUNDLE_MIN_NOTIONAL){reject("bundle_event_cap");continue;}
|
||||
const bundleStake=boundedStakeForRisk(eq,Math.min(eq*Math.min(d.maxFrac,0.04),investable,eventCapacity),cfg,s);
|
||||
const bundle=openNegativeRiskBundle(p,cfg,s,bundleStake,decision);
|
||||
if(!bundle){reject("bundle_execution");continue;}
|
||||
cycleBudgetRemaining=Math.max(0,cycleBudgetRemaining-bundle.cost);
|
||||
@@ -6491,7 +6522,8 @@ 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,
|
||||
negativeRiskMinimumNetReturnPct:NEG_RISK_MIN_NET_RETURN*100,bundleEventCapPct:BUNDLE_EVENT_CAP_PCT*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,
|
||||
makerTouchSource:"Polymarket CLOB batch price history",makerOutcomeLimit:MAKER_OUTCOME_LIMIT,makerMinimumCohortAttempts:MAKER_MIN_COHORT_ATTEMPTS,
|
||||
@@ -7168,6 +7200,19 @@ function runEngineSelfTest(){
|
||||
[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,
|
||||
}));
|
||||
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}),
|
||||
].sort(compareBundleOpportunities);
|
||||
const eventCapBook=defaultPortfolio();
|
||||
eventCapBook.cash=8800;
|
||||
eventCapBook.positions=[
|
||||
{bundle_id:"dominance:dominance-test:held-a:held-b",bundle_event_id:"dominance-test",requires_complete_bundle:true,cost:600,value:600},
|
||||
{bundle_id:"dominance:dominance-test:held-c:held-d",bundle_event_id:"dominance-test",requires_complete_bundle:true,cost:600,value:600},
|
||||
];
|
||||
openPositions(eventCapBook,AGENTS.find(a=>a.id==="value"),[dominanceSuggestion],"All",{
|
||||
minConv:0,maxNew:1,maxFrac:0.04,reserve:0.10,targetExposure:0.60,learning:buildAdaptiveProfile(eventCapBook),marketLearning:{samples:0,pending:0,buckets:{}},
|
||||
},new Set(),{});
|
||||
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});
|
||||
@@ -7670,6 +7715,9 @@ function runEngineSelfTest(){
|
||||
rejectsVolatileMarket:makerPairCandidate(Object.assign({},makerMarket,{price_change_1d:0.12}))===null,
|
||||
},
|
||||
bundleArbitrage:{
|
||||
prioritizesReturnPerLockedDay:capitalEfficiencyOrder[0].bundle_event_id==="fast-event",
|
||||
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,
|
||||
usesMarketSpecificZeroFee:Boolean(zeroFeeBundleSuggestion&&zeroFeeBundleSuggestion.friction===0
|
||||
&&zeroFeeBundleSuggestion.bundle_cost_per_unit===0.95&&zeroFeeBundleSuggestion.bundle_net_profit_per_unit===0.05),
|
||||
appliesPublishedFeeCurve:bundleFeePerShare({rate:0.07,exponent:1,takerOnly:true},0.5)===0.0175,
|
||||
|
||||
Reference in New Issue
Block a user