Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Verified Solana examples

These queries are stored under examples/solana/ and executed against the live database during every strict docs build. Each scan is constrained by time or by the newest data window.

Transfer and funding activity

token_transfers and sol_top_ups are intentionally separate helper tables. This query combines their hourly counts without joining individual records. It is adapted from the workflow introduced in Two New Solana Tables: token_transfers and sol_top_ups.

WITH
    toStartOfHour(now()) AS end_hour,
    end_hour - INTERVAL 24 HOUR AS start_hour
SELECT
    hour,
    sum(token_transfers) AS token_transfers,
    sum(sol_top_ups) AS sol_top_ups
FROM
(
    SELECT toStartOfHour(block_time) AS hour,
           count() AS token_transfers, 0 AS sol_top_ups
    FROM token_transfers
    PREWHERE block_time >= start_hour AND block_time < end_hour
    GROUP BY hour
 
    UNION ALL
 
    SELECT toStartOfHour(block_time) AS hour,
           0 AS token_transfers, count() AS sol_top_ups
    FROM sol_top_ups
    PREWHERE block_time >= start_hour AND block_time < end_hour
    GROUP BY hour
)
GROUP BY hour
ORDER BY hour

Source: examples/solana/transfer_activity.sql.

PumpSwap reserve and fee reconciliation

PumpSwap rows expose before/after pool reserves, exact-quote mode, virtual quote reserves, and protocol, LP, creator, cashback and buyback fee fields. The full query in examples/solana/pumpswap_reserve_checks.sql verifies three identities for the latest 25 swaps:

  • base reserve movement equals base_token_amount;
  • quote reserve movement equals quote_token_amount; and
  • quote_token_amount_without_lp_fee reconciles with the appropriate fee path for buys, sells and exact-quote buys.

It also selects virtual_quote_reserves, coin_creator, coin_creator_fees, cash_back_fees, and buy_back_fees, making the accounting inputs visible beside the checks. This example is based on the field-level accounting described in 10 New Columns in pumpswap_all_swaps.

Run it directly with the repository verifier:

python3 scripts/verify_examples.py --strict-live

The verifier fails if any returned row has a false reconciliation flag.

Creator migration rates

The creator example takes the latest timestamp present in pumpfun_token_creation, builds a 30-day window ending there, and joins mints to pfamm_migrations. Anchoring to the dataset rather than the wall clock keeps the query reproducible for snapshots and retained archives.

The result contains token counts, migrated counts, migration percentage and the creator's first/last launch time. It is inspired by the cohort construction in Pump.fun’s Creator Economy Is a Barbell.

# Source query
sed -n '1,220p' examples/solana/creator_migration_rates.sql
 
# Execute all bounded examples
python3 scripts/verify_examples.py --strict-live

Fixed-width mint and creator fields are normalized by removing their null-byte padding before the join and grouping.