← All chains
Chains · POL

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.

uv run --project orchestration bj run polymarket

Query 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 20

Each row is one wallet in one resolved market: the cash it got after fees, and what its shares are worth.

Load it

  1. Polymarket needs no list. To follow some wallets only, list them in each Polygon source’s addresses.json.
  2. 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.
  3. Query the analytics schema in your Postgres with SQL, or ask in plain language with /bj <question>.