A Tiny News Machine
I wanted a project that feels like a desk toy for market structure: feed it a headline, watch hardware light up, get a tiny reaction packet back.
The input is one plain news line. The output is three numbers: BTC, SP500, and the 10-year yield move in basis points. The code is intentionally small enough to read without needing a semester of hardware lore.
The fun part is the split. A cheap CPU prepares a fixed-size packet. The FPGA sits there already running, compares tiny text signatures in parallel, and writes the reaction vector back.
The story is the conversion: messy text becomes a structured packet that another pricing or risk model could use. The FPGA is the tiny event router in the middle.
The Pipeline
One headline goes through a tiny assembly line. Nothing fancy is hidden here: text in, fixed packet, hardware trigger map, reaction out.
01
news line
a headline arrives as plain text
02
cheap CPU
lowercase, trim, pad to 256 bytes
03
FPGA
compare 1024 tiny signatures in hardware
04
packet out
BTC, SP500, US10Y bps
Try A Headline
The dots are not the final answer. They are raw signature hits. The FPGA groups those hits into an event, then maps the event to a bps shock vector.
news line
a headline arrives as plain text
cheap CPU
lowercase, trim, pad to 256 bytes
FPGA
compare 1024 tiny signatures in hardware
packet out
BTC, SP500, US10Y bps
incoming headline
Stablecoin loses its peg as USDC liquidity dries up
1. Signature bits
raw hits
2. event gate
Stablecoin depeg
stablecoin_depeg
Threshold is 3. This event fires because 4 is enough.
shock lookup
stablecoin_depeg -> [-85, -8, -2]
3. hardware output
The final packet is just three signed integers. A downstream model can consume this immediately.
What Happens On The FPGA
After the CPU writes the packet, the FPGA owns the hot path: compare windows, set bits, count event hits, add bps shocks, write the packet.
inside the FPGA
Think of it as a tiny factory line
The FPGA is a custom machine for this one path. A packet enters from the left. Each station does one small job. At the end, three numbers come out.
headline bytes
The FPGA receives a fixed packet
By the time the headline reaches the board, the CPU has already cleaned it into lowercase text and padded it to 256 bytes.
Why This Shape Is Fast
The speed is less about magic and more about removing the usual software mess from the hot path.
why fast
No variable shapes
The kernel always sees 256 bytes, 1024 signatures, 32 output words, and 3 reaction integers.
why fast
Simple integer work
A trigger is just a 32-bit compare. No heap, no parser, no floating point, no giant runtime.
why fast
The kernel stays warm
The CPU does not launch the FPGA for every headline. The FPGA loop is already alive and waiting.
why fast
Tail latency is calm
The path is repetitive. Repetitive hardware is nice when p99 matters more than a cute average.
KV260 run
How fast it ran
one news line, persistent FPGA kernel
what the code owns
CPU
load headline, normalize text, send one fixed 256-byte packet
FPGA
scan 1024 signatures, set trigger bits, sum BTC/SP500/10Y bps
Host C++
keep the kernel alive, move buffers, check FPGA output against CPU reference
Did The FPGA Actually Help?
For this small router, yes. The useful comparison is against the CPU on the same KV260 board, not a giant desktop machine.
same board comparison
FPGA vs the onboard CPU
12 sample headlines, 5000 measured runs
On this board, the hardware route is about 55x faster at p50 than the simple ARM CPU reference. The reason is pleasantly boring: the job is fixed-size, repetitive, and already sitting in a warm kernel loop.
A Bit More Technical
These are the concrete shapes that make the CPU/FPGA handoff simple enough to reason about.
technical shape
The whole contract fits on a napkin
the CPU and FPGA agree on these sizes
why I like it
I like this project because it is small enough to hold in your head. A headline goes in, a tiny board does real work, and a packet comes back fast enough that the number feels alive. It has C++, hardware, latency, and just enough market flavor to make the whole thing fun.