Polymarket data on Polygon
On Polygon, BlockJuice loads Polymarket’s prediction markets into a Postgres you run. It reads each market’s preparation and resolution, every fill of the three CTF Exchange v2 contracts, and the splits, merges, redemptions and conversions of ConditionalTokens. dbt builds them into five tables you query with SQL.
Coverage
Polymarket is the only Polygon data BlockJuice loads today. The tables cover every market from the block the stream sources start at. If you list wallets, new runs load only their fills, splits, merges, redemptions and conversions. Markets and resolutions still load for every market. Amounts are whole pUSD and whole shares, not base units.
- Modules
- 01
- Tables
- 05
- Columns
- 69
Polymarket
Polymarket's prediction markets on Polygon. A market is one condition in ConditionalTokens, with one outcome token per outcome. Once the market resolves, a share of each outcome redeems for that outcome's payout fraction in pUSD. Amounts are whole pUSD and whole shares, not base units. The addresses.json files list Polymarket's own contracts, so the tables cover every market, from the block the stream sources start at. A market prepared before that block has history_complete false, and its trades, candles and PnL miss what came before.
- analytics.polymarket_marketsOne row per market.14 columns
- analytics.polymarket_tradesOne row per fill of a maker order.17 columns
- analytics.polymarket_wallet_fillsOne row per fill per wallet: every OrderFilled, read for the wallet whose pUSD or shares moved, with its role in the match.13 columns
- analytics.polymarket_price_candlesOne row per outcome token and minute, in pUSD per share.11 columns
- analytics.polymarket_market_participantsOne row per market and wallet: every wallet that traded, split, merged, redeemed or converted in the market.14 columns
uv run --project orchestration bj run polymarketQuery it
select condition_id, wallet, trades, net_cash_usdc, position_value_usdc, pnl_usdc
from analytics.polymarket_market_participants
where resolved
order by pnl_usdc desc
limit 20Each row is one wallet in one resolved market: the cash it got after fees, and what its shares are worth.
Load it
- Polymarket needs no list. To follow some wallets only, list them in each Polygon source’s addresses.json.
- Build the tables with
bj run <pipeline>, or turn on the pipeline’s schedule in Dagster to rebuild them each day at 06:00 UTC. - Query the analytics schema in your Postgres with SQL, or ask in plain language with /bj <question>.