Skip to content

cryptolover10k/Helm

Repository files navigation

Helm — AI × RWA on Mantle

Dynamic yield strategies and automated risk management for RWA assets (USDY, mETH) built on Mantle's RWA infrastructure.

Helm is an AI portfolio copilot for real-world-asset and liquid-staking yield on Mantle. It reads live on-chain and market data, computes a risk-budgeted target allocation across real Mantle yield venues, and runs automated risk management (peg health, concentration, liquidity, idle capital) on the book — with an AI engine (via OpenRouter) generating the strategy thesis and risk narrative.

Built for the Mantle Network hackathon — AI × RWA track.


What makes it real (no mock data)

Layer Source Used for
Mantle RPC (rpc.mantle.xyz, chain 5000) on-chain reads via viem USDY / mETH balances, total supplies, block height
Ethereum RPC mETH Protocol Staking 0xe3cB…9E8fmETHToETH() true mETH→ETH redemption rate (peg monitoring)
DeFiLlama yields.llama.fi 46+ live Mantle pools APY, TVL, APY volatility (σ), 90-day APY history
CoinGecko simple/price live USDY / mETH / MNT / ETH prices
OpenRouter OpenAI-compatible chat AI strategy thesis + risk narrative (optional)

Verified token contracts (checked on-chain via symbol()):

  • USDY (Ondo U.S. Dollar Yield, Mantle): 0x5bE26527e817998A7206475496fDE1E68957c5A6
  • mETH (Mantle Staked Ether, Mantle): 0xcDA86A272531e8640cD7F1a92c01839911B90bb0
  • mETH (Ethereum L1): 0xd5F7838F5C461fefF7FE49ea5ebaF7728bB0ADfa

Features

  1. Live RWA market board — USDY (Ondo T-bill note) and mETH (liquid staking) hero cards with real APY, TVL, on-chain redemption rate, and 90-day APY sparklines, plus a table of all live Mantle yield venues sorted by risk-adjusted APY.
  2. AI dynamic yield strategy — pick a risk appetite (Conservative / Balanced / Aggressive); a mean-variance-flavoured optimizer builds a position-capped allocation over real pools, and the AI explains the thesis + emits automated guardrails. Shows projected APY, delta vs current, projected risk score, allocation pie, and concrete rebalance actions.
  3. Automated risk management — deterministic, data-driven checks each refresh:
    • USDY NAV/peg — flags trading below accrued floor.
    • mETH ⇄ ETH peg — on-chain redemption rate vs secondary market price.
    • Concentration, idle-capital, and per-pool liquidity/volatility risk scoring.
  4. 100% real data, no mocks — connect an injected wallet (MetaMask/Rabby) or paste any Mantle address to watch — both read live balanceOf on-chain. With nothing connected the portfolio panel prompts you, while the strategy + market peg checks still run on real data, so the dashboard is never blank and never fabricated.

Risk model (transparent, deterministic)

Each pool gets a 0–100 risk score from real signals: asset-class baseline, liquidity depth (TVL), yield volatility (σ of daily APY), an excess-yield premium, and incentive dependence. The optimizer maximizes APY / (1 + λ·risk) subject to per-leg caps and a risk budget set by the chosen appetite. The AI layer explains these numbers — it never invents them.


Run it

npm install
cp .env.example .env        # optional — works without keys
npm run dev                 # http://localhost:3000

Public RPCs and DeFiLlama/CoinGecko need no API key, so the app runs out of the box in Heuristic mode. To turn on the AI engine, add an OpenRouter key to .env:

OPENROUTER_API_KEY=sk-or-...
OPENROUTER_MODEL=anthropic/claude-sonnet-4.6   # any OpenRouter model slug

The header badge shows AI engine live vs Heuristic mode; every AI output is tagged with its source and gracefully falls back to the deterministic engine on any error.


Architecture

src/
  app/
    page.tsx              Dashboard (client orchestrator)
    api/
      markets/route.ts    Live snapshot: prices + on-chain + pools + APY history
      portfolio/route.ts  Live on-chain balances for a wallet/watched address
      strategy/route.ts   Optimizer + AI thesis + rebalances
      risk/route.ts       Risk report + AI narrative
  lib/
    chain.ts              viem clients + on-chain reads (rate, balances, supply)
    datasources.ts        DeFiLlama + CoinGecko fetchers, snapshot assembly
    risk.ts               Asset classifier + deterministic pool risk scoring
    optimizer.ts          Risk-budgeted allocation + rebalance diffing
    riskreport.ts         Peg/concentration/idle automated checks
    ai.ts                 OpenRouter client + heuristic fallbacks
    portfolio.ts          Position valuation (mETH at on-chain redemption rate)
  components/             Dashboard UI (charts, panels, primitives)

Notes / disclaimer

This is a hackathon prototype for demonstration. Allocations and risk scores are informational only and are not financial advice. Always verify contract addresses against official Ondo and mETH Protocol sources before transacting.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors