Inspiration

Inspiration

Bittensor Subnet 88 penalizes duplicate portfolios: any two allocation vectors within an L1-normalized distance of 0.01 get scored down. Before this project, the only way to fix that was trial and error by hand. We wanted to see if WebMCP could let an agent actually close that loop — propose, measure, adjust, re-measure — instead of the app just saying "no."

What it does

Alpha Investing lets a human and an AI agent build the same Bittensor Subnet 88 portfolio on the same screen, sharing one state. It exposes 12 WebMCP tools covering the full workflow — query subnets, generate a portfolio from two ranking criteria, edit allocations, and save it. The centerpiece is escape_dedupe: when save_portfolio rejects a duplicate, the agent can call it to perturb weights until the portfolio clears the safety threshold, then save — all visible in a live Agent Activity panel.

How we built it

React 19 + Vite, entirely client-side — no backend, no real funds, simulated subnet data. WebMCP tools register via document.modelContext.registerTool (with a navigator.modelContext fallback, since the spec is still moving), sharing the exact same state and validation path as the UI buttons, so an agent can't bypass any rule a human can't. Tool descriptions were iterated against a real agent (Gemini, through Chrome's WebMCP testing flag) until it reliably found the escape_dedupe recovery path on its own.

Challenges we ran into

No WebMCP-native browser was available for most of development, so we built a debug bridge that mirrors every registered tool onto window.__webmcpTools, letting us call the exact execute() path a real agent would — on the real production build — before we ever had a WebMCP-capable browser to test in. Once we did get a live agent running, we found that bundling multi-step instructions into one prompt confused it into picking the same ranking metric for both portfolio groups; one natural instruction per turn fixed it. Getting the agent to autonomously reach for escape_dedupe, rather than just reporting the rejection, took a few rounds of sharpening the tool descriptions.

Accomplishments that we're proud of

The generate → save → rejected → escape_dedupe → save loop is verified working end-to-end on the live production deployment, not a simulation. A real agent correctly reconstructed multi-part portfolio criteria from natural language and self-recovered from a dedupe rejection without being told how. The WebMCP layer is fully additive — the app behaves identically for anyone on a browser without WebMCP support.

What we learned

Tool descriptions are a real interface, not documentation — wording (units, when to call a recovery tool, when to switch tabs) measurably changes what an autonomous agent does. Building a bridge to test real tool code independent of browser support was more valuable than trying to hand-simulate agent behavior.

What's next for alpha-investing

An Undo action wired into the Agent Activity panel, a compare_portfolios read tool, and highlighting the rows an agent just changed so the human/agent shared-state story is legible in real time, not just in the log.

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for alpha-investing

Built With

Share this project:

Updates

Submission history