Repository navigation
v0.1.0
First release of vgi-polymarket, a read-only VGI worker that brings Polymarket prediction-market data into DuckDB/Haybarn SQL: markets, outcomes, order books, quotes, price history and trades. Polymarket settles on a public chain, so it also covers who holds each position and what else they hold. It needs no credentials and accepts none.
Install
-- uvx haybarn-cli
ATTACH 'polymarket' (TYPE vgi, LOCATION 'uvx --from git+https://github.com/Query-farm/vgi-polymarket@v0.1.0 vgi-polymarket');
SELECT count(*) FROM polymarket.tags;This is a source-only release. Nothing is published to PyPI.
Surface
- Tables:
tags(about 7,300 topics) andseries(about 2,400 recurring question series). Both are paged and stop early underLIMIT. - Paged scans:
search(query),markets(...)andevents(...), all filterable by tag, slug, status and ordering. - Per-key functions that also work under LATERAL:
market,event,event_markets,orderbook,quote,fill_price(token_id, side, size),price_history(token_id, period, fidelity),trades,holders,positionsandactivity.
Composed examples
- Holders marked to market: takes the busiest open market, then its top holders per outcome via
holders(), then each outcome's live midpoint viaquote(), and computesamount * midpoint. - Weekly movers: for each outcome of the five busiest open markets, compares the first point of its one-week hourly
price_history()with its livequote()midpoint, ranked by the absolute change.
The agent tasks in vgi.agent_test_tasks are graded with check_sql invariants, because the data is live.
Known limits
- Live, unauthenticated public API: results move between runs and are subject to Polymarket's rate limits. Order placement is not supported, by design.
marketsandeventsare paged scans, so they cannot be the inner side of a correlated LATERAL. Drive joins from them instead.- The entry-point scripts' PEP 723 headers point at sibling
../vgi-pythonand../vgi-rpccheckouts for development. Installed packages use the published versions. - vgi-lint reports 3 VGI417 warnings: the
result_columns_schemametadata onmarkets,marketandevent_marketsis oversized.