Skip to main content
Schema: solana.gov Table: fact_stake_accounts Type: Base Table

What

Description

This table tracks stake accounts on the Solana blockchain, capturing stake delegation, activation, deactivation, and balance changes. Stake accounts represent delegated SOL that contributes to network security and validator voting power, enabling comprehensive staking analytics and delegation pattern analysis. Important Note on Active Stake: To determine if a stake account is actively contributing to consensus during a specific epoch, the stake must satisfy: activation_epoch < epoch AND deactivation_epoch > epoch. Stakes that don’t meet these conditions are either not yet active or in the process of deactivating.

Key Use Cases

  • Track stake delegation patterns and validator selection
  • Analyze stake account lifecycle and balance changes
  • Monitor staking participation and delegation trends
  • Study validator stake distribution and concentration
  • Support staking analytics and reward distribution analysis

Important Relationships

  • Links to gov.fact_validators through vote_pubkey for validator-stake mapping
  • Connects to gov.fact_vote_accounts for vote account analysis
  • References gov.fact_rewards_staking for reward distribution analysis
  • Provides stake context for gov.fact_rewards_voting

Commonly-used Fields

  • epoch: Epoch number for time-series and epoch-based analysis
  • stake_pubkey: Unique stake account address for account tracking
  • vote_pubkey: Vote account that stake is delegated to (validator identification)
  • authorized_staker: Address with staking authority over the account
  • authorized_withdrawer: Address with withdrawal authority over the account
  • active_stake: Current active stake amount in SOL (note: this field shows the delegated amount, but actual active participation requires activation_epoch < epoch AND deactivation_epoch > epoch)
  • activation_epoch, deactivation_epoch: Epochs when stake becomes active/inactive - use these to filter for truly active stakes during a specific epoch
  • type_stake: Stake account type and status
  • account_sol: Total SOL balance in the stake account
  • lockup: Lockup configuration and restrictions

Sample Queries

Current epoch staking summary by delegator

SELECT 
    authorized_staker,
    COUNT(DISTINCT stake_pubkey) AS num_stake_accounts,
    COUNT(DISTINCT vote_pubkey) AS num_validators_delegated,
    SUM(active_stake) AS total_active_stake_sol
FROM solana.gov.fact_stake_accounts
WHERE epoch = (SELECT MAX(epoch) FROM solana.gov.fact_stake_accounts)
    AND active_stake > 0
    AND activation_epoch < epoch
    AND deactivation_epoch > epoch
GROUP BY authorized_staker
HAVING total_active_stake_sol > 100
ORDER BY total_active_stake_sol DESC
LIMIT 100;

Stake account lifecycle analysis

SELECT 
    epoch,
    COUNT(DISTINCT stake_pubkey) AS total_stake_accounts,
    SUM(active_stake)  AS total_active_stake_sol,
    COUNT(DISTINCT CASE WHEN activation_epoch = epoch THEN stake_pubkey END) AS newly_activated,
    COUNT(DISTINCT CASE WHEN deactivation_epoch = epoch THEN stake_pubkey END) AS newly_deactivated,
    COUNT(DISTINCT vote_pubkey) AS validators_with_stake
FROM solana.gov.fact_stake_accounts
WHERE epoch >= (SELECT MAX(epoch) - 10 FROM solana.gov.fact_stake_accounts)
GROUP BY epoch
ORDER BY epoch DESC;

Validator stake distribution analysis

SELECT 
    vote_pubkey,
    COUNT(DISTINCT stake_pubkey) AS delegated_accounts,
    COUNT(DISTINCT authorized_staker) AS unique_delegators,
    SUM(active_stake)  AS total_delegated_sol,
    AVG(active_stake)  AS avg_delegation_sol,
    MIN(activation_epoch) AS earliest_activation,
    MAX(CASE WHEN deactivation_epoch = 18446744073709551615 THEN NULL ELSE deactivation_epoch END) AS latest_deactivation
FROM solana.gov.fact_stake_accounts
WHERE epoch = (SELECT MAX(epoch) FROM solana.gov.fact_stake_accounts)
    AND vote_pubkey IS NOT NULL
    AND active_stake > 0
    AND activation_epoch < epoch
    AND deactivation_epoch > epoch
GROUP BY vote_pubkey
HAVING total_delegated_sol > 1000
ORDER BY total_delegated_sol DESC
LIMIT 50;

Large stake accounts monitoring

SELECT 
    epoch,
    stake_pubkey,
    vote_pubkey,
    authorized_staker,
    authorized_withdrawer,
    active_stake  AS active_stake_sol,
    account_sol  AS total_balance_sol,
    activation_epoch,
    CASE 
        WHEN deactivation_epoch = 18446744073709551615 THEN 'Active'
        ELSE 'Deactivating at epoch ' || deactivation_epoch
    END AS status
FROM solana.gov.fact_stake_accounts
WHERE epoch = (SELECT MAX(epoch) FROM solana.gov.fact_stake_accounts)
    AND active_stake >= 10000  -- 10K+ SOL stakes
    AND activation_epoch < epoch
    AND deactivation_epoch > epoch
ORDER BY active_stake DESC
LIMIT 100;

Columns

Column NameData TypeDescription
EPOCHNUMBEREPOCH column
STAKE_PUBKEYTEXTSTAKE_PUBKEY column
VOTE_PUBKEYTEXTVOTE_PUBKEY column
AUTHORIZED_STAKERTEXTAUTHORIZED_STAKER column
AUTHORIZED_WITHDRAWERTEXTAUTHORIZED_WITHDRAWER column
LOCKUPOBJECTLOCKUP column
RENT_EXEMPT_RESERVENUMBERRENT_EXEMPT_RESERVE column
CREDITS_OBSERVEDNUMBERCREDITS_OBSERVED column
ACTIVATION_EPOCHNUMBERACTIVATION_EPOCH column
DEACTIVATION_EPOCHNUMBERDEACTIVATION_EPOCH column
ACTIVE_STAKEFLOATACTIVE_STAKE column
WARMUP_COOLDOWN_RATENUMBERWARMUP_COOLDOWN_RATE column
TYPE_STAKETEXTTYPE_STAKE column
PROGRAMTEXTPROGRAM column
ACCOUNT_SOLFLOATACCOUNT_SOL column
RENT_EPOCHNUMBERRENT_EPOCH column
FACT_STAKE_ACCOUNTS_IDTEXTA unique, stable identifier for each record in this table. The primary key (PK) ensures that every row is uniquely identifiable and supports efficient joins, lookups, and data integrity across models. The PK may be a natural key (such as a blockchain transaction hash) or a surrogate key generated from one or more fields, depending on the table’s structure and requirements.
INSERTED_TIMESTAMPTIMESTAMP_NTZThe timestamp when this transaction record was first inserted into the analytics database. Used for data freshness tracking and incremental model logic. Format: YYYY-MM-DD HH:MI:SS. Not derived from the blockchain, but from the ETL process.
MODIFIED_TIMESTAMPTIMESTAMP_NTZThe timestamp when this transaction record was last updated in the analytics database. Used for tracking updates and supporting incremental model logic. Format: YYYY-MM-DD HH:MI:SS. Not derived from the blockchain, but from the ETL process.