Skip to content

v0.1.0

Choose a tag to compare

@rustyconover rustyconover released this 14 Nov 16:35
· 13 commits to main since this release

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) and series (about 2,400 recurring question series). Both are paged and stop early under LIMIT.
  • Paged scans: search(query), markets(...) and events(...), 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, positions and activity.

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 via quote(), and computes amount * 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 live quote() 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.
  • markets and events are 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-python and ../vgi-rpc checkouts for development. Installed packages use the published versions.
  • vgi-lint reports 3 VGI417 warnings: the result_columns_schema metadata on markets, market and event_markets is oversized.