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

### Table Details

| Property | Value |
| - | - |
| Table Name | `near.staking.events` |
| Table Status | Production-Ready |
| Unique Key | `block_timestamp`, `unique_id` |
| Clustering Key(s) | `block_timestamp::date, event_type, pool_id` |

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

### Table Columns

| Column Name | Data Type | Description |
| - | - | - |
| block\_timestamp | TIMESTAMP\_NTZ(9) | Timestamp of the block containing the event |
| block\_height | NUMBER(38,0) | Number of confirmed blocks between this block and the genesis block (inclusive). Unlike `block_slot`, this only increments for slots that produced a block. |
| event\_type | VARCHAR(16777216) | Type of staking event (deposit, staking, unstaking, withdraw) |
| delegator\_id | VARCHAR(16777216) | Identifier of the delegator involved in the event |
| pool\_id | VARCHAR(16777216) | Identifier of the staking pool involved |
| amount\_str | VARCHAR(16777216) | 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(16777216) | Unstaked NEAR balance after the event (string format) |
| unstaked\_balance | FLOAT | Unstaked NEAR balance after the event (float format) |
| staking\_shares\_str | VARCHAR(16777216) | Staking shares involved in the event (string format) |
| shares\_exchange\_rate | VARCHAR(16777216) | Shares to NEAR exchange rate at event time (string format) |
| signer\_id | VARCHAR(16777216) | Account that signed the transaction |
| transaction\_hash | VARCHAR(16777216) | Unique hash of the transaction |
| transaction\_index | NUMBER(38,0) | Index of the transaction in the block |
| receipt\_id | VARCHAR(16777216) | Unique identifier of the receipt |
| receipt\_index | NUMBER(38,0) | Index of the receipt in the block |
| receipt\_outcome\_index | NUMBER(38,0) | Index of the receipt outcome |
| log\_index | NUMBER(38,0) | Index of the log within the receipt |
| pseudo\_global\_index | NUMBER(38,0) | Global ordering index |
| unique\_id | VARCHAR(16777216) | Unique identifier for the event |
| \_created\_at | TIMESTAMP\_NTZ(9) | Timestamp of when the entry was created in the database. |
| \_updated\_at | TIMESTAMP\_NTZ(9) | Timestamp of when the entry was last updated in the database. |
| \_changed\_since\_full\_refresh | BOOLEAN | Indicates if the record has changed since the last full data refresh. |
