patternfetch / Methodology / Token-cost study
Study · measured · snapshot 2026-07-20What does raw OHLCV cost an LLM in tokens?
The homepage claims a brief is ~500 tokens of market state instead of 400,000 of raw candles. That belongs on a page that measures it, not one that asserts it. So we counted both — raw candles pulled from the Yahoo chart endpoint and the brief from the keyless /v1/demo — with a real tokenizer, across eight tickers and timeframes. The numbers below are honest, including the ones that complicate the claim.
8 tickers × TF120-candle windowYahoo + /v1/democl100k_baseas of 2026-07-20TL;DR — For the exact 120-candle window a brief summarizes, the raw candles are ~3,100 tokens as CSV and ~4,500 as JSON; the brief's actionable market-state read is ~300 tokens — a real but modest ~10–15× reduction. The dramatic figures on the homepage (~800×, ~400K, ~$6/call) only appear when the raw alternative is a large history: at ~25 tokens/candle, 400,000 tokens is ~16,000 candles, and against that the read is ~1,000× smaller. Two honest complications: the full keyless demo payload is ~12,300 tokens (it ships the candle codec plus base-rate evidence, larger than a single raw window), and the counts are from a GPT-family tokenizer. Beyond cost, published work shows large contexts also degrade answer quality — with caveats stated below.
An asserted number is not a measured one.
The original pitch for patternfetch is a compression argument: a ticker and a timeframe become a token-compact read, so a model never has to swallow a wall of candles. The site states it as ~500 tokens of market state instead of 400,000 of raw candles, roughly 800× fewer, at ≈$6 a call saved. Good marketing. But nowhere is it measured, and an unmeasured number is a liability the moment someone checks it.
This page checks it. We fetch both sides for real — the raw OHLCV a developer would pull from the Yahoo chart endpoint, and the finished brief from POST /v1/demo — and count the tokens of each with gpt-tokenizer (cl100k_base, the GPT-3.5/4 tokenizer), across eight tickers and timeframes. Where the claim holds, we show by how much. Where it is generous, we say so.
Two things make this worth publishing rather than burying. First, a page that measures a token cost is the kind of citable data asset that earns real references — which is the one growth lever that works beyond one person's own reach. Second, it carries the product's actual advantage without a sales voice: the number, checkable, is the argument.
The method, so you can repeat it.
For eight ticker/timeframe pairs — crypto and US equities, across daily and hourly — we did the same thing:
- The brief. POST /v1/demo {ticker, timeframe} (keyless, rate-limited). The demo always returns 120 candles of analysis, so 120 bars is the window every comparison is pinned to.
- The raw candles. The Yahoo chart endpoint for the same timeframe, sliced to the last 120 bars — the exact window the brief covers. We serialize them two ways a careful developer actually would: minimal CSV rows (time,open,high,low,close,volume) and a JSON array of rounded objects. Both are generous to the raw side; the untrimmed provider response is larger still.
- The count. Every string is tokenized with cl100k_base. We re-ran the headline figures through o200k_base (the GPT-4o tokenizer) as a cross-check — on this mostly-numeric content the two agree exactly.
- The rate. To project beyond one window we measured a per-candle token rate from large real pulls (up to ~3,500 candles): ~24.9 tokens/candle (CSV), ~36.9 (JSON).
One honesty note up front. cl100k_base is OpenAI's tokenizer. Claude and Gemini tokenize differently — Anthropic states its tokenizer yields somewhat more tokens for the same text — so treat the absolute counts as a GPT-family baseline. The ratio between raw candles and the brief is the model-independent result, and it barely moves between the two tokenizers we tried.
The same 120 candles, read as state, are ~10× lighter.
This is the like-for-like picture: how many tokens the model must read to know one market's state. The raw candles carry the same information; the read is the state extracted from them.
The per-ticker counts, so nothing hides in an average. Read is the actionable state; Full demo is the entire keyless payload (read + compact candle codec + base-rate evidence for every detected pattern).
| Ticker | TF | Raw CSV | Raw JSON | Read | Full demo | Read vs CSV |
|---|---|---|---|---|---|---|
| BTC/USDT | 1d | 3,598 | 5,028 | 305 | 12,260 | 11.8× |
| ETH/USDT | 1h | 3,344 | 4,774 | 272 | 17,403 | 12.3× |
| AAPL | 1d | 2,986 | 4,416 | 314 | 10,065 | 9.5× |
| SPY | 1d | 2,996 | 4,426 | 305 | 11,766 | 9.8× |
| NVDA | 1h | 2,992 | 4,422 | 289 | 13,962 | 10.4× |
| TSLA | 1d | 2,978 | 4,408 | 308 | 8,392 | 9.7× |
| MSFT | 1h | 2,998 | 4,428 | 302 | 12,976 | 9.9× |
| QQQ | 1d | 2,998 | 4,428 | 298 | 11,795 | 10.1× |
| Average | — | 3,111 | 4,541 | 299 | 12,327 | 10.4× |
Turn the token gap into a monthly bill.
A token difference is abstract until it is money. Take an agent that asks once an hour — 720 calls a month — and price the input tokens at published rates.
The same monthly bill across three published input prices. Anchors span the market: an economy model, a mid flagship, and a top flagship.
| Payload / call | Tokens/call | Tokens/month | @ $0.30/1M | @ $1.25/1M | @ $5.00/1M |
|---|---|---|---|---|---|
| Market-state read | 299 | 215,280 | $0.06 | $0.27 | $1.08 |
| Raw candles — 120, CSV | 3,111 | 2,239,920 | $0.67 | $2.80 | $11.20 |
| Full demo payload | 12,327 | 8,875,440 | $2.66 | $11.09 | $44.38 |
| Raw history — ~16,000 candles | 398,080 | 286,617,600 | $85.99 | $358.27 | $1,433.09 |
Where the homepage's "≈$6/call" comes from. That 400K-token history at a premium legacy price of ~$15/1M input works out to $5.97 a call — the "$6" figure. At today's cheaper flagships the same call is $0.50 ($1.25/1M) to $2.00 ($5.00/1M); note that a 400K prompt also pushes Gemini 2.5 Pro into its >200K tier at $2.50/1M, exactly when you send the most tokens. The read stays flat at a fraction of a cent whichever model you pick.
Prices as published on ai.google.dev/gemini-api/docs/pricing (Gemini 2.5 Flash $0.30/1M; Gemini 2.5 Pro $1.25/1M ≤200K, $2.50 >200K) and Anthropic's published API pricing (Claude Opus $5.00/1M, Sonnet $3.00, Haiku $1.00), fetched 2026-07-20. Input tokens only; output, caching and per-request overhead are separate.
It is not only cheaper. Long context also reads worse.
Cost is the easy argument. The harder, more honest one is quality: a 400,000-token context does not just cost more, it tends to be reasoned over worse. Several strands of published work point the same way — and because it matters, here is what is well-supported and what is not.
What is well-supported
- Position matters — "lost in the middle." Liu et al. (TACL 2024) find a U-shaped curve: models use information best when it sits at the start or end of the context and measurably worse when it is buried in the middle — even in models built for long contexts. arXiv:2307.03172
- Advertised context ≠ usable context. RULER (Hsieh et al., NVIDIA, COLM 2024) tests 17 long-context models and finds nearly all degrade sharply as length grows; only about half of those claiming ≥32K hold a real task at 32K. arXiv:2404.06654
- Removing keyword overlap breaks it faster. NoLiMa (Modarressi et al., ICML 2025) shows that when the question can't lexically match the answer, GPT-4o falls from a 99.3% short-context baseline to 69.7% at 32K, and 11 of the tested models drop below half their own baseline. Raw candles do not lexically match "is this overbought?". arXiv:2502.05167
- Irrelevant tokens hurt the relevant sub-task. Shi et al. (ICML 2023) add irrelevant sentences to grade-school math and watch accuracy fall even with explicit "ignore it" prompting. A wall of candles the model does not need is exactly this kind of distractor. arXiv:2302.00093
- Arithmetic over long numeric sequences degrades. "Faith and Fate" (Dziri et al., NeurIPS 2023) shows transformers reduce multi-step arithmetic to pattern-matching, and accuracy collapses as operand size grows. RSI, EMA and MACD are running sums and windowed averages over long number arrays — the operation class this describes. arXiv:2305.18654
Where the evidence is thinner — say so
- The broadest sweep across 2025 frontier models — "Context Rot" (Chroma, 2025), 18 models, degradation even on trivial tasks with length — is an industry technical report, not peer-reviewed, from a vendor that sells retrieval. We cite it as corroboration, labeled as such, not as proof. trychroma.com/research/context-rot
- Almost all of this literature uses synthetic retrieval tasks, not financial reasoning. The application to OHLCV is analogical, not measured.
- Newer frontier models degrade less than the 2023 models in the early papers. The effect is a persistent tendency, not a hard cliff — and it is shrinking.
- The specific claim "a model miscomputes RSI over raw candles" is a mechanistic inference from the two threads above. No published study measures indicator errors over raw candle tables directly. We do not put a number on it.
Net: a compact brief plausibly sidesteps a documented failure mode, on top of the measured cost saving. We present it as suggestive, not settled — which is the honest register for a claim the literature supports by analogy rather than by direct test.
Raw context grows with history. The read doesn't.
The single-window gap is ~10×. The headline gap needs the raw side to be a real history — which is what "let the model read the candles" becomes once you give it enough to judge regime and levels. At ~25 tokens/candle, raw tokens climb linearly while the read stays flat.
| History fed to model | Raw CSV tokens | Raw JSON tokens | Read stays | Read vs raw CSV |
|---|---|---|---|---|
| 120 candles | 2,986 | 4,426 | ~300 | 10× |
| 500 candles | 12,440 | 18,440 | ~300 | 41× |
| 1,000 candles | 24,880 | 36,880 | ~300 | 83× |
| 2,000 candles | 49,760 | 73,760 | ~300 | 166× |
| 5,000 candles | 124,400 | 184,400 | ~300 | 415× |
| ~16,000 candles | ~398,000 | ~590,000 | ~300 | ~1,300× |
Projected from a measured per-candle rate (~24.9 CSV, ~36.9 JSON), itself averaged over pulls of up to ~3,500 real candles. The "800× fewer" on the homepage sits between the 2,000- and 5,000-candle rows — a fair description of an agent that pulls a few timeframes of working history, and an overstatement for one that pulls a single window.
Where the brief is the wrong tool, and where our numbers bend.
A study that only flatters the product is an advertisement. Here is what the measurement does not say.
- The brief is an interpretation. It computes regime, levels and indicators and throws the raw ticks away. A model that wanted to do something we didn't anticipate — a bespoke indicator, a pattern we don't detect, its own arithmetic — cannot, because the numbers are gone. Compression is lossy by design. The raw ticks still ship in codec.rows and via POST /v1/candles if you want them; that is a deliberate escape hatch, not a contradiction.
- The full demo payload is larger than a single raw window. The keyless demo averages ~12,300 tokens because it ships the compact candle codec plus base-rate evidence for every detected pattern — the transparency layer from our base-rate study. The clean "~300 tokens" is the state, the part a model acts on; the full payload is the state plus its receipts. If token budget is the whole game and you don't need the evidence, the state read is the number that matters — but we won't pretend the wire payload is 300 tokens.
- The counts are from a GPT-family tokenizer. cl100k_base and o200k_base agree here, but Claude and Gemini will report somewhat different absolute numbers. The ratio is robust; the absolute tokens are a baseline, not a universal constant.
- The raw side is a fair, not a worst, case. We serialized clean CSV and rounded JSON — what a careful developer builds. A naive pass-through of the untrimmed provider response is heavier still, so if anything we are generous to raw.
- The quality argument is analogical. As §05 states, the context-degradation literature is mostly synthetic retrieval, the OHLCV link is inferred, and modern models degrade less than older ones. Believe the cost numbers as measured; treat the quality benefit as plausible and directional.
So who is it for? An agent that repeatedly asks "where is this market and what's printing" across many tickers and timeframes — polling, screening, multi-asset watch — is exactly where a flat ~300-token read pays off against a history that would otherwise grow without bound. An agent that needs the raw series for a custom computation, or asks once about one small window, should just send the candles: at that scale the gap is ~10×, real but not decisive. The brief earns its keep by volume and history, not by magic.
Two requests and any tokenizer.
Nothing here is behind a key. Fetch both sides and count them yourself.
# 1) the brief — keyless, returns 120 candles of analysis
curl -X POST https://patternfetch.com/v1/demo \
-H "Content-Type: application/json" \
-d '{"ticker":"AAPL","timeframe":"1d"}'
# 2) the raw candles — the public Yahoo chart endpoint, same window
curl "https://query1.finance.yahoo.com/v8/finance/chart/AAPL?range=1y&interval=1d"
# 3) count both with a real tokenizer (Node)
npm i gpt-tokenizer
node -e 'import("gpt-tokenizer").then(t=>{
const csv = /* last 120 rows: time,open,high,low,close,volume */ "";
const read = /* brief.analysis.nl + regime + levels + indicators */ "";
console.log("raw csv:", t.encode(csv).length, " read:", t.encode(read).length);
})'
The brief object is documented in the API reference; the market-state read is analysis.nl, analysis.regime, analysis.levels, analysis.indicators plus the pattern names and their one-line base-rate signal — everything except the per-pattern evidence tables and the candle codec.
Common questions.
How many tokens does raw OHLCV data cost an LLM?
How many tokens is a patternfetch market-state brief?
Is the brief really 800 times smaller than raw candles?
What does that save in money?
Does a smaller context also improve answer quality, not just cost?
Which tokenizer did you use, and does it match Claude or Gemini?
What are the limits of this comparison?
Can I reproduce these numbers?
Count it against your own tickers.
The demo is keyless and returns the same object we counted here. A free key adds $3.00 of starter credit (300 briefs), no card.