Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 4 min read

I built a graph that traces how news ripples through the stock market

Every day there's a headline like "Fed keeps rates high" and everyone knows the obvious move: banks, bonds, whatever. But the moves that actually matter are the ones a few steps away. Rates stay high β†’ mortgages get more

Every day there's a headline like "Fed keeps rates high" and everyone knows the obvious move: banks, bonds, whatever. But the moves that actually matter are the ones a few steps away. Rates stay high β†’ mortgages get more expensive β†’ fewer people buy homes β†’ homebuilders like Toll Brothers feel it a few months later.

Nobody draws that chain out for you. So for Graph Hacks I built Ripple, which does exactly that.

Try it: https://ripple-beta-five.vercel.app
Code: https://github.com/IshanjotDhahan7868/ripple

What it does

You paste a headline. Ripple tells you:

  • which stocks are likely to rise or fall
  • roughly when (right away, in 3 months, in 6 months)
  • the exact chain behind every call, with a one-line reason on each step

Every ticker is clickable too. Open a stock and you see everything upstream that can push it up or down, past calls on it, and the stocks that move with it.

Why a graph?

Because the economy is a graph. Interest rates affect housing, housing affects lumber and banks, oil affects shipping and airlines, and so on. Trying to do this with a chatbot alone means it just makes stuff up that sounds right. I wanted every answer to come from something you can actually check.

So the economy lives in FalkorDB:

  • 79 Driver nodes: Interest Rates, Oil Price, Housing, AI Compute Demand…
  • 170 DRIVES edges between them, each with a weight, a confidence, a lag in months, a direction (push up or push down) and a sentence explaining why
  • 357 Asset nodes (stocks, ETFs, commodities) linked to the drivers they're exposed to

When a headline comes in, Claude does one small job: it picks which drivers the news is about and which way they're moving. That's it. It never writes queries and never names stocks.

Then FalkorDB does the real work with Cypher. It walks paths up to 4 steps out, multiplies weight Γ— confidence along the way so the push gets weaker the further it travels, multiplies the directions so "up" and "down" flip correctly, and adds up the lag so you get a "when". The whole thing comes back in a few milliseconds.

For stock pages it runs backwards: start at the ticker and walk upstream to find everything that can move it. I also use graph algorithms (PageRank and reach) to find the economy's pressure points, meaning the shocks that spread the furthest.

And there's a "show how this was worked out" button on every answer that shows you the exact Cypher queries that ran. No black box.

Does it actually work?

I didn't want to just claim it does, so I tested it.

I froze the graph in January 2026, then fed it 10 big real headlines from the months after. For each one it named 5 stocks and a direction. Then I checked what those stocks actually did over the next 20 trading days compared to the S&P 500.

  • 35 of 50 calls were right (70%)
  • random stocks on the same days: about 49%
  • 8 of the 10 events came out ahead overall

Honest caveats: 10 events is a small sample, and after only 5 days it's basically a coin flip. That makes sense to me, because knock-on effects take weeks to show up in prices. Every single call, right or wrong, is listed on the casebook page.

It runs by itself

This was my favourite part. Every 2 hours a GitHub Action wakes up, reads business news from RSS feeds, matches headlines to drivers with simple rules (no AI, so it costs $0), spins up a throwaway FalkorDB container, traces the ripple and saves the calls. Later it grades each call against real prices after 5 and 20 trading days.

Every few days I have Claude Code do a "checkup": it reads the robot's recent calls, finds misreads, teaches it new rules and withdraws bad calls before they get graded. Withdrawn calls stay on the public record, so nothing gets hidden.

What I learned

  • Graphs make AI honest. Once the AI's only job is "point at the right node", it can't hallucinate a stock. Everything after that is just data you can trace.
  • Cypher is perfect for this. "Walk up to 4 hops and multiply strengths along the path" is basically one query. Doing that in Python before was way more code.
  • Weighted path queries take some trial and error. Getting reduce() over relationships right took me a few tries, but once it clicked it was clean.
  • Test your own claims. Building the backtest changed how I wrote the whole site. I stopped saying "accurate" and started showing the actual numbers.

What's next

More drivers and stocks on the map, more history in the backtest, and letting the live robot build a real track record over the next few months.

If you try it, paste any headline you want and see where it lands.

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.