home / api

blocktivity (view)

1 row

✎ View and edit SQL

This data as json, CSV (advanced)

transactions period_start period_end updated_at chain chain_id period from_block to_block transaction_definition
2311 2026-11-30T05:00:00Z 2026-12-01T04:59:59Z 2026-12-01T05:16:19Z Saito mainnet 24h 1250649 1253421 successful user-submitted

Advanced export

JSON shape: default, array, newline-delimited

CSV options:

CREATE VIEW blocktivity AS
WITH w AS (
  SELECT
    (CAST(strftime('%s', 'now') AS INTEGER) / 3600) * 3600 - 86400 AS start_s,
    (CAST(strftime('%s', 'now') AS INTEGER) / 3600) * 3600         AS end_s
)
SELECT
  COUNT(*)                                                        AS transactions,
  strftime('%Y-%m-%dT%H:%M:%SZ', w.start_s,   'unixepoch')        AS period_start,
  strftime('%Y-%m-%dT%H:%M:%SZ', w.end_s - 1, 'unixepoch')        AS period_end,
  strftime('%Y-%m-%dT%H:%M:%SZ', 'now')                           AS updated_at,
  'Saito'                                                         AS chain,
  'mainnet'                                                       AS chain_id,
  '24h'                                                           AS period,
  MIN(t.block_id)                                                 AS from_block,
  MAX(t.block_id)                                                 AS to_block,
  'successful user-submitted'                                     AS transaction_definition
FROM w
LEFT JOIN mainnet t
  ON  t.block_time >= w.start_s * 1000
  AND t.block_time <  w.end_s   * 1000
  AND t.tx_type IN (0, 8)
  AND t.tx_module <> 'spam'
/* blocktivity(transactions,period_start,period_end,updated_at,chain,chain_id,period,from_block,to_block,transaction_definition) */;
Powered by Datasette · Queries took 6267.245ms