WITH
table1 AS
(
SELECT DISTINCT from_address, blockchain,
MIN(block_id) AS first_swapped_block, MIN(block_timestamp) AS first_swapped_timestamp
FROM thorchain.swaps
GROUP BY from_address, blockchain
)
SELECT DISTINCT first_swapped_block, first_swapped_timestamp, blockchain,
COUNT(from_address) OVER(PARTITION BY blockchain ORDER BY first_swapped_block ASC) AS chain_specific_cumulative_swapper_addresses,
COUNT(from_address) OVER(ORDER BY first_swapped_block ASC) AS all_chains_cumulative_swapper_addresses
--This isn't usable from the same table; use in a duplicate table.
FROM table1
ORDER BY first_swapped_block DESC