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

# Wallet Ledger

> Per-wallet share and cash movements on Polymarket, decoded from Polygon contract events

> [!NOTE]
>
> This is an **early access** dataset available through [SQL](https://docs.probalytics.io/docs/sql-guide/overview.md). To request access, email [support@probalytics.io](mailto:support@probalytics.io).

Wallet-level share and cash movements decoded from Polymarket contract events on Polygon. One on-chain event can produce several rows, for example one for the sender and one for the receiver of a transfer. Polymarket's own contracts (exchanges, adapters, the zero address) are excluded as wallets.

**All amounts are raw integers with 6 decimals**: divide by `1e6` to get shares or USDC.

| Field | Type | Values and meaning |
| - | - | - |
| `wallet` | `string` | Lowercase wallet address. |
| `block_number`, `block_time`, `log_index`, `tx_hash` | | Source Polygon block, block time (UTC), log index, and transaction hash. |
| `kind` | `string` | Movement type, see below. |
| `token_contract` | `string` | `ConditionalTokens` or `PositionManager` for share rows. |
| `token_id` | `string` | Outcome token ID for share rows. Matches `markets.outcomes.platform_id` for Polymarket. |
| `condition_id` | `string` | Condition ID for `split`, `merge`, `convert`, and `redeem` rows. |
| `direction` | `Int8` | `1` or `-1`. For transfers, `1` = received, `-1` = sent. For trades, `-1` = bought, `1` = sold. For cash rows, the sign of the cash flow. |
| `shares_delta` | `Int128` | Change in the wallet's token balance (transfer rows). |
| `trade_shares` | `Int128` | Shares traded (trade rows). Volume only: the balance change is in the matching transfer row. |
| `usdc_delta` | `Int128` | Cash into (+) or out of (−) the wallet. |
| `fee` | `Int128` | Fee paid (trade rows) or refunded as a negative value (`fee_refund`). |
| `transfer_delta` | `Int128` | Collateral moved in (+) or out (−) by plain transfers (`cash_transfer`). |
| `removed` | `bool` | `true` if the source log was dropped by a reorg. |
| `indexed_at` | `DateTime64(9)` | Time Probalytics wrote this row. |

| `kind` | Source |
| - | - |
| `trade` | `OrderFilled` on the exchanges, Markit settlements. `wallet` is the owner of the filled order. |
| `transfer` | ERC-1155 `TransferSingle` / `TransferBatch` of outcome tokens. |
| `split` | Collateral locked to mint a full set of outcome tokens. |
| `merge` | Full set burned for collateral. |
| `convert` | NegRisk position conversion. |
| `redeem` | Payout after resolution, including auto-redemptions. |
| `fee_refund` | Fee refunded by a fee module. |
| `cash_transfer` | Collateral token transfers and wraps between non-protocol addresses. |

The table can briefly hold more than one version of a row. Use `FINAL` or `argMax(..., indexed_at)` for exact sums, and always add `NOT removed`.

```sql theme={null}
SELECT block_time, kind, token_id,
       shares_delta / 1e6 AS shares,
       usdc_delta / 1e6 AS usdc
FROM polymarket_wallet_ledger FINAL
WHERE wallet = lower('0xYourWallet')
  AND NOT removed
ORDER BY block_number, log_index
```


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