Example queries
Questions people ask of the data, answered in pandas and in SQL (DuckDB reads the parquet files directly). Run them from the folder with your downloaded files. Each one is tested against every release.
Using Python? pip install varve-data downloads the files and loads any table in one line: vd.load("quarterly") instead of pd.read_parquet. Library details.
The habits they share: join fundamentals on filed, never period_end; key companies on varve_id; map tickers with the interval that was valid on the date. prices stands for your own price table (symbol, date, close).
Varve Fundamentals
Every company's latest public quarter on 31 March 2020
Filter on filed, not period_end: on 31 March most December quarters weren't filed yet.
import pandas as pd
q = pd.read_parquet("varve_fundamentals_quarterly.parquet")
q = q[q["lineage_primary"] & (q["filed"] <= "2020-03-31")]
latest = q.sort_values(["filed", "period_end"]).groupby("varve_id").tail(1)
latest[["ticker", "period_end", "filed", "revenue", "net_income"]]
SELECT ticker, period_end, filed, revenue, net_income FROM 'varve_fundamentals_quarterly.parquet' WHERE lineage_primary AND filed <= DATE '2020-03-31' QUALIFY row_number() OVER (PARTITION BY varve_id ORDER BY filed DESC, period_end DESC) = 1;
Attach the quarter that was public on each price date
An as-of join on filed. prices needs varve_id (see ticker_history for mapping symbols).
import pandas as pd
q = pd.read_parquet("varve_fundamentals_quarterly.parquet")
q = q[q["lineage_primary"]].dropna(subset=["filed"]).sort_values("filed")
panel = pd.merge_asof(prices.sort_values("date"), q[["varve_id", "filed", "period_end", "revenue", "equity"]],
left_on="date", right_on="filed", by="varve_id", direction="backward")
panel
SELECT p.varve_id, p.date, p.close, q.period_end, q.filed, q.revenue, q.equity FROM prices p ASOF JOIN (SELECT * FROM 'varve_fundamentals_quarterly.parquet' WHERE lineage_primary) q ON p.varve_id = q.varve_id AND p.date >= q.filed;
Top decile by gross profitability on 31 March 2020
Each company's newest factor row public that day, among companies still reporting.
import pandas as pd
f = pd.read_parquet("varve_fundamentals_factors.parquet")
f = f[f["filed"] <= "2020-03-31"].sort_values(["filed", "period_end"]).groupby("varve_id").tail(1)
f = f[f["period_end"] >= "2019-06-30"]
top = f[f["gross_profitability"] >= f["gross_profitability"].quantile(0.9)]
top.sort_values("gross_profitability", ascending=False)[["ticker", "period_end", "gross_profitability", "f_score"]]
WITH latest AS (
SELECT * FROM 'varve_fundamentals_factors.parquet'
WHERE filed <= DATE '2020-03-31'
QUALIFY row_number() OVER (PARTITION BY varve_id ORDER BY filed DESC, period_end DESC) = 1)
SELECT ticker, period_end, gross_profitability, f_score
FROM latest
WHERE period_end >= DATE '2019-06-30'
AND gross_profitability >= (SELECT quantile_cont(gross_profitability, 0.9) FROM latest
WHERE period_end >= DATE '2019-06-30')
ORDER BY gross_profitability DESC;
Where a number came from: Apple's annual revenue, with the source filing
Every value carries the accession number of the filing that first reported it.
import pandas as pd
f = pd.read_parquet("varve_fundamentals_facts.parquet",
filters=[("varve_id", "==", "VD320193"), ("field", "==", "revenue"), ("duration", "==", "FY")])
f = f.sort_values("period_end").tail(3)
f["filing"] = ("https://www.sec.gov/Archives/edgar/data/" + f["cik"].astype(str) + "/"
+ f["accession"].str.replace("-", "") + "/") # EDGAR paths use the filer's CIK
f[["period_end", "value", "source", "filed", "accession", "restated", "filing"]]
SELECT period_end, value, source, filed, accession, value_latest, restated,
'https://www.sec.gov/Archives/edgar/data/' || cik || '/' || replace(accession, '-', '') || '/' AS filing
FROM 'varve_fundamentals_facts.parquet'
WHERE varve_id = 'VD320193' AND field = 'revenue' AND duration = 'FY'
ORDER BY period_end DESC LIMIT 3;
The figure as known on a date: Berkshire Hathaway's revenue on 30 June 2018
FY2016 was first filed as $223.6B and restated to $215.1B in February 2019; on 30 June 2018 the current number was still $223.6B.
import pandas as pd
v = pd.read_parquet("varve_fundamentals_fact_versions.parquet",
filters=[("varve_id", "==", "VD1067983"), ("field", "==", "revenue"), ("duration", "==", "FY")])
d = pd.Timestamp("2018-06-30")
known = v[(v["known_from"] <= d) & (v["known_to"].isna() | (v["known_to"] > d))]
known.sort_values("period_end").tail(3)[["period_end", "version", "value", "known_from", "known_to", "accession"]]
SELECT period_end, version, value, known_from, known_to, accession FROM 'varve_fundamentals_fact_versions.parquet' WHERE varve_id = 'VD1067983' AND field = 'revenue' AND duration = 'FY' AND known_from <= DATE '2018-06-30' AND (known_to IS NULL OR known_to > DATE '2018-06-30') ORDER BY period_end DESC LIMIT 3;
Which company held a ticker on a date
FB and META both resolve to Meta; BBBY in 2020 is the original Bed Bath & Beyond.
import pandas as pd
th = pd.read_parquet("varve_fundamentals_ticker_history.parquet")
def holder(ticker, date):
d = pd.Timestamp(date)
h = th[(th["ticker"] == ticker) & (th["valid_from"] <= d) & (th["valid_to"].isna() | (th["valid_to"] >= d))]
return h[["ticker", "varve_id", "cik", "security_type", "valid_from", "valid_to"]]
pd.concat([holder("FB", "2021-06-30"), holder("META", "2023-06-30"), holder("BBBY", "2020-06-30")])
SELECT t.ticker, t.varve_id, t.cik, t.security_type, t.valid_from, t.valid_to
FROM (VALUES ('FB', DATE '2021-06-30'), ('META', DATE '2023-06-30'), ('BBBY', DATE '2020-06-30')) AS q(ticker, d)
JOIN 'varve_fundamentals_ticker_history.parquet' t
ON t.ticker = q.ticker AND q.d >= t.valid_from AND (t.valid_to IS NULL OR q.d <= t.valid_to);
Map your price table's symbols to companies, point-in-time
Common stock only, so a preferred or warrant sharing the root symbol isn't picked up.
import pandas as pd
th = pd.read_parquet("varve_fundamentals_ticker_history.parquet")
th = th[th["security_type"] == "common"]
m = prices[["symbol", "date", "close"]].reset_index().merge(th[["ticker", "varve_id", "cik", "valid_from", "valid_to"]],
left_on="symbol", right_on="ticker")
m = m[(m["date"] >= m["valid_from"]) & (m["valid_to"].isna() | (m["date"] <= m["valid_to"]))]
m.sort_values("valid_from").drop_duplicates("index", keep="last")[["symbol", "date", "varve_id", "cik"]]
SELECT p.symbol, p.date, t.varve_id, t.cik FROM prices p JOIN 'varve_fundamentals_ticker_history.parquet' t ON t.ticker = p.symbol AND p.date >= t.valid_from AND (t.valid_to IS NULL OR p.date <= t.valid_to) WHERE t.security_type = 'common';
CUSIP, ISIN and FIGI for a company's securities
Berkshire Hathaway: class A, class B and the class B CUSIP used before its 2010 split.
import pandas as pd
s = pd.read_parquet("varve_fundamentals_security_ids.parquet")
s[s["varve_id"] == "VD1067983"][["cusip", "isin", "composite_figi", "security_type", "first_seen", "last_seen"]]
SELECT cusip, isin, composite_figi, share_class_figi, security_type, first_seen, last_seen FROM 'varve_fundamentals_security_ids.parquet' WHERE varve_id = 'VD1067983';
CUSIP to company, within the CUSIP's validity window
Use this to key holdings or prices that come with CUSIPs.
import pandas as pd
s = pd.read_parquet("varve_fundamentals_security_ids.parquet")
d = pd.Timestamp("2024-06-30")
s[s["cusip"].isin(["037833100", "084670702"]) & (s["first_seen"] <= d) & (s["last_seen"] >= d)][
["cusip", "varve_id", "cik", "isin", "composite_figi"]]
SELECT cusip, varve_id, cik, isin, composite_figi
FROM 'varve_fundamentals_security_ids.parquet'
WHERE cusip IN ('037833100', '084670702') AND DATE '2024-06-30' BETWEEN first_seen AND last_seen;
Prices keyed by ticker to varve_id, point in time
One varve_id per company across ticker and CIK changes: Broadcom's AVGO rows join to one company from 2009 on, although Avago, Broadcom Ltd and Broadcom Inc filed under three CIKs.
import pandas as pd
ci = pd.read_parquet("varve_fundamentals_company_identifiers.parquet", filters=[("id_type", "==", "ticker")])
m = prices[["symbol", "date", "close"]].merge(ci, left_on="symbol", right_on="id_value")
m = m[(m["date"] >= m["valid_from"]) & (m["valid_to"].isna() | (m["date"] <= m["valid_to"]))]
m[["symbol", "date", "close", "varve_id", "varve_sid"]]
SELECT p.symbol, p.date, c.varve_id, c.varve_sid FROM prices p JOIN 'varve_fundamentals_company_identifiers.parquet' c ON c.id_type = 'ticker' AND c.id_value = p.symbol AND p.date >= c.valid_from AND (c.valid_to IS NULL OR p.date <= c.valid_to);
A company's identifiers over time
Broadcom: one ticker, three CUSIPs (Avago, Broadcom Ltd, Broadcom Inc) and three CIKs.
import pandas as pd
ci = pd.read_parquet("varve_fundamentals_company_identifiers.parquet")
ci[ci["varve_id"] == "VD1441634"].sort_values(["id_type", "valid_from"])
SELECT id_type, id_value, valid_from, valid_to, sources FROM 'varve_fundamentals_company_identifiers.parquet' WHERE varve_id = 'VD1441634' ORDER BY id_type, valid_from;
Varve Events
Earnings released after the close on 5 August 2026, in order
accepted_et is EDGAR's acceptance time in Eastern time; accepted_verified marks times checked against EDGAR's own index.
import pandas as pd
e = pd.read_parquet("varve_events_earnings_releases.parquet")
e = e[(e["filed"] == "2026-08-05") & (e["session"] == "after_close")]
e.sort_values("accepted_et")[["accepted_et", "ticker", "company", "accepted_verified"]]
SELECT accepted_et, ticker, company, accepted_verified FROM 'varve_events_earnings_releases.parquet' WHERE filed = DATE '2026-08-05' AND session = 'after_close' ORDER BY accepted_et;
Largest open-market insider purchases in the last 90 days
Code P = open-market purchase. price_suspect marks a total typed into the per-share field.
import pandas as pd
i = pd.read_parquet("varve_events_insider_transactions.parquet",
columns=["filed", "ticker", "issuer_name", "owner_name", "title", "code",
"shares", "price", "value", "price_suspect"],
filters=[("code", "==", "P")])
i = i[~i["price_suspect"] & (i["filed"] >= i["filed"].max() - pd.Timedelta(days=90))]
i.nlargest(20, "value")
SELECT filed, ticker, issuer_name, owner_name, title, shares, price, value FROM 'varve_events_insider_transactions.parquet' WHERE code = 'P' AND NOT price_suspect AND filed >= (SELECT max(filed) FROM 'varve_events_insider_transactions.parquet') - INTERVAL 90 DAY ORDER BY value DESC LIMIT 20;
Non-reliance notices (8-K Item 4.02) filed in 2026
The company says earlier financial statements should no longer be relied on: a restatement is coming.
import pandas as pd
c = pd.read_parquet("varve_events_current_reports.parquet",
filters=[("item", "==", "4.02"), ("filed", ">=", pd.Timestamp("2026-01-01"))])
c.sort_values("filed")[["filed", "accepted_et", "ticker", "company", "accession"]]
SELECT filed, accepted_et, ticker, company, accession FROM 'varve_events_current_reports.parquet' WHERE item = '4.02' AND filed >= DATE '2026-01-01' ORDER BY filed;
Largest institutional holders of Apple at the end of June 2026
One quarter file from the unzipped 13F positions archive; a manager can report a CUSIP on several lines, so sum by manager.
import pandas as pd
pos = pd.read_parquet("varve_events_13f_positions/period=2026-06-30.parquet",
filters=[("cusip", "==", "037833100")])
pos = pos[pos["putcall"].isna() & ~pos["value_suspect"]]
mgr = pd.read_parquet("varve_events_13f_filings.parquet", columns=["accession", "manager"])
pos.merge(mgr, on="accession").groupby("manager")[["shares", "value_usd"]].sum().nlargest(10, "shares")
SELECT f.manager, sum(p.shares) AS shares, sum(p.value_usd) AS value_usd FROM 'varve_events_13f_positions/period=2026-06-30.parquet' p JOIN 'varve_events_13f_filings.parquet' f USING (accession) WHERE p.cusip = '037833100' AND p.putcall IS NULL AND NOT p.value_suspect GROUP BY f.manager ORDER BY shares DESC LIMIT 10;
Companies that rewrote their risk factors most in the last 12 months
Lower similarity = more rewritten. Requiring a few thousand words skips shell companies whose whole section is a paragraph. The very top is often a reverse merger: a new business in a listed shell.
import pandas as pd
c = pd.read_parquet("varve_events_10k_changes.parquet")
e = pd.read_parquet("varve_events_entities.parquet", columns=["cik", "name", "ticker"])
c = c[(c["filed"] >= c["filed"].max() - pd.Timedelta(days=365)) & (c["risk_factors_words"] >= 3000)]
c.nsmallest(20, "risk_factors_similarity").merge(e, on="cik", how="left")[
["filed", "ticker", "name", "risk_factors_similarity", "risk_factors_new_sentences", "risk_factors_length_change"]]
SELECT c.filed, e.ticker, e.name, c.risk_factors_similarity, c.risk_factors_new_sentences,
c.risk_factors_length_change
FROM 'varve_events_10k_changes.parquet' c
LEFT JOIN 'varve_events_entities.parquet' e USING (cik)
WHERE c.filed >= (SELECT max(filed) FROM 'varve_events_10k_changes.parquet') - INTERVAL 365 DAY
AND c.risk_factors_words >= 3000
ORDER BY c.risk_factors_similarity LIMIT 20;
The latest 10-K change score each company had published by 30 June 2025
A point-in-time snapshot for a cross-sectional sort: only 10-Ks filed by the date count, and each company keeps its most recent one (no score on that one = left out, not an older score).
import pandas as pd
c = pd.read_parquet("varve_events_10k_changes.parquet",
columns=["varve_id", "filed", "accepted", "similarity"])
snap = (c[c["filed"] <= "2025-06-30"].sort_values("filed")
.groupby("varve_id").tail(1).dropna(subset=["similarity"]))
snap["decile"] = pd.qcut(snap["similarity"].rank(method="first"), 10, labels=range(1, 11))
snap.sort_values("similarity")
SELECT varve_id, filed, similarity,
ntile(10) OVER (ORDER BY similarity) AS decile
FROM (
SELECT *, row_number() OVER (PARTITION BY varve_id ORDER BY filed DESC) AS rn
FROM 'varve_events_10k_changes.parquet'
WHERE filed <= DATE '2025-06-30'
)
WHERE rn = 1 AND similarity IS NOT NULL
ORDER BY similarity;
Restatements that cut net income after a non-reliance notice, last two years
An 8-K Item 4.02 says earlier statements should no longer be relied on; the restating filing follows. Scaled by total assets, so winsorize before ranking.
import pandas as pd
r = pd.read_parquet("varve_events_revision_filings.parquet")
e = pd.read_parquet("varve_events_entities.parquet", columns=["cik", "name", "ticker"])
r = r[r["after_nonreliance_notice"] & (r["net_income_revision_to_assets"] < 0)
& (r["revised"] >= r["revised"].max() - pd.Timedelta(days=730))]
r.merge(e, on="cik", how="left").sort_values("revised", ascending=False)[
["revised", "ticker", "name", "revising_form", "key_values_revised", "net_income_revision_to_assets"]]
SELECT r.revised, e.ticker, e.name, r.revising_form, r.key_values_revised, r.net_income_revision_to_assets FROM 'varve_events_revision_filings.parquet' r LEFT JOIN 'varve_events_entities.parquet' e USING (cik) WHERE r.after_nonreliance_notice AND r.net_income_revision_to_assets < 0 AND r.revised >= (SELECT max(revised) FROM 'varve_events_revision_filings.parquet') - INTERVAL 730 DAY ORDER BY r.revised DESC;
Annual net income that a restatement turned from profit to loss, filed in 2025
value_prev is the figure before the revision; first_known is when it was first public.
import pandas as pd
v = pd.read_parquet("varve_events_revisions.parquet",
filters=[("field", "==", "net_income"), ("duration", "==", "FY")])
v = v[v["sign_flip"] & (v["revised"].dt.year == 2025)]
v.sort_values("revised")[["varve_id", "period_end", "value_prev", "value", "first_known", "revised", "revising_form"]]
SELECT varve_id, period_end, value_prev, value, first_known, revised, revising_form FROM 'varve_events_revisions.parquet' WHERE field = 'net_income' AND duration = 'FY' AND sign_flip AND year(revised) = 2025 ORDER BY revised;
Varve Corporate Actions
Put raw (unadjusted) prices on today's share basis
Divide a raw price by the price_divisor in force on its date; NVIDIA's pre-June-2024 prices divide by 10.
import pandas as pd
sf = pd.read_parquet("varve_corporate_actions_split_factors.parquet")
sf["valid_from"] = sf["valid_from"].fillna(pd.Timestamp("1900-01-01"))
sf["varve_id"] = sf["varve_id"].astype(str)
p = pd.merge_asof(prices.sort_values("date"), sf.sort_values("valid_from")[["varve_id", "valid_from", "price_divisor"]],
left_on="date", right_on="valid_from", by="varve_id")
p["close_adj"] = p["close"] / p["price_divisor"].fillna(1.0)
p[["varve_id", "date", "close", "close_adj"]]
SELECT p.varve_id, p.date, p.close, p.close / coalesce(s.price_divisor, 1) AS close_adj FROM prices p LEFT JOIN 'varve_corporate_actions_split_factors.parquet' s ON s.varve_id = p.varve_id AND p.date >= coalesce(s.valid_from, DATE '1900-01-01') AND (s.valid_to IS NULL OR p.date < s.valid_to);
Announced holding-company reorganizations and reincorporations not yet completed
status is announced or vote_scheduled until the successor-issuer notice arrives; expected_basis says how precise expected_date is (a stated date, or the end of the month or quarter given).
import pandas as pd
r = pd.read_parquet("varve_corporate_actions_reorganizations.parquet")
r[r["status"] != "completed"].sort_values("expected_date")[
["ticker", "company", "kind", "status", "announced", "expected_date", "expected_basis", "meeting_date"]]
SELECT ticker, company, kind, status, announced, expected_date, expected_basis, meeting_date FROM 'varve_corporate_actions_reorganizations.parquet' WHERE status <> 'completed' ORDER BY expected_date NULLS LAST;
Reincorporations completed since 2020: where companies moved
Completed rows only. same_company is True when Varve keeps one varve_id across the two entities, so the company's Fundamentals and Events history continues unbroken.
import pandas as pd
r = pd.read_parquet("varve_corporate_actions_reorganizations.parquet")
r = r[(r["status"] == "completed") & (r["kind"] == "redomicile") & (r["effective_date"] >= "2020-01-01")]
r.sort_values("effective_date")[["effective_date", "ticker_before", "ticker_after", "company",
"predecessor_incorporation", "successor_incorporation", "same_company"]]
SELECT effective_date, ticker_before, ticker_after, company, predecessor_incorporation,
successor_incorporation, same_company
FROM 'varve_corporate_actions_reorganizations.parquet'
WHERE status = 'completed' AND kind = 'redomicile' AND effective_date >= DATE '2020-01-01'
ORDER BY effective_date;
More
Every table and column is in the schema reference (Events and Corporate Actions references in each download); the example notebooks run end to end on the free sample, and the varve-data Python library (pip install varve-data) downloads and loads every table.