> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dune.com/llms.txt
> Use this file to discover all available pages before exploring further.

# polymarket_polygon.market_actions

> Polymarket position lifecycle actions — splits, merges, redemptions, and neg-risk converts with market context.

export const TableSample = ({tableName, tableSchema}) => <>
    <div className="hidden dark:block">
      <iframe src={`https://dune.com/embeds/3419983/5785629?table_schema_t6f0df=${tableSchema}&table_name_t6f0df=${tableName}&darkMode=true`} style={{
  width: '100%',
  height: '500px',
  border: 'none',
  marginTop: '10px'
}} />
    </div>
    <div className="dark:hidden">
      <iframe src={`https://dune.com/embeds/3419983/5785629?table_schema_t6f0df=${tableSchema}&table_name_t6f0df=${tableName}`} style={{
  width: '100%',
  height: '500px',
  border: 'none',
  marginTop: '10px'
}} />
    </div>
  </>;

The `polymarket_polygon.market_actions` table contains position lifecycle actions on the CTF stack — splits, merges, redemptions, and neg-risk converts — enriched with condition-level market context from `market_details`. One row per user-level action; trade fills live in `market_trades`. Settlement-internal splits/merges are excluded by construction — those are the mint/merge legs of CLOB fills and live in `market_trades`.

<Info>
  `condition_id` and `event_market_id` are never both populated on the same row: split/merge/redemption rows key on `condition_id`, convert rows key on `event_market_id`. To get a market's full action history, filter on `condition_id` for split/merge/redemption and separately on `event_market_id` for convert.
</Info>

## Table Schema

| Column | Type | Description |
| - | - | - |
| `block_month` | `DATE` | UTC month of the event block time (partition key) |
| `block_time` | `TIMESTAMP` | UTC event block time |
| `block_number` | `BIGINT` | Block number in which the action was executed |
| `action` | `VARCHAR` | Lifecycle action type (`split`, `merge`, `redemption`, `convert`) |
| `condition_id` | `VARBINARY` | CTF condition ID (bytes32); NULL on convert rows (keyed by `event_market_id` instead) |
| `event_market_id` | `VARBINARY` | NegRiskAdapter market ID of the overarching multi-outcome event (convert rows only); joins `market_details.event_market_id` (varchar there) — not a CTF condition ID |
| `question` | `VARCHAR` | Concrete outcome being bet on (from `market_details`) |
| `event_market_name` | `VARCHAR` | Overarching question for negRisk markets |
| `polymarket_link` | `VARCHAR` | Link to the Polymarket site (may be broken for archived markets) |
| `neg_risk` | `VARCHAR` | Whether the condition belongs to a neg-risk market |
| `index_sets` | `ARRAY(UINT256)` | Outcome index sets of the action: the partition of CTF splits/merges, the redeemed index sets of CTF redemptions, the converted outcome bitmask of converts; NULL for adapter actions (full YES/NO set implied) |
| `stakeholder` | `VARBINARY` | Address whose position is acted on; may be a Polymarket router/proxy contract — see `tx_from` for the sender |
| `amount` | `DOUBLE` | Share/set quantity (= USDC collateral moved 1:1 for splits/merges). NULL for CTF and auto redemptions (not emitted) |
| `payout` | `DOUBLE` | Collateral returned by redemptions in USD; NULL otherwise |
| `is_auto_redeemed` | `BOOLEAN` | On redemptions: TRUE when executed by the AutoRedeemer on the user's behalf; NULL for non-redemption actions |
| `collateral_token` | `VARBINARY` | Collateral token of CTF events; NULL for adapter/AutoRedeemer events |
| `parent_collection_id` | `VARBINARY` | CTF parent collection ID (0x00 for Polymarket's flat binary positions); NULL for adapter/AutoRedeemer events |
| `contract_address` | `VARBINARY` | Contract that emitted the event (CTF, NegRiskAdapter, or AutoRedeemer proxy) |
| `evt_index` | `INTEGER` | Index of the event within the transaction |
| `tx_hash` | `VARBINARY` | Transaction hash |
| `tx_from` | `VARBINARY` | Transaction sender — useful when `stakeholder` is a router/operator contract |
| `_updated_at` | `TIMESTAMP` | When this row was last inserted or updated by the dbt pipeline |

## Table sample

<TableSample tableSchema="polymarket_polygon" tableName="market_actions" />

## Example query

```sql theme={null}
-- Redemption payouts by market over the last 30 days
SELECT
  question,
  SUM(payout) AS payout_usd,
  COUNT(*) AS num_redemptions
FROM polymarket_polygon.market_actions
WHERE action = 'redemption'
  AND block_time >= NOW() - INTERVAL '30' DAY
GROUP BY 1
ORDER BY 2 DESC
LIMIT 20
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.