All projects

14 / Ventures & FinanceStock Market

Dendrite Financial

An AI engine that reads financial news, scores it and trades on it · Founder · May 2025 – Oct 2026

The idea

Project overview

Material company news, such as a drug approval, a large contract or a financing, moves small and mid-cap stocks sharply. Dendrite was built to trade that: a system that reads every article as it appears, uses a language model to score how material it is, and buys the strongest catalysts.

I founded Dendrite Financial and built it myself between May 2025 and October 2026: the scrapers, the LLM pipeline, the broker integrations, a web portal with a question-answering agent, and finally the survivorship-free backtest of the whole idea.

That backtest gave a clear result. The model ranks news correctly, and the market prices a public headline within minutes. The constraint is speed, not judgment, so the signal is not tradable after costs from a pipeline that takes one to four minutes. This page covers both the system and that result.

The company is no longer active and trading is paused. Scoring prompts, thresholds and trading rules are not shown.

What I built

System components

  • Web scraping

    Scrapers and feed clients

    Scrapers and feed clients that pulled headlines and full articles from a news aggregator, three press-release wires and a push news feed, de-duplicated them and stamped every stage with a time.

  • AI analysis

    Multi-step LLM scoring

    A multi-step LLM pipeline that classifies each article, finds every company in it, matches each one to a ticker and scores it from −10 to +10 with a written reason.

  • Trading

    Broker order routing

    Order code against the Interactive Brokers and Schwab APIs: timed entries, same-day exits, trailing stops and streaming quotes. Run on paper, then live with small capital in 2025.

  • Agentic RAG

    Database question answering

    A tool-calling agent that answers questions about companies, sectors and the market by searching the scored-news database itself, checking each article for relevance and citing its sources.

Interactive · the pipeline

Pipeline stages by engine generation

The demo shows articles moving through the engine. Switching between the three generations shows how the stages, the models and the latency changed with each rebuild.

01 · Scrape

News aggregator, polled every 15 s before the open

    02 · Read

    Waiting for a headline

      03 · Score

      –

      04 · Trade

      Articles read0

      Signals sent0

      Latency1 – 4 minheadline to score, measured against minute bars

      Illustration only: fictional companies, tickers, headlines, scores and orders. The stage names, models and latency figures for each engine are real. Only the first engine sent orders; the second and third stored scores and never traded.

      01 · Web scraping

      News collection methods

      The first two engines scraped a financial news aggregator: fetch the page, parse the headline table, diff it against the previous snapshot, then download each new article from its publisher and extract the body text. It was free and broad, covering about 170 publishers, but second-hand. About 21% of article fetches failed on paywalls and bot blocks, and the aggregator kept no true publish time.

      The third engine read the sources directly: conditional-GET polling of three press-release wires every 5 to 10 seconds and a push news feed over a websocket, in a single asyncio process with eight parallel fetchers. Every article carries four timestamps (published, received, body fetched, scored), so latency is measured, not estimated.

      Latency is headline to score for engine 1 (measured against minute bars), article text saved to analysis saved for engine 2, and received to scored for engine 3.
      EngineActiveSourcePollModelsStorageLatencyTraded
      Engine 1Jun – Oct 2025News aggregator, pre-market only15 sGemini 2.5 Flash gate, Gemini 2.5 Pro scoreCSV and text logs1 – 4 minPaper and live
      Engine 2 · NyxNov – Dec 2025Aggregator stock and market feeds, 24 hours60 sLocal gpt-oss:20b, then Gemini 2.5 FlashCSV database, REST API24 s medianNo
      Engine 3 · Nyx v3Oct 2026Three press-release wires and a push news feed5 – 10 sLocal gemma4SQLite3.1 s medianNo
      Engine 3 · median lag from the source’s own timestamp to receipt · seconds
      • Newsfile wire16 s
      • Push news feed38 s
      • GlobeNewswire96 s
      • PR Newswire116 s

      Once received, the engine needed a median 3.1 s to fetch, resolve tickers and score (90th percentile 17.8 s).

      Collected data volumes

      Engine 1 article texts
      26,111
      Engine 1 LLM analyses
      23,571
      Engine 2 database rows
      29,312
      Engine 2 publishers seen
      170
      Engine 2 company scores
      42,464
      Engine 3 articles collected
      74,781
      One-minute price files, all US tickers
      87 days
      Daily price rows in the backtest
      1.65 million
      • De-duplication

        Duplicate article handling

        Engine 3 de-duplicates by URL or by normalized title within 48 hours, and records every extra sighting with its source and time, which shows which feed was first.

      • Ticker resolution

        Ticker extraction sources

        Symbols come from the feed’s own tags (27,796 articles), exchange tags in the wire text (12,281) or the body (2,023), each validated against a list of real symbols. 32,676 articles with no US ticker were skipped.

      • Spam filter

        Law-firm “investor alert” filter

        10.5% of ticker-resolved wire articles were law-firm solicitations. They score very negative (−5.9 on average against +0.94 for the rest) without being news, so a tested filter flags them.

      02 · AI analysis

      Scoring rubric and pipeline steps

      Every score is a zero-shot judgment from a prompted, pretrained LLM. The rubric asks three things: how material the news is, with ±10 reserved for events on the scale of a merger, a bankruptcy or a first drug approval; a separate score for each company in the article, so a product launch can be positive for one firm and negative for its competitor; and timeliness, with recaps of old news scored zero.

      The second engine split the work into four steps to control cost. A local 20-billion-parameter model classified each article as stock, sector or market news, extracted up to three companies and verified their tickers, escalating to the cloud only when its own confidence was low (2.8% of articles). Only the final analysis went to Gemini 2.5 Flash. Of 29,312 articles it sorted 24,121 as stock news, 2,802 as market news and 2,389 as sector news across 31 sectors.

      1. 01

        Classify

        Stock, sector or market. Local model, first 5,000 characters.

      2. 02

        Extract

        The top three companies, or the sector, from 10,000 characters.

      3. 03

        Verify tickers

        Known map, exact match, fuzzy match over the top 50 candidates, then an LLM judge.

      4. 04

        Analyze and score

        Up to 30,000 characters read; one score and one written reason per company.

      Local model calibration against the cloud model

      Before building the third engine I ran a calibration to test whether a free local model could replace the cloud one: 791 articles the cloud model had already scored, re-scored by five local models on one consumer GPU. Each was compared with the cloud scores and, more importantly, with the stock’s subsequent return.

      Agreement is the Spearman rank correlation with the cloud model’s scores. Market fit is the rank correlation of score with the stock’s excess return to the entry-day close, on 490 outcome-stratified articles; the interval is the 95% bootstrap range of each model’s difference from the cloud model. Every interval spans zero: no local model is statistically distinguishable from the cloud one.
      ModelSeconds per articleAgreementMarket fitDifference, 95% intervalAUC, large up-move
      Gemini 2.5 Flash (cloud reference)–10.142–0.616
      gemma4:26b (chosen)1.530.9130.152−0.050 to +0.0620.616
      gemma4:12b1.150.8890.159−0.044 to +0.0780.639
      qwen3.6:35b2.190.8880.175−0.039 to +0.0950.627
      qwen3.5:9b1.200.8830.122−0.074 to +0.0280.606
      gpt-oss:20b1.030.8560.124−0.065 to +0.0290.589
      • 0.913Rank agreement between the chosen local model and Gemini 2.5 Flash
      • ≥ 99.9%Of local-model responses were valid JSON against the schema
      • 95 – 97%Of scores within ±1 when the same articles were re-scored: the run-to-run noise
      • 9×Slower with the model’s reasoning mode on, for no significant gain in market fit
      03 · Interactive · agentic RAG

      Tool-calling retrieval agent

      To make the scored database queryable, I built a retrieval-augmented agent on Gemini 2.5 Pro with function calling for the investor-relations portal. The model is not handed a fixed set of search results. It decides which tool to call and with what arguments, reads what comes back, and can call again, up to five loops per question.

      Retrieval has a second model in the loop. The search tool filters the database by date, category, sentiment and ticker, then a local “inspector” model reads each candidate article and returns match or reject against the question’s criteria, so only verified documents reach the reasoning model. Select a question to follow the trace.

      Example questions

      Reasoning model
      Gemini 2.5 Pro, temperature 0
      Tools
      search_database, get_market_stats
      Tool loops
      Up to 5 per question
      Inspector
      Local gpt-oss:20b, one article at a time
      Per search
      30 articles by default, 60 at most

        Illustration only: fictional questions, companies, articles, scores and answers.

        04 · Trading

        Order execution and broker integration

        The first engine ran as seven cooperating processes connected by queues: a producer watching the feed, four analysis workers, a trading worker and a logger. When an article’s score cleared the bar and its ticker was verified, the signal went to the trading worker, which checked available cash, a live quote and a minimum share price before sending an order.

        I wrote execution against two brokers. On Interactive Brokers, through the Trader Workstation API: limit orders before the open, market-on-close exits, pegged orders and trailing stops, first on a paper account and then live. On Schwab, through the Trader API: OAuth, REST orders, scheduled liquidation and a Level-1 quote stream for every signal ticker. A Discord bot posted every analysis and a high-catalyst alert for each signal.

        Backtest · event study

        Event study results

        In October 2026 I tested every score the engines had produced with an event study: for each signal, the stock’s return minus the S&P 500 ETF over the same window, from the overnight gap out to six months. Select a score bucket.

        • Engine 1 · Jun – Oct 2025
        • Engine 2 · Nov – Dec 2025

        Score-10 news shows a large positive overnight gap, no significant open-to-close move, and a reversal over six months.

        Show this as a table
        BucketSamplenOvernight gapOpen to close5 sessions21 sessions63 sessions126 sessions
        Score 10Engine 1792–798+8.4% (t 4.5)-0.3% (t -0.4)+0.4%-0.7%-3.8% (t -1.8)-11.1% (t -4.8)
        Score 10Engine 255+4.3% (t 3.2)+0.8% (t 0.4)+3.9%-2.0%-5.1%-10.0% (t -2)
        Scores 9 – 10Engine 11,101–1,108+7.4% (t 5.4)0.0% (t -0.1)-0.2%-0.7%-2.5% (t -1.3)-9.6% (t -4.3)
        Scores 9 – 10Engine 2362–363+3.8% (t 3.5)-0.2% (t -0.6)-0.5%-0.3%+0.6%+6.4% (t 1.3)
        Scores −8 to −10Engine 1313-2.9% (t -3)0.0%+2.2% (t 1.9)+3.7% (t 2.5)+6.4% (t 1.9)+6.7%
        Scores −8 to −10Engine 2589–594-0.7% (t -1.4)+1.1%-1.5% (t -2.4)-1.4%-7.1% (t -4.3)-5.8% (t -3.4)
        Control: −2 to +2Engine 12,0720.0%0.0%-0.1%+0.7%+0.6%-0.2%
        Control: −2 to +2Engine 23,673+0.1%+0.2%+0.3%+1.6% (t 3.3)+1.0%-0.9%

        Backtest. Mean return minus SPY over the identical window, first signal per ticker per day. The overnight gap runs from the prior close to the next open; every other horizon starts at that open. The gap is not tradable on news that arrives before the open: it is the move the score describes. Labels show values with a date-clustered t-statistic of at least 2 in size.

        Intraday price path around the score

        One-minute bars for the first engine’s pre-market signals show when the move occurs. The chart is the average price of a score-10 stock, relative to the prior close, around the moment its score was ready.

        Remaining move by entry point

        Already in the price+7.4%

        Remaining to the open−0.6 pts

        Remaining to the close−1.4 pts

        Backtest on one-minute bars: 802 score-10 signals from the first engine. Mean return against the prior close; “remaining” is the difference between two points on that average path, in percentage points, before any trading cost. In the same data, buying the first pre-market print after the score and selling at the open returned −0.47% on average for 9 – 10 names before costs.

        Two line charts of mean and median return against prior close by minute around the analysis timestamp, for score buckets 10, 9, 8, 7, a control group and strongly negative scores. Positive buckets jump in the five minutes before the timestamp and then flatten or drift down.
        Every positive bucket jumps in the minutes before the score is ready, in order of score; the control group does not move
        A histogram of the share of the overnight gap already printed at detection for 440 signals, with a median of 76 percent, and a bar chart of the return from a fill two minutes later to the open by detection hour, all negative.
        Left: share of the gap already printed when scoring finished, median 76% (440 signals). Right: return from a fill two minutes later to the open
        • 76%Median share of the gap already printed at the score, for 9 – 10 names gapping over 3%
        • 70%Already printed even for articles the feed listed as two minutes old or less
        • −0.04%Mean open-to-close return against SPY for 9 – 10 names (1,108 events)
        • 66%Of score-10 names would hit a 2% stop, mostly in the first minutes of trading
        Backtest rigor

        Backtest design

        • Data

          Survivorship-free price data

          Daily prices include delisted companies, 2.1% of all signals. A symbol resolver catches renamed tickers and symbols later reused by a different company, checking the company name on every match.

        • Timing

          Look-ahead prevention

          Every signal maps to the first open or close after the moment its score existed, enforced by assertions in the code. The signal time is the end of the model call, not the headline time.

        • Statistics

          Uncertainty estimation

          Standard errors clustered by date, 95% intervals from a 2,000-draw bootstrap over dates, and a permutation test that shuffles scores within each day 1,000 times.

        • Simulator

          Simulator validation

          The event-driven portfolio simulator must reproduce buy-and-hold SPY to nine decimal places before any strategy result is accepted.

        • Costs

          Costs and capacity

          10 basis points per side and 5% a year to borrow shorts. Median daily turnover of the top-scored names was $46 million.

        • Discipline

          Multiple-testing disclosure

          Roughly 33 portfolio cells, 55 event cells per period, a 16-row stop grid and a 36-row pre-market grid were run, so every t-statistic is reported as descriptive, not as proof.

        Timeline and hardware

        Project timeline

        1. May 2025

          First article logs from the first engine.

        2. Jul 2025

          First live trades with small capital through Interactive Brokers.

        3. Aug – Sep 2025

          Paper account: 2,186 executions over 13 trading days. Schwab integration with streaming quotes.

        4. Nov 2025

          Nyx goes live: 24-hour collection, a four-step hybrid LLM pipeline, a REST API, a web portal and the RAG agent.

        5. Dec 2025

          Nyx stopped after 29,312 scored articles.

        6. Oct 2026

          Survivorship-free backtest and minute-bar study. Nyx v3 built on direct wires and a local model, chosen by calibration.

        Everything ran on one workstation: an Intel i9-14900K, an NVIDIA RTX 5070 Ti with 16 GB and 96 GB of memory. Backtest and simulated figures are labelled as such. Past performance does not predict future results. Nothing here is investment advice.