Inspiration
Traditional portfolio risk tools suffer from Gaussian return assumptions, failing during systemic "fat-tail" crises. Doomsday Rapid Agent replaces static risk haircuts with a real-time, adversarial threat simulator that evaluates macro-grounded geopolitical risks and computes their cascading impacts on enterprise valuation in under 60 seconds.
What it does
The application stress-tests enterprise value in a high-chaos sandbox:
Chaos Calibration: Evaluates a target ticker under a Global Chaos Index ( C \in [0.0, 1.0] ) and Risk Severity ( S \in [1.0, 10.0] ). Adversarial Tribunal: A multi-agent swarm (Bear, Bull, and Black Swan Judge) debates macro risks retrieved from an Elastic MCP feed to reach a calibrated severity consensus. Spoke-and-Hub Geopolitical Map: Plots risk origins and transit blockades on an interactive Plotly Mapbox globe. Valuation Router: Automatically routes the company to one of 4 sector-specific valuation models to project distressed equity values.
How we built it
We built the interface with Streamlit, orchestrating Gemini 3 for structured multi-agent debate loops. We integrated OpenTelemetry via Arize MCP to export nested traces and latencies to Arize Phoenix.
The heart of the system is the Multi-Model Valuation Engine, which runs four distinct financial models:
- Mature Companies (FCF-DCF Model) Projects discounted cash flows under distress parameters:
Stressed Cost of Capital (WACC): $$ \text{WACC}{\text{stressed}} = (\text{R}{\text{f}} + \beta \times \text{ERP}) + C \times 4% \times \max\left(1, \frac{S}{5.0}\right) \times 0.8 $$ where risk-free rate ( \text{R}{\text{f}} = 4.3% ) and Equity Risk Premium ( \text{ERP} = 5.5% ). FCF Stress Adjustment: $$ \text{FCF}{t} = \text{FCF}{0} \times (1 - H{\text{rev}}) \times (1 - M_{\text{margin}}) \times (1 + g_{\text{stressed}} \times 0.93^{t-1})^{t} $$ where revenue haircut ( H_{\text{rev}} = C \times 30% ), margin compression ( M_{\text{margin}} = C \times 30% ), and stressed growth ( g_{\text{stressed}} = \max(-0.05, g_{\text{base}} - \frac{H_{\text{rev}}}{3.0}) ). Stressed Enterprise Value: $$ \text{EV}{\text{stressed}} = \sum{t=1}^{5} \frac{\text{FCF}{t}}{(1 + \text{WACC}{\text{stressed}})^{t}} + \frac{\text{TV}}{(1 + \text{WACC}_{\text{stressed}})^{5}} $$
- Financial Companies (P/BV + DDM + Excess Return) Since banks hold debt as operational inventory, we bypass DCF and blend book value, dividend discount (DDM), and excess returns:
Stressed DDM: $$ V_{\text{DDM}} = \frac{\text{DPS} \times (1 + g_{\text{div, stressed}})}{\text{CoE}{\text{stressed}} - g{\text{div, stressed}}} $$ where cost of equity ( \text{CoE}{\text{stressed}} = \text{CoE}{\text{base}} + C \times 4% ) and ( g_{\text{div, stressed}} = \max(0, g_{\text{div}} - C \times 8%) ). Excess Return Valuation: $$ V_{\text{Excess}} = \text{BVPS} + \frac{(\text{ROE}{\text{stressed}} - \text{CoE}{\text{stressed}}) \times \text{BVPS}}{\text{CoE}{\text{stressed}} - 1%} $$ where return on equity ( \text{ROE}{\text{stressed}} = \text{ROE}_{\text{base}} \times (1 - C \times 0.4) ).
- High-Growth Tech (EV/Revenue + Rule of 40) For early-stage tech, we adjust revenue multiples based on efficiency and model a Path-to-Profitability DCF:
Rule of 40 Score: $$ \text{Score} = (\text{Growth}{\text{YoY}} \times 100) + \text{Margin}{\text{EBITDA}} $$ Path-to-Profitability Value: $$ V_{\text{Path}} = \frac{\text{FutureRevenue} \times 20% \times (1 - C \times 0.5) \times (1 + 20 \times (1 - C \times 0.4))}{(1 + k_{e})^{5} \times \text{Shares}} - \text{NetDebtPerShare} $$ where discount rate ( k_{e} = 12% + C \times 6% ).
- Cyclical Companies (Normalized EV/EBITDA) Valued using mid-cycle normalized EBITDA to filter short-term commodity price volatility: $$ V = (\text{EBITDA}{\text{base}} \times (1 - C \times 0.5)) \times (\text{Multiple}{\text{base}} \times (1 - C \times 0.35)) - \text{NetDebt} $$
Challenges we ran into
The DCF Bank Breakdown: DCF models broke when evaluating financial institutions. We resolved this by building a router to classify sector profiles and route financials to P/BV and Excess Return engines. OTel Collector Latency: Synchronous telemetry exports blocked Streamlit's UI. We solved this by using background daemon threads to ship OTLP/Protobuf payloads asynchronously. Graceful Degradation: To support users running the app locally without API keys, we built fallback logic that streams trace data to an in-app console emulator.
Accomplishments that we're proud of
Decoupled Financial Engine: Formulated 4 customized valuation routes rather than relying on flat-rate risk haircuts. Dialectic Swarm Stability: The Bear-Bull-Judge tribunal mitigates single-agent bias to yield balanced risk scores. Live Telemetry Tracing: Real-time visibility into nested agent prompt spans, latencies, and token costs.
What we learned
Multi-agent dialectic debates yield significantly more stable risk metrics than single-turn prompts. Capital structure metrics (e.g., net leverage, cash buffers) are better stress indicators than market capitalization alone.
What's next for Doomsday Rapid Agent
Item 1A Auto-Parsing: Automated scraping of SEC EDGAR Item 1A Risk Factors via Elastic MCP. Indian Market Coverage: Native SEBI/BSE filing support to track cross-border currency and trade links. Portfolio Scenarios: Multi-asset portfolio stress correlation modeling.
Log in or sign up for Devpost to join the conversation.