← Blog

The Solana Deeds #10: What an indexer does about the minute it wasn't listening

A live indexer for two Solana exchanges, fed two ways. Stopped for a minute on Yellowstone gRPC, it came back and fetched the 5 swaps it had missed. Stopped for a minute on the free WebSocket, it came back with a note of 311 slots it couldn't vouch for. Why one exchange needs the first, and two numbers that were wrong along the way.

Nissan Dookeran10 min readSolanaCoding AgentsAgent Workflows

Picture two friends following a football match from home. One has the radio on and steps out for a minute. The other has a recorder running and steps out for the same minute. For Deed #10 we stopped an indexer for a minute on each of two streams. On one it came back and fetched the 5 swaps it had missed. On the other it came back with a note: 311 slots it couldn't vouch for.

The radio is live and it's free, and it won't say anything twice. When the first friend gets back, the match has moved on. The honest thing he can do is write it in his notebook: I missed a minute, and here is which one. His friend rewinds to where she left off and plays it forward. Her notebook has every goal, and none of them twice. A recorder like that usually costs money.

On Solana the match is a decentralised exchange, a DEX for short: a program where people trade one token for another. Each trade is a swap, and the pot of two tokens it trades against is a pool. The notebook is a Postgres database with one row for every swap. The service that fills it is an indexer. The radio is the standard WebSocket subscription, a connection the network keeps open and pushes news down. The recorder is a stream called Yellowstone gRPC, which can replay from any recent moment you name. Solana counts time in slots, a few every second, so that moment is a slot number.

For Deed #10 we built the indexer: a Rust service that reads swaps and new pools from two exchanges, Raydium and Meteora, as they happen, and shows them on a page in the browser. Deed #9 was about who controls a membership card after it has been handed out. This one is about what a service does with the time it wasn't listening.

There is a video of six and a half minutes, and the source is public with the saved output of every run. The indexer only reads. It holds no key and sends nothing.

Why wasn't the recorder the plan on mainnet?

Before anything was built, Claude compared the ways to feed an indexer and recommended Yellowstone gRPC, because replay is one field in the request. Then it tried my Helius key, which is on the free plan. Mainnet gRPC answered "Unsupported plan type". Devnet gRPC streamed. The standard WebSocket log subscription worked on mainnet.

The Helius plan that includes mainnet gRPC was 499 dollars a month. I didn't buy it. Claude proposed building the recorder on devnet, Solana's test network, and adding the free WebSocket on mainnet as a second source. I said yes to both.

What does a minute away cost on each stream?

Both runs follow one routine: run for two and a half minutes, stop for one, run again. Afterwards a script compares the database with the chain's own list of the program's transactions, read over ordinary RPC and not from the stream. The figures below are from 2 December 2026, in a fresh Ubuntu container.

The recorder, on devnet: 44 swaps. The 39 that arrived live were all stored within five seconds of their block, half within 1.4 seconds, the slowest in 2.3. The other 5 happened while it was stopped. It asked for a replay and got all five, marked as backfilled. The chain lists 44 successful transactions for the program in those slots, and 44 are stored, none twice.

The replay works because the indexer remembers the last slot the network confirmed. On reconnecting it asks for everything from 32 slots before that. Each row is identified by its transaction's signature and the position of the swap inside it, so the overlap is recognised and stored once.

The radio, on mainnet, where Raydium is much busier: 645 swaps. Latency was measured on 642 of them, half within 1.1 seconds, the slowest in 2.1. Then the minute. The indexer recorded slots 476506534 to 476506844 as a gap and showed it on the page. It marked 0 rows as backfilled and made none up. That gap is wider than what was lost: it starts a little before the last slot seen, so some rows inside it are present.

While it was connected it missed nothing the chain lists. 413 listed transactions had no row; the script fetched each one, and none held a swap of the program. Along the way the indexer counted and skipped 458 transactions that name the program without running it, 108 that failed, 17 with no swap event and 12 whose log the node had cut short. A cut log is where a swap could hide, and this source cannot tell.

So the two were about as fast as each other, each on its own network. They were never run side by side. What separates them is the minute.

Why can't the radio hear Meteora?

Claude got this wrong first. Meteora's documentation says its swap event carries the pool, the direction and the amounts, and not the two tokens. So the plan had a lookup for the tokens, and a scenario for what happens when that lookup fails. I confirmed the scenario. Then Claude read the program's interface file and real transactions: the swap instruction lists both tokens among its accounts. There was no lookup to fail. It stopped and asked, and I agreed a new wording.

What Meteora does cost is the radio. A transaction is a list of instructions. While a program carries one out it can call other programs, or itself, and those calls are recorded as inner instructions. A program can also print lines to the transaction's log. So there are two places it can leave a note about what it just did.

Back to the match. The log is the commentary and the instructions are the referee's match sheet. Raydium shouts every goal into the commentator's microphone: each swap is a line in the log. Meteora says nothing and writes the goal on the match sheet: each swap is an inner instruction the program sends to itself. The radio only carries the commentary. Asked to read Meteora from the WebSocket, the indexer refuses to start: "meteora-damm-v2 cannot be read from websocket-logs: it writes its events as inner instructions, which a log does not carry".

Drawing from the video: two transactions side by side. In Raydium's, the swap is in the commentary, the log, and a radio below it has a tick: "hears every swap". In Meteora's, the swap is on the match sheet, as an inner instruction, and the log says "silence"; the radio below it has a cross: "hears none". A recorder between them takes in both whole transactions.

To check the Meteora decoder without a key, Claude fetched 500 real transactions from the public endpoints, 300 from devnet and 200 from mainnet, and compared each swap row with what the pool's two vaults gained and lost. 220 swap rows in 218 transactions. 217 matched exactly. The other was out by 147: a referral's fee, paid from the same vault as the trade. The row reports what the trader got.

On devnet both exchanges then ran through one indexer on the recorder: 63 swaps in ten minutes, 44 from Raydium and 19 from Meteora, none missed.

Raydium had its own trap. It has another program, its concentrated-liquidity one, whose swap event begins with the same eight bytes as the one we index. One mainnet transaction in the capture holds both. A reader that matches on those bytes stores three swaps from it. The indexer reads an event only while the indexed program is the one running, and stores two. Claude found that by accident: its test expected three.

What did a clean machine find that two days of runs hadn't?

Before the video I asked for the README to be followed on a machine that had never seen the project. Claude ran it in a new Ubuntu 24.04 container with only the listed prerequisites.

The first run failed at cargo test: "linker cc not found". The README didn't list a C compiler. The build machine has always had one.

The second fault was a race. The mainnet run didn't start: "the database system is shutting down". The health check for Postgres asked over a socket, and the Postgres image runs a temporary server on that socket while it sets a database up for the first time. The check could pass on the temporary one. On the build machine that happened 2 times in 12 first starts, which is how two days of runs never met it. Asked over TCP instead, it was 0 in 12.

Which numbers were wrong?

Two, and I was given both.

Claude turned slot counts into time at 0.4 seconds a slot. It never measured that, and said so on the page. It told me one sample of Meteora's traffic spanned 4.8 hours on devnet and 73 seconds on mainnet. Measured from the runs, a slot was 0.245 seconds on devnet and 0.216 on mainnet. The samples spanned about 2.9 hours and 39 seconds.

The other was the price. The video's script and the comparison page both gave 499 dollars a month as what the recorder costs on mainnet. That is one provider's plan. I asked for other providers to be named in the video, so Claude read their pages. QuickNode puts a Yellowstone-compatible stream in a plan at the same price. Alchemy sells one at 75 dollars a terabyte with no monthly minimum. Triton, who maintain Yellowstone, are pay as you go from a 50 dollar deposit. None of those was used here, and nobody counted the bytes this indexer's stream delivers, so I can't say which is cheapest.

Which one would I pick?

On the test network, the recorder: Helius's free plan streamed it. On mainnet with money to spend, the recorder again, though here that rests on providers' pages and not on a run. With no money, the radio works if the swaps you want are in the log, as Raydium's are, and if the notebook is honest about the gaps. If you need Meteora, or new pools, you need whole transactions, and that means the recorder. For whoever is building an indexer that is arithmetic and trade-offs, not advice about money.

What does it leave out?

The runs were ten minutes or less, on two days, with one provider's free key. Every stop was the process being stopped; no drop made by a provider was seen. A webhook source was planned and dropped without being built. Two of each program's three ways to open a pool turned up in no transaction we captured, and are tested on made-up ones. Nobody but the coding agent reviewed the code, and nothing has been audited.

The source has a script that repeats both runs with a free key and prints what held.