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

# Events

> Detailed tracking of staking-related events on NEAR Protocol

# Overview

The `near.staking.events` model captures all staking-related events from validator pools, tracking deposits, staking, unstaking, and withdrawals.
Events are extracted from receipt event logs.

This model is updated hourly.

## Event Types

A typical staking event flows in the following order:

1. Deposit: Initial transfer of NEAR tokens to the staking pool
2. Staking: Conversion of deposited NEAR to staking shares
3. Unstaking: Withdrawal of NEAR from active staking
4. Withdrawal: Final transfer of unstaked NEAR back to delegator

When a delegator stakes NEAR with a validator, they receive staking shares in return.
These staking shares can be redeemed for NEAR at any time. The exchange rate between NEAR and staking shares is tracked in the `near.staking.shares_exchange_rate` model.

### Column Description

Unique Key: `unique_id`

| Column                  | Type              | Description                                                        |
| ----------------------- | ----------------- | ------------------------------------------------------------------ |
| block\_timestamp        | TIMESTAMP\_NTZ(9) | Timestamp of the block containing the event                        |
| event\_type             | VARCHAR           | Type of staking event (deposit, staking, unstaking, withdraw)      |
| delegator\_id           | VARCHAR           | Identifier of the delegator involved in the event                  |
| pool\_id                | VARCHAR           | Identifier of the staking pool involved                            |
| amount\_str             | VARCHAR           | Amount of NEAR involved in the event (string format for precision) |
| amount                  | FLOAT             | Amount of NEAR involved in the event (float format)                |
| usd\_amount             | FLOAT             | USD equivalent of the NEAR amount                                  |
| usd\_exchange\_rate     | FLOAT             | NEAR to USD exchange rate at event time                            |
| unstaked\_balance\_str  | VARCHAR           | Unstaked NEAR balance after the event (string format)              |
| unstaked\_balance       | FLOAT             | Unstaked NEAR balance after the event (float format)               |
| staking\_shares\_str    | VARCHAR           | Staking shares involved in the event (string format)               |
| shares\_exchange\_rate  | VARCHAR           | Shares to NEAR exchange rate at event time (string format)         |
| signer\_id              | VARCHAR           | Account that signed the transaction                                |
| transaction\_hash       | VARCHAR           | Unique hash of the transaction                                     |
| transaction\_index      | BIGINT            | Index of the transaction in the block                              |
| receipt\_id             | VARCHAR           | Unique identifier of the receipt                                   |
| receipt\_index          | BIGINT            | Index of the receipt in the block                                  |
| receipt\_outcome\_index | BIGINT            | Index of the receipt outcome                                       |
| log\_index              | BIGINT            | Index of the log within the receipt                                |
| pseudo\_global\_index   | BIGINT            | Global ordering index                                              |
| unique\_id              | VARCHAR           | Unique identifier for the event                                    |
