EtherFi Portfolio Manager: Our Journey

Inspiration

DeFi is powerful—but terrifyingly complex. We noticed friends struggle with questions like:
“Should I stake my ETH with EtherFi or use a vault?”
“Which option offers the best risk-adjusted return?”

The problem wasn’t just technical—it was decision paralysis.
We wondered: What if everyone could have a personal AI investment board?

That question inspired the EtherFi Portfolio Manager.
We built three AI brokers, each with unique investment philosophies:

  • Conservative Broker – Focus on capital preservation
  • Balanced Broker – Optimize risk–reward tradeoffs
  • Aggressive Broker – Pursue maximum returns

They debate, vote, and form a consensus—just like a real financial advisory committee.
We chose EtherFi because of its growing liquid staking ecosystem, vault products, and real yield opportunities.


What We Learned

1. Prompt Engineering is an Art

We learned that vague prompts like:

You are a conservative advisor. Give portfolio advice.

led to random results.
Our final prompt was precise and constraint-based:

You are the Conservative Broker. 
Keep β ≤ 0.7, avoid assets with <6 months history, and limit drawdown ≤25%.

This level of specificity made Claude AI behave predictably and intelligently.

2. Multi-Agent Consensus

We used three brokers and computed a weighted recommendation:

[ R_{final} = w_c R_c + w_b R_b + w_a R_a ]

Weights change by user risk profile:

  • Conservative: ( (0.6, 0.3, 0.1) )
  • Moderate: ( (0.2, 0.6, 0.2) )
  • Aggressive: ( (0.1, 0.3, 0.6) )

This system taught us about multi-agent orchestration and how to prevent “groupthink” by ensuring independent analysis before debate.

3. Portfolio Mathematics

We applied Modern Portfolio Theory (MPT) for risk-adjusted performance.

Sharpe Ratio: [ S = \frac{R_p - R_f}{\sigma_p} ]

Portfolio Variance: [ \sigma_p^2 = \sum_i w_i^2\sigma_i^2 + \sum_{i \neq j} w_iw_j\sigma_i\sigma_j\rho_{ij} ]

It helped us understand why diversification across crypto and traditional assets improves stability.

4. Design & Transparency

Early users didn’t trust the system until we showed broker debates and vote breakdowns.
Once they saw how recommendations were made, trust skyrocketed.
We also unified traditional assets (stocks/bonds) with crypto holdings for a holistic portfolio view.


How We Built It

Architecture

USER (Streamlit UI)
    ↓
Python Backend → Claude AI (3 Brokers)
    ↓
EtherFi APIs + Market Data (APY, TVL, Risk Metrics)

Stack

  • Frontend: Streamlit, Plotly (interactive charts)
  • Backend: Python, Pandas, NumPy, Anthropic API
  • Integration: EtherFi protocol data + caching for real-time APYs

Each broker used structured prompts and debated independently before voting.
Consensus logic applied weighted averaging, and users saw final allocations with metrics like expected return, volatility, and Sharpe ratio.

We added a caching layer for EtherFi data to prevent API slowdowns and built a “demo mode” for live presentations.


Challenges We Faced

1. Inconsistent Broker Behavior

Initially, the “Conservative” broker sometimes suggested risky allocations.
Solution: Quantitative constraints (e.g., β ≤ 0.7, ≤35% per asset). Precision stabilized behavior.

2. Groupthink in AI Debates

Brokers started copying each other’s logic.
Solution: Forced independent reasoning → debate → final vote.
Each broker had to critique others before consensus.

3. Real-Time Data Issues

Fetching EtherFi data every load caused rate-limit errors.
Solution: Smart caching with time-to-live (APY: 5 min, TVL: 30 min) and fallback logic when APIs failed.

4. Math Edge Cases

Extreme portfolios (e.g., 100% ETH) broke variance calculations.
Solution: Numerical stability fixes and input validation for all weight sums and covariance matrices.

5. Transparency & Trust

Users wanted reasoning, not just numbers.
Solution: Exposed full broker debate logs, reasoning chains, and plain-English explanations like:

“Increase eETH by 10% for stable yield exposure while maintaining liquidity.”

6. Demo Day Failures

APIs crashed mid-demo rehearsal.
Solution: Implemented demo mode with pre-computed results and graceful fallback messages.


Key Takeaways

  • Prompt engineering = 80% of success – clarity beats creativity.
  • Multi-agent design adds diversity but requires independence rules.
  • Real-time data must balance freshness with reliability.
  • Transparency builds trust – always explain the “why.”
  • Progressive disclosure keeps UX simple yet powerful.
  • Iterate, test, and document relentlessly.

Future Scope

  • Live execution with DEX integration
  • Historical backtesting
  • Automated rebalancing
  • Tax-aware optimization
  • Custom broker creation for user-defined AI personalities

Built with ❤️ for the ASU Claude Builder Club Hackathon 2025
Making DeFi intelligent, transparent, and accessible for everyone.

Built With

Share this project:

Updates

Submission history