OwentellFlash Bounty: An Odyessy of Congestion (6)
    Updated 2022-09-27
    WITH tx_status AS (
    SELECT DATE_TRUNC('DAY', block_timestamp) as day,
    CASE
    WHEN status = 'SUCCESS' THEN 'success'
    ELSE 'fail'
    END as type, COUNT(*) as num_transactions
    FROM arbitrum.core.fact_transactions
    WHERE block_timestamp < current_date
    GROUP BY day, type
    ),

    tps AS (
    SELECT DATE_TRUNC('MIN', block_timestamp) as min, COUNT(*) / 60 as tps
    FROM arbitrum.core.fact_transactions
    GROUP BY min
    ),

    yield AS (
    SELECT DATE_TRUNC('DAY', block_timestamp) as hour, COUNT(*) as num_transactions1,
    COUNT(DISTINCT from_address) as num_unique1
    FROM arbitrum.core.fact_transactions
    WHERE to_address = LOWER('0x16e25cf364cecc305590128335b8f327975d0560')
    GROUP BY hour
    ),

    gmx AS (
    SELECT DATE_TRUNC('DAY', block_timestamp) as hour, COUNT(*) as num_transactions2,
    COUNT(DISTINCT from_address) + COUNT(DISTINCT to_address) as num_unique2
    FROM arbitrum.core.fact_transactions
    WHERE to_address = LOWER('0xabbc5f99639c9b6bcb58544ddf04efa6802f4064')
    OR to_address = LOWER('0x3d6ba331e3d9702c5e8a8d254e5d8a285f223aba')
    GROUP BY hour
    ),

    contract_tx AS (
    SELECT DATE_TRUNC('HOUR', block_timestamp) as hour,
    Run a query to Download Data