---
title: Quant research on a laptop: an IPO event study with DuckDB and DuckLocal
description: Intraday analysis, a 73-IPO event study, permutation tests and a cross-asset study at minute resolution, over local Parquet files. Most questions are asked by metric name through DuckLocal's semantic layer, and every query finishes in milliseconds.
image: https://ducklocal.app/assets/blog/anthropic-ipo-cover.webp
language: en
date: 2026-11-20
author: JetSquirrel
---

# Quant research on a laptop: an IPO event study with DuckDB and DuckLocal


Anthropic listed on Nasdaq on November 19, 2026. It priced at $83, opened at $111.50 and closed at $97.17. A quote page tells you that much. A quant wants to know something else: **how did large IPOs with a similar first day trade over the following weeks?**

Answering that takes the kind of work that usually lives on a research server: dozens of companies aligned on event time, excess returns against a benchmark, a significance test, and a cross-asset study at minute resolution. The DuckDB team recently made the case in [Bringing Local Analytics to the Quant's Desktop](https://duckdb.org/2026/11/03/bringing-local-analytics-to-the-quants-desktop) that much of this belongs on the analyst's own machine: pull the data once, keep it as Parquet, and iterate locally.

This post tests that claim end to end, with the Anthropic IPO as the example. Everything runs in [DuckLocal](https://ducklocal.app/) on a laptop, the whole dataset is 3.8 MB, and no query takes more than a fraction of a second.

![The DuckLocal window showing the IPO cohort dashboard: median excess-return paths for three groups of IPOs over 60 trading days](https://ducklocal.app/assets/blog/anthropic-ipo-cohort-dashboard.webp)
*The result: 72 tech IPOs aligned on trading day after listing, in a DuckLocal dashboard.*

> A data exercise, not investment advice.

## 1. The stack: an API, a folder and SQL

The setup has four parts, and none of them is a server:

1. **Market data** from the Longbridge OpenAPI, through its `longbridge` CLI, which prints JSON. A short Python script per dataset writes the raw JSON to a folder.
2. **Storage** as Parquet files, written by DuckDB from that JSON.
3. **Analysis** by metric name. A semantic model defines each metric once, and `ducklocal metrics` turns a request into DuckDB SQL. Questions that don't fit a metric are plain SQL, run with `ducklocal query`.
4. **Presentation** as `.dash` dashboards: plain-text specs that DuckLocal renders.

I worked with Claude Code and the DuckLocal agent skill, so the agent drove the same CLI I use. It inspects files before writing SQL and runs exploratory queries read-only, restricted to the project folder:

```text
ducklocal schema data/ant_1m.csv --stats
ducklocal query --restricted --allow-read . --format md --sql "$(cat sql/half_hour.sql)"
```

![Workflow: market data from the Longbridge OpenAPI is stored as Parquet files, queried with ducklocal by metric name or SQL, and shown in a .dash dashboard; you or an AI agent drive ducklocal](https://ducklocal.app/assets/blog/anthropic-ipo-workflow.webp)
*The whole workflow on one laptop.*

## 2. Ask by metric, not by SQL

Writing the SQL for every question is where most people stop. DuckLocal's semantic layer moves that work into one file: an [Apache Ossie](https://ossie.apache.org/) model, `model.ossie.yaml`, which names each metric, says in plain words what it means, and lists the dimensions you can break it down by. Two of the listing-day metrics, simplified:

```yaml
- name: beta
  description: ANT's beta to QQQ, from one-minute returns.
  expression: REGR_SLOPE(minute_returns.ant_lr, minute_returns.qqq_lr)
- name: alpha
  description: ANT's return after removing what its beta to QQQ explains.
  expression: EXP(ant_log_return - beta * qqq_log_return) - 1
```

With the model in place, a question is a list of metrics and a breakdown. `semantic` is the folder holding the model, and `--views` names the `.dash` file whose views define its datasets. Here's ANT's first 30 minutes against the rest of the day:

```text
ducklocal metrics query semantic --views semantic/views.dash \
  --metric beta,ant_return,qqq_return,alpha --by minute_returns.phase
```

| Phase | Beta | ANT | QQQ | Alpha |
| --- | --- | --- | --- | --- |
| First 30 minutes | 3.55 | −12.9% | −2.2% | −5.75% |
| Rest of day | 2.32 | +0.3% | −0.6% | +1.81% |

That came back in 38 ms. Trading opened at 11:48 ET. The first half hour carried 53% of the session's minute-bar volume, and the price went from $111.50 to $96.85 in it. After adjusting for the market, ANT gave up 5.75% in those 30 minutes and then beat the market for the rest of the day.

`ducklocal metrics semantic` on its own lists every metric and dimension the model offers, and `ducklocal metrics compile` prints the SQL a request turns into, so each number can still be traced. A request that would give a wrong answer, such as a join that counts rows twice, is refused with the reason instead of being answered. The semantic layer ships in DuckLocal 0.5.0, and the [metrics guide](https://ducklocal.app/docs/metrics) covers the model format and every command.

![A terminal running two ducklocal metrics queries: beta, returns and alpha by phase of ANT's listing day, and IPO count, median 60-day excess return and share lagging QQQ by first-day fade group](https://ducklocal.app/assets/blog/anthropic-ipo-metrics-terminal.webp)
*Two questions from this post, asked by metric name. Neither needed any SQL.*

![DuckLocal day-one dashboard: price with running VWAP, volume by half hour, volume at price, and cumulative returns against QQQ and AI megacaps](https://ducklocal.app/assets/blog/anthropic-ipo-day1-dashboard.webp)
*The day-one dashboard. Each panel is one SQL query over a CSV in the same folder.*

## 3. Event time: 73 IPOs on one axis

Comparing ANT with earlier IPOs means measuring every company from its own listing day. The ingest script pulls daily bars for each IPO, about 1.2 seconds per company over the network. One DuckDB `COPY` then writes them all to a Parquet file with a `day_n` column: the trading day after listing. That's 6,027 bars for 73 IPOs, written in 19 ms.

The model builds two datasets on that file: `ipo`, with one row per company, and `ipo_day`, with one row per company per trading day. They're linked by ticker. The measure I grouped by is the day-one **fade**: how far the close finished below the open. ANT faded 12.9%. How did earlier IPOs with each kind of first day trade over the next 60 days?

```text
ducklocal metrics query semantic --views semantic/views.dash \
  --metric ipo_count,median_xs_60d,share_lagging_qqq_60d --by ipo.fade_bucket
```

| Day-one fade | IPOs | Median 60-day excess return vs QQQ | Share that lagged QQQ |
| --- | --- | --- | --- |
| Worse than −10% (ANT's group) | 13 | −36.3% | 85% |
| −10% to −5% | 14 | −7.3% | 57% |
| −5% to 0 | 13 | −7.5% | 69% |
| 0 to +10% | 19 | +9.3% | 32% |
| Above +10% | 13 | −5.7% | 62% |

That's 4 ms. The chart at the top of this post is the same kind of request broken down by day instead: `--metric median_excess_return --by ipo.fade_bucket,ipo_day.day_n` returns 426 rows, also in 4 ms. Because "excess return" is defined once in the model, the table and the chart can't disagree about what it means.

## 4. Statistical tests in SQL

Is −36% more than you'd see by chance in a group of 13? A permutation test answers that. It needs window functions, which the semantic layer deliberately refuses, so this is where plain SQL comes back. DuckDB runs the whole test as a single query: replicate the sample 5,000 times with `range(5000)`, shuffle each copy with a deterministic hash, and take the median of the first 13:

```sql
-- cohort: one row per IPO with its 60-day excess return
SELECT i, median(xs_60d) AS med
FROM (SELECT *, row_number() OVER (PARTITION BY i ORDER BY md5(symbol || '#' || i)) AS rk
      FROM cohort, range(5000) r(i))
WHERE rk <= 13
GROUP BY i;
```

Run for four thresholds and two sample definitions, that's about 685,000 ranked rows, done in **128 ms**. The worse-than-−10% group comes out at p = 0.0004 on the full sample. It's p = 0.03 if you drop the late-2025 IPOs, which listed close together and moved together. The hash makes every draw reproducible, so the p-values come out the same on every run.

## 5. A cross-asset study at minute resolution

Does a listing this size move related stocks? With minute bars for eleven tickers in one folder, that's an event study too. Estimate each stock's beta before ANT traded (9:31–11:47), then measure its abnormal return in the 30 minutes after the first print:

| Stock | Raw move, first 30 min | Abnormal vs QQQ | Abnormal vs SPY |
| --- | --- | --- | --- |
| SMH (chip ETF) | −3.36% | −0.14% | −0.30% |
| NVDA | −2.77% | −0.05% | −0.14% |
| AMZN | −2.84% | −1.16% | −0.91% |

Chip stocks fell about as much as their beta implies. Amazon, one of Anthropic's major shareholders, showed the only notable abnormal move. The query is 26 lines, runs in 19 ms, and swapping the benchmark from QQQ to SPY is a one-word change.

![A DuckLocal query tab with the cross-asset event study: beta, raw and abnormal returns and z-scores for each ticker](https://ducklocal.app/assets/blog/anthropic-ipo-spillover.webp)
*Minute bars for eleven tickers, one query, results in 19 ms.*

## 6. Keep the data the API only shows for today

Some market data is only available for the current session: the latest trades, intraday capital flow, the day's trade statistics. A local folder turns those snapshots into history. A small collector appends trades to Hive-partitioned JSONL files, and DuckDB reads the whole tree as one table:

```sql
SELECT date, count(*) AS trades, sum(volume::BIGINT) AS volume
FROM read_json('warehouse/ticks/symbol=*/date=*/trades.jsonl', hive_partitioning = true)
GROUP BY date;
```

The same approach captured ANT's day-one capital-flow series. Joined with the minute bars, it shows where the money moved. Of the day's −$5.04B net outflow, −$4.62B came in the first 30 minutes, which is exactly when the price reset.

## 7. Dashboards as files

The dashboards in this post are `.dash` files: sources, shared views, queries and plots in plain text. `ducklocal check` runs every query read-only and confirms each plot's columns exist before anything is drawn, and `ducklocal open` shows the result in the DuckLocal window.

```text
ducklocal check ipo_cohort.dash --summary
ducklocal open ipo_cohort.dash
```

Because a spec is text, it lives in the same folder as the data and the SQL, diffs cleanly, and can be reviewed like code.

![The ipo_cohort.dash spec open in an editor next to the rendered dashboard in DuckLocal](https://ducklocal.app/assets/blog/anthropic-ipo-dash-spec.webp)
*A dashboard is a file: sources, one view, three queries and their plots.*

## 8. How far does a laptop go?

Everything above ran on an Apple M5 laptop:

| Step | Data | Time |
| --- | --- | --- |
| Pull one IPO's daily history (network) | ~83 bars | ~1.2 s |
| JSON to Parquet with event-time index | 6,027 bars, 73 IPOs | 19 ms |
| Event study by metric: 60-day excess return by first-day group | 72 IPOs | 4 ms |
| The same metric by trading day (the chart's 426 points) | 72 IPOs × 60 days | 4 ms |
| Permutation test, 5,000 draws × 8 configurations | ~685,000 ranked rows | 128 ms |
| Intraday beta and alpha by phase, by metric | ANT and QQQ minute bars | 38 ms |
| Cross-asset abnormal returns | 11 tickers × 390 minutes | 19 ms |

The whole project, raw JSON included, is 3.8 MB. The only time spent waiting was on the network. DuckDB's columnar engine handles data several orders of magnitude larger the same way: a year of tick data for a watchlist is still a folder of Parquet files on one machine.

What made this work wasn't any single fast query. It was having the whole loop in one place: pull data, store it as files, ask questions by metric name, drop to SQL when a question needs it, check it statistically, and show it in a dashboard that is itself a file. Every step can be rerun, and nothing depends on a server.

If you want to try the same workflow, [DuckLocal](https://ducklocal.app/) is a free, open-source desktop app for SQL and dashboards over local files. The [getting started guide](https://ducklocal.app/docs/getting-started) covers the CLI and the agent skill.

## Further reading

- [Semantic metrics over DuckDB with an Ossie model](https://ducklocal.app/docs/metrics), DuckLocal docs
- [Bringing Local Analytics to the Quant's Desktop](https://duckdb.org/2026/11/03/bringing-local-analytics-to-the-quants-desktop), DuckDB blog
- [DuckDB UI vs DuckLocal: which one should you use?](https://ducklocal.app/blog/duckdb-ui-vs-ducklocal/)
- [DuckDB 2.0 Release: From Database to Data Infrastructure for AI](https://ducklocal.app/blog/duckdb-2-ai-infrastructure/)
