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

# User Actions

> Tracking of user actions including deposits, withdrawals, transfers, and USDC conversions.

The `polygon.predictions.user_actions` table tracks all user interactions including deposits, withdrawals, transfers, and USDC/USDC.e conversions.

Use this table for user behavior analysis, wallet activity tracking, and understanding fund flows in the prediction market ecosystem.

### Table Columns

Unique Key: `unique_id`

| Column Name                | Data Type         | Description                                                 |
| -------------------------- | ----------------- | ----------------------------------------------------------- |
| project                    | VARCHAR           | Project name (ex. polymarket).                              |
| protocol                   | VARCHAR           | Protocol name (ex. polymarket).                             |
| action                     | VARCHAR           | Type of action (deposit, withdrawal, transfer, convert).    |
| from\_wallet\_type         | VARCHAR           | Wallet creation type of sender (MagicLink or GnosisSafe).   |
| from\_wallet\_description  | VARCHAR           | Human-readable description of sender wallet type.           |
| to\_wallet\_type           | VARCHAR           | Wallet creation type of receiver (MagicLink or GnosisSafe). |
| to\_wallet\_description    | VARCHAR           | Human-readable description of receiver wallet type.         |
| from\_address              | VARCHAR           | Address sending the tokens.                                 |
| to\_address                | VARCHAR           | Address receiving the tokens.                               |
| token\_address             | VARCHAR           | Address of the token being transferred.                     |
| token\_name                | VARCHAR           | Name of the token being transferred.                        |
| token\_symbol              | VARCHAR           | Symbol of the token being transferred (USDC or USDC.e).     |
| raw\_amount\_str           | VARCHAR           | Raw token amount as string (before decimal adjustment).     |
| raw\_amount                | FLOAT             | Raw token amount as float (before decimal adjustment).      |
| amount\_str                | VARCHAR           | Normalized token amount as string.                          |
| amount                     | FLOAT             | Normalized token amount as float.                           |
| usd\_amount                | FLOAT             | USD value of the token amount.                              |
| usd\_exchange\_rate        | FLOAT             | USD exchange rate for the token.                            |
| transaction\_from\_address | VARCHAR           | Transaction originator address.                             |
| transaction\_to\_address   | VARCHAR           | Transaction destination address.                            |
| transaction\_hash          | VARCHAR           | Transaction hash containing the action.                     |
| transaction\_index         | NUMBER            | Index of the transaction in the block.                      |
| log\_index                 | NUMBER            | Index of the log within the transaction.                    |
| block\_timestamp           | TIMESTAMP\_NTZ(9) | Timestamp of the block containing the action.               |
| block\_number              | NUMBER            | Block number containing the action.                         |
| block\_hash                | VARCHAR           | Hash of the block containing the action.                    |
| unique\_id                 | VARCHAR           | Unique identifier for the transfer event.                   |
| \_created\_at              | TIMESTAMP\_NTZ(9) | Record creation timestamp.                                  |
| \_updated\_at              | TIMESTAMP\_NTZ(9) | Record update timestamp.                                    |

***

### Sample Query

<Tabs>
  <Tab title="User Type Analysis">
    Analyze user deposits and withdrawals by wallet type:

    ```sql theme={null}
    select
      action,
      CASE
        when action = 'deposit' then to_wallet_type
        when action = 'withdrawal' then from_wallet_type
      END AS wallet_type,
      count(*) as action_count
    from polygon.predictions.user_actions
    where block_timestamp >= current_timestamp - interval '30 days'
    and (action = 'withdrawal' or action = 'deposit')
    group by action, wallet_type
    ```
  </Tab>
</Tabs>
