Typed struct for a single normalized Polymarket activity event.
Produced by Polymarket.Activity.normalize/1. Each event corresponds to
one row from Polymarket's public Data API /activity endpoint and
represents either a trade fill (type: :trade with side: :buy | :sell)
or a market redemption (type: :redeem).
The original raw map is preserved under the :raw field so callers can
recover any field this struct does not normalize without re-parsing.
Fields
:type—:trade,:redeem, or:unknown.:side—:buy,:sell, ornil(alwaysnilfor:redeem).:tx_hash— on-chain transaction hash (used to join activity ↔ fills).:condition_id— the market condition id this event belongs to.:token_id— outcome token id (asset id).:usdc_size— fee-inclusive USDC amount. For BUYs this is the wallet debit including taker fee; for SELLs it is the credit. For REDEEMs it is the payout.:shares— number of outcome tokens involved (Polymarket sends this assizeon the wire).:price— execution price per share (TRADE only).:timestamp— Unix-seconds timestamp.:raw— the raw map this struct was normalized from.
Summary
Types
@type side() :: :buy | :sell | nil
@type type() :: :trade | :redeem | :unknown