Repository navigation
Releases
v0.2.1
Container image for Orchard hosted mode.
ghcr.io/query-farm/vgi-polymarket:0.2.1(also:0.2,:latest), multi-arch (amd64 + arm64), published by.github/workflows/docker-publish.ymlafter CI passes.- One image, two transports: HTTP on
$PORT(default 8000) by default,stdiofor on-host use. Runs as a non-root user with a writable home; HEALTHCHECK usesHEAD /health. - Hosted mode (
VGI_ORCHARD_HOSTED=1) is built into vgi-python 0.55 (VGI protocol 3.4). Credentials come from DuckDB secrets.
docker run --rm -p 8000:8000 ghcr.io/query-farm/vgi-polymarket:0.2.1
v0.2.0
v0.1.3
v0.1.1
Fixed
market(condition_id)returned no row for any resolved market. Gamma's
/markets/keysetappliesclosed=falsewhen the parameter is omitted, even
to an explicitcondition_idsfilter, so a market that had closed was
invisible to its own id. Ids the open pass misses are now looked up again
withclosed=true(one extra request, only when something is missing). The
same lookup backs every correlatedLATERAL polymarket.main.market(...).- The first
orderbook()example took the single busiest open market's first
outcome, which is often a game that has just ended with an empty book. It
now takes one outcome among the ten busiest that has resting orders, so the
example shows real depth.
Documentation
-
markets()andevents()documentedclosedas if omitting it always
returned open and settled rows together. Checked against the live API, that
holds only forevents():/markets/keysettreats a missingclosedas
false, somarkets()without it returns open markets only, including a
slugorcondition_idlookup for a resolved market. The argument docs,
themarkets()agent and catalog docs, and the README now say so, and point
atclosed => 'true'ormarket()for resolved markets. -
The catalog docs link to the upstream service and its API documentation
(VGI183): polymarket.com, the Polymarket API reference, the Gamma and CLOB
OpenAPI specs, the Data API v2 docs and the market-data overview, and state
the Polymarket Terms of Use (also linked from the README). -
Per-function detail in the catalog overview (the spread check behind
quote(), order-book batching costs) is shortened to a pointer; those
functions' own docs already carry it. This also keepsvgi.doc_mdinside the
4,000-character agent context limit (VGI417). -
vgi-lint.tomlwaives VGI417 for the 33-column market row's
vgi.result_columns_schemaonmarkets,marketandevent_markets, as
the Kalshi worker does for its market row. -
vgi-lint.tomlraises the slow-example warning bar to 10 s: the live
examples run concurrently under--executeand land at 5-8 s together
against 1-2.5 s alone. -
README's pinned-install example now pins v0.1.1.
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.