Skip to content

feat: implement risk drift detector, APY dispersion explorer, stress matrix, and strategy candidate queue#449

Open
aadviksinghdebug wants to merge 1 commit into
edehvictor:mainfrom
aadviksinghdebug:main
Open

feat: implement risk drift detector, APY dispersion explorer, stress matrix, and strategy candidate queue#449
aadviksinghdebug wants to merge 1 commit into
edehvictor:mainfrom
aadviksinghdebug:main

Conversation

@aadviksinghdebug
Copy link
Copy Markdown

Closes #382 - User Risk Preference Drift Detector
Closes #380 - APY Dispersion Explorer Across Providers
Closes #381 - Dynamic Strategy Guardrail Stress Matrix
Closes #364 - Strategy Candidate Queue Prioritization System"

Issue #382 - User Risk Preference Drift Detector:

  • Detect when portfolio behavior drifts from stated risk preference (conservative/balanced/aggressive)
  • Three drift dimensions: concentration, volatility, and liquidity
  • Each preference has defined thresholds (e.g., conservative: max 25% concentration, max 8% volatility, min $500k liquidity)
  • Early return for empty portfolios (no drift)
  • Dashboard indicator component showing per-dimension drift status with visual warnings
  • 12 tests covering all preference profiles and edge cases
    Issue APY Dispersion Explorer Across Providers #380 - APY Dispersion Explorer Across Providers:
  • Compute full statistical dispersion (mean, median, range, variance, std dev, CV) from multiple provider APY inputs
  • Classify dispersion into low/moderate/high/critical levels with configurable CV thresholds
  • Generate confidence signals (high/reduced/low/warning) based on dispersion + provider count
  • Per-source deviation from mean for transparency
  • Warning messages at moderate/high/critical levels
  • Dashboard panel component showing statistics, per-source breakdown, and confidence signal
  • 10 tests covering low/high/critical dispersion, empty inputs, config updates
    Issue Dynamic Strategy Guardrail Stress Matrix #381 - Dynamic Strategy Guardrail Stress Matrix:
  • Six predefined stress scenarios: liquidity-crisis, oracle-manipulation, trust-collapse, confidence-crisis, multi-factor-meltdown, mild-downturn
  • Stress factors (liquidity, trust, confidence, oracle) mapped to guardrail context (concentration, slippage, liquidity, market pause)
  • Evaluates all enabled guardrails under each scenario
  • Reports per-scenario activation summary with pass rate and status
  • Global matrix summary with most-triggered guardrails
  • Supports custom scenario add/remove and config updates
  • Deep copies scenario data to prevent shared mutable state
  • 12 tests covering scenario management, guardrail activation, and accuracy
    Issue Strategy Candidate Queue Prioritization System #364 - Strategy Candidate Queue Prioritization System:
  • Rank candidates using weighted scoring: expected upside (40%), confidence (35%), urgency (25%)
  • Configurable weights, max queue size, and minimum priority threshold
  • Starvation prevention: urgency score boosted for candidates waiting beyond TTL
  • Low-quality candidates rejected when queue is full (evicts lowest priority)
  • Duplicate detection (by ID) prevents re-enqueue
  • Approval pipeline: next-for-processing, approve, reject with reasons
  • Qualification gate (minimum score 6) filters low-quality candidates
  • Queue state tracking: enqueued/processed counts, wait times, starvation count
  • 18 tests covering ordering, starvation prevention, approval pipeline, deduplication
    Infrastructure:
  • REST routes at /api/risk (drift, dispersion, stress-matrix) and /api/queue (candidates)
  • All routes registered in server/src/app.ts
  • 52 tests total passing across all 4 services
  • Zero lint errors in new files
  • Advisory-only drift detection (no auto-action), read-only stress analysis, queue prioritization preserves safety evaluations"

@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

@ritik4ever is attempting to deploy a commit to the Edeh Victor's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 26, 2026

@aadviksinghdebug Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@edehvictor
Copy link
Copy Markdown
Owner

@aadviksinghdebug Kindly resolve conflict

@edehvictor
Copy link
Copy Markdown
Owner

@aadviksinghdebug Kindly resolve conflcit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants