> ## 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.

# Staking Events

> Unified staking events including delegations, undelegations, and withdrawals on Monad

This table captures all staking-related events on Monad, providing a comprehensive record of delegations, undelegations, and withdrawals. It includes the validator's `auth_address` through a join with validator creation data.

## Table Schema

| Column Name        | Data Type | Description                                                                                                               |
| ------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------- |
| event\_type        | VARCHAR   | Type of staking event (delegate, undelegate, withdraw)                                                                    |
| delegator\_address | VARCHAR   | Address of the delegator performing the action                                                                            |
| validator\_id      | VARCHAR   | Unique identifier of the validator (integer as string)                                                                    |
| auth\_address      | VARCHAR   | The validator's authorization/operator address (from validator\_creation join)                                            |
| amount\_str        | VARCHAR   | String representation of the MON amount for precision                                                                     |
| amount             | DECIMAL   | Float representation of the MON amount                                                                                    |
| activation\_epoch  | INTEGER   | Epoch when the action takes effect. For delegate/undelegate, this is activationEpoch. For withdraw, this is withdrawEpoch |
| withdraw\_id       | VARCHAR   | Unique identifier for the withdrawal request (null for delegate events)                                                   |
| extra\_fields      | VARIANT   | Raw parameters from the event                                                                                             |
| transaction\_hash  | VARCHAR   | Hash of the transaction containing the event                                                                              |
| transaction\_index | INTEGER   | Index of the transaction in the block                                                                                     |
| log\_index         | INTEGER   | Index of the event log in the transaction                                                                                 |
| block\_timestamp   | TIMESTAMP | Timestamp of the block containing the event                                                                               |
| block\_number      | INTEGER   | Block number containing the event                                                                                         |
| block\_hash        | VARCHAR   | Hash of the block containing the event                                                                                    |
| unique\_id         | VARCHAR   | Unique identifier for the event                                                                                           |

## Event Types

### Delegate

A delegation event occurs when a delegator stakes MON tokens with a validator. The `activation_epoch` indicates when the delegation becomes active and starts earning rewards.

### Undelegate

An undelegation event occurs when a delegator initiates the unstaking process. The `activation_epoch` indicates when the undelegation takes effect.

### Withdraw

A withdrawal event occurs when a delegator claims their previously undelegated tokens. The `activation_epoch` represents the `withdrawEpoch` when the withdrawal is processed. Each withdrawal has a unique `withdraw_id`.

## Sample Query

Find the top delegators by total delegated amount:

```sql theme={null}
SELECT
  delegator_address,
  SUM(CASE WHEN event_type = 'delegate' THEN amount ELSE 0 END) as total_delegated,
  SUM(CASE WHEN event_type = 'undelegate' THEN amount ELSE 0 END) as total_undelegated,
  COUNT(*) as total_events
FROM monad.staking.events
GROUP BY delegator_address
ORDER BY total_delegated DESC
LIMIT 100;
```
