SPDR ETFs
State Street SPDR ETF facts, current holdings and daily NAV history from the public SSGA feed
- Connector software
- Free and open source
- Service credentials
- Not needed
- Query Farm hosting
- Available · $10/month organization minimum
Use with an agent
Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.
npx skills add Query-farm/vgi-skills --skill orchard
Copy this request into your coding agent to get started.
Use https://query.farm/products/orchard/connectors/etf-spdr/index.md to help me query SPDR ETFs with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.
largest_etfs
Example output · captured
- Connector release
- v0.5.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
SELECT ticker, fund_name, net_assets
FROM spdr.main.products
ORDER BY net_assets DESC
LIMIT 5;
| ticker | fund_name | net_assets |
|---|---|---|
| SPY | State Street® SPDR® S&P 500® ETF Trust | 776,694,300,000 |
| SPYM | State Street® SPDR® Portfolio S&P 500® ETF | 181,975,750,000 |
| GLD | SPDR® Gold Shares | 120,072,650,000 |
| XLK | State Street® Technology Select Sector SPDR® ETF | 108,672,780,000 |
| XLF | State Street® Financial Select Sector SPDR® ETF | 53,687,160,000 |
Quick start
Choose where to run SPDR ETFs, then follow the steps below.
The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.
1. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
2. Attach the connector
Attach the release directly
Downloads the latest release for your platform and caches it locally.
ATTACH 'spdr' AS spdr (
TYPE vgi,
LOCATION 'github-auto://Query-farm/vgi-etf-spdr'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'spdr' AS spdr (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-etf-spdr:0.5.0'
);
3. Run a query
SELECT ticker, fund_name, net_assets
FROM spdr.main.products
ORDER BY net_assets DESC
LIMIT 5;
Run the connector on a server you manage. You operate the service and choose who can connect.
1. Deploy the connector on your server
Follow the connector’s deployment instructions. Use its supported HTTP transport, or launch it remotely over SSH. The connection guide explains both options.
2. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach the connector
For an HTTP deployment, replace the example URL with your endpoint. Add the authentication options your deployment requires. For SSH, use the SSH connection instructions.
ATTACH 'spdr' AS spdr
(TYPE vgi, LOCATION 'https://your-connector.example.com');
4. Run a query
SELECT ticker, fund_name, net_assets
FROM spdr.main.products
ORDER BY net_assets DESC
LIMIT 5;
Query Farm operates SPDR ETFs for your team. Hosting has a $10 monthly minimum per organization; usage counts toward it. From $2.97 per instance-month ($10 monthly minimum).
1. Create your hosted connector
Open the console, choose your organization and deployment size, and add any service credentials there.
2. Install the vgi extension
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach your deployment
Copy the ATTACH statement from your deployment in the console and run it in DuckDB or Haybarn. Use spdr as the catalog alias for the query below.
4. Run a query
SELECT ticker, fund_name, net_assets
FROM spdr.main.products
ORDER BY net_assets DESC
LIMIT 5;
Technical details
- Verified connector release
- v0.5.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
- Verified on
- December 1, 2026
Pin a version for production
When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.
Attach the release directly
Uses the verified release each time you attach the connector.
ATTACH 'spdr' AS spdr (
TYPE vgi,
LOCATION 'github-auto://Query-farm/[email protected]'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'spdr' AS spdr (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-etf-spdr:0.5.0'
);
Overview
SPDR / State Street (SSGA) US ETF data as DuckDB tables: products (catalog) & holdings (ticker-partitioned) tables, plus nav_history — vgi-etf-spdr
SPDR ETFs
SPDR / State Street (SSGA) US ETF data, exposed as DuckDB tables and a table function.
The fund is the unit of the data and is keyed by an exchange ticker (e.g. SPY) — begin at the catalog to discover that key, then drill into a fund's holdings or NAV history. Holdings are the current published portfolio (SSGA does not publish historical holdings).
Sources
- State Street fund finder — the SPDR ETF lineup the catalog is read from.
- State Street terms and conditions — terms that govern use of the site's data.
Data is provided for informational use; review SSGA's terms before redistribution.
Catalog
Everything spdr exposes once attached — read straight from the worker's
released build.
main 2 tables · 1 function
SPDR fund data: ETF catalog, detailed current holdings, and per-fund NAV history.
Schema examples (6)
Ten largest SPDR ETFs by net assets
SELECT ticker, fund_name, net_assets
FROM spdr.main.products
ORDER BY net_assets DESC
LIMIT 10;
Top holdings of SPY
SELECT name, ticker, weight_percent
FROM spdr.main.holdings
WHERE fund_ticker = 'SPY'
ORDER BY weight_percent DESC
LIMIT 10;
Recent daily NAV history for SPY
SELECT as_of_date, nav
FROM spdr.main.nav_history('SPY', start_date := DATE '2026-01-01')
ORDER BY as_of_date DESC;
Largest single holding of each of the five biggest SPDR equity ETFs, with its weight and approximate dollar size (the catalog picks the funds; holding_rank = 1 is applied inside the holdings scan, which still reads every fund's file because the join key is not pushed down)
WITH biggest AS (SELECT ticker, net_assets FROM spdr.main.products WHERE asset_class = 'Equity' ORDER BY net_assets DESC LIMIT 5) SELECT b.ticker AS fund, h.name AS top_holding, h.weight_percent, round(b.net_assets * h.weight_percent / 100 / 1e9, 1) AS position_usd_billions
FROM biggest b
JOIN spdr.main.holdings h ON h.fund_ticker = b.ticker
WHERE h.holding_rank = 1
ORDER BY b.net_assets DESC;
2 more examples
Approximate dollar size of SPY's ten largest positions: each holding's weight applied to the fund's net assets from the products catalog (USD billions)
SELECT h.holding_rank, h.name, h.ticker, h.weight_percent,
round(p.net_assets * h.weight_percent / 100 / 1e9, 1) AS position_usd_billions
FROM spdr.main.holdings h
JOIN spdr.main.products p ON p.ticker = h.fund_ticker
WHERE h.fund_ticker = 'SPY'
ORDER BY h.holding_rank
LIMIT 10;
SPY's price-only NAV change from the prior year-end NAV (base_nav_date) to SSGA's latest performance date, next to the YTD total return the catalog reports for that date (the gap reflects distributions, which a NAV-per-share series excludes)
WITH p AS (SELECT ticker, performance_as_of, ytd_return_percent FROM spdr.main.products WHERE ticker = 'SPY'), n AS (SELECT as_of_date, nav FROM spdr.main.nav_history('SPY', start_date := current_date - 500)) SELECT p.ticker, p.performance_as_of, max(n.as_of_date) FILTER (WHERE n.as_of_date < date_trunc('year', p.performance_as_of)) AS base_nav_date, round(100 * (arg_max(n.nav, n.as_of_date) / arg_max(n.nav, n.as_of_date) FILTER (WHERE n.as_of_date < date_trunc('year', p.performance_as_of)) - 1), 2) AS nav_change_percent, p.ytd_return_percent
FROM p
JOIN n ON n.as_of_date <= p.performance_as_of
GROUP BY p.ticker, p.performance_as_of, p.ytd_return_percent
ORDER BY p.ticker;
holdings
Detailed current fund holdings, hive-partitioned by fund_ticker (filter WHERE fund_ticker = … for one fund, or scan unfiltered for all). SSGA publishes current holdings only (no historical dates).
Top 10 current holdings of SPY
SELECT name, ticker, weight_percent
FROM spdr.main.holdings
WHERE fund_ticker = 'SPY'
ORDER BY weight_percent DESC
LIMIT 10;
A bond fund fills coupon / maturity / par value
SELECT name, coupon_percent, maturity_date, par_value
FROM spdr.main.holdings
WHERE fund_ticker = 'BIL'
ORDER BY weight_percent DESC
LIMIT 10;
Two funds at once (partition fan-out)
SELECT fund_ticker, name, weight_percent
FROM spdr.main.holdings
WHERE fund_ticker IN ('SPY', 'BIL');
2 more examples
Approximate dollar size of SPY's ten largest positions: each holding's weight applied to the fund's net assets from the products catalog (USD billions)
SELECT h.holding_rank, h.name, h.ticker, h.weight_percent,
round(p.net_assets * h.weight_percent / 100 / 1e9, 1) AS position_usd_billions
FROM spdr.main.holdings h
JOIN spdr.main.products p ON p.ticker = h.fund_ticker
WHERE h.fund_ticker = 'SPY'
ORDER BY h.holding_rank
LIMIT 10;
SELECT fund_ticker, count(*) AS positions,
round(sum(weight_percent), 2) AS total_weight
FROM spdr.main.holdings
WHERE fund_ticker IN ('SPY', 'BIL')
GROUP BY fund_ticker
ORDER BY positions DESC;
products
Every SPDR / State Street US ETF with its key facts, one row per fund. Query directly (no arguments) and filter with WHERE; percent columns are in percent points.
Ten largest SPDR ETFs by net assets
SELECT ticker, fund_name, net_assets
FROM spdr.main.products
ORDER BY net_assets DESC
LIMIT 10;
Cheapest equity ETFs by expense ratio
SELECT ticker, fund_name, expense_ratio_percent
FROM spdr.main.products
WHERE asset_class = 'Equity'
ORDER BY expense_ratio_percent
LIMIT 10;
Look up a single fund by ticker
SELECT ticker, fund_name, expense_ratio_percent
FROM spdr.main.products
WHERE ticker = 'SPY';
1 more example
Largest single holding of each of the five biggest SPDR equity ETFs, with its weight and approximate dollar size (the catalog picks the funds; holding_rank = 1 is applied inside the holdings scan, which still reads every fund's file because the join key is not pushed down)
WITH biggest AS (SELECT ticker, net_assets FROM spdr.main.products WHERE asset_class = 'Equity' ORDER BY net_assets DESC LIMIT 5) SELECT b.ticker AS fund, h.name AS top_holding, h.weight_percent, round(b.net_assets * h.weight_percent / 100 / 1e9, 1) AS position_usd_billions
FROM biggest b
JOIN spdr.main.holdings h ON h.fund_ticker = b.ticker
WHERE h.holding_rank = 1
ORDER BY b.net_assets DESC;
Try these queries
top_holdings — The top holdings of the SPDR S&P 500 ETF Trust
SELECT name, ticker, weight_percent
FROM spdr.main.holdings
WHERE fund_ticker = 'SPY'
ORDER BY weight_percent DESC
LIMIT 5;
Uses holdings
Ten largest SPDR ETFs by net assets
SELECT ticker, fund_name, net_assets
FROM spdr.main.products
ORDER BY net_assets DESC
LIMIT 10
Uses products
Top holdings of SPY
SELECT name, ticker, weight_percent
FROM spdr.main.holdings
WHERE fund_ticker = 'SPY'
ORDER BY weight_percent DESC
LIMIT 10
Uses holdings
Recent daily NAV history for SPY
SELECT as_of_date, nav
FROM spdr.main.nav_history('SPY', start_date := DATE '2026-01-01')
ORDER BY as_of_date DESC
Uses nav_history
Largest single holding of each of the five biggest SPDR equity ETFs, with its weight and approximate dollar size (the catalog picks the funds; holding_rank = 1 is applied inside the holdings scan, which still reads every fund's file because the join key is not pushed down)
WITH biggest AS (SELECT ticker, net_assets FROM spdr.main.products WHERE asset_class = 'Equity' ORDER BY net_assets DESC LIMIT 5) SELECT b.ticker AS fund, h.name AS top_holding, h.weight_percent, round(b.net_assets * h.weight_percent / 100 / 1e9, 1) AS position_usd_billions
FROM biggest b
JOIN spdr.main.holdings h ON h.fund_ticker = b.ticker
WHERE h.holding_rank = 1
ORDER BY b.net_assets DESC
Approximate dollar size of SPY's ten largest positions: each holding's weight applied to the fund's net assets from the products catalog (USD billions)
SELECT h.holding_rank, h.name, h.ticker, h.weight_percent,
round(p.net_assets * h.weight_percent / 100 / 1e9, 1) AS position_usd_billions
FROM spdr.main.holdings h
JOIN spdr.main.products p ON p.ticker = h.fund_ticker
WHERE h.fund_ticker = 'SPY'
ORDER BY h.holding_rank
LIMIT 10
7 more examples in the Catalog, each listed under the table or function it uses.
Questions it can answer
Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.
- Does SPDR offer an ETF with the ticker SPY, and what is it called?
- What is the expense ratio of the SPDR S&P 500 ETF Trust (SPY)?
- What is the single largest holding of the SPDR S&P 500 ETF Trust (SPY) right now?
- What was the SPDR S&P 500 ETF Trust's (SPY) net asset value on its most recent valuation date?
SPDR ETFs is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.
Related workers
Invesco ETFs
Markets & finance
Invesco US ETF facts, holdings, distributions, and NAV history as SQL tables
iShares ETFs
Markets & finance
Screen the iShares US ETF lineup and query point-in-time fund holdings, distributions and daily NAV history
Vanguard ETFs
Markets & finance
Screen the Vanguard US ETF lineup and query current fund holdings, distributions and daily NAV and price history