You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix anchor price selection - prioritize anchor over method
The previous logic checked preferred method first, which could select
a wrong price even when anchor price was available. Now:
1. PRIORITY 1: Anchor price - if user confirmed a price, find closest
match (within 10% tolerance) across ALL candidates
2. PRIORITY 2: Preferred method - only used if no anchor match found
3. PRIORITY 3: Consensus voting
Also added debug logging to trace anchor price saving and retrieval.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
console.log(`[Voting] Found match for anchor price ${anchorPrice}: ${closestCandidate.price} via ${closestCandidate.method} (${(priceDiff*100).toFixed(1)}% diff)`);
console.log(`[Voting] Anchor price ${anchorPrice} too different from candidates (closest: ${closestCandidate.price}, ${(priceDiff*100).toFixed(1)}% diff), using consensus`);
1454
+
// No close match - price may have legitimately changed
1455
+
console.log(`[Voting] No candidate close to anchor price ${anchorPrice} (closest: ${closestCandidate.price}, ${(priceDiff*100).toFixed(1)}% diff)`);
1456
+
// Fall through to preferred method or consensus
1457
+
}
1458
+
}
1459
+
1460
+
// PRIORITY 2: If user has a preferred method and no anchor match, try that method
0 commit comments