permarytotal locked & unlocked tokens over time
    Updated 2025-04-05
    with
    locked as (
    select
    date_trunc('day', block_timestamp) as day,
    count(distinct tx_hash) as total_locks,
    count(distinct origin_from_address) as unique_lockers
    from swell.core.ez_decoded_event_logs
    where event_name = 'LockCreated'
    group by 1
    ),
    unlocked as (
    select
    date_trunc('day', block_timestamp) as day,
    count(distinct tx_hash) as total_unlocks,
    count(distinct origin_from_address) as unique_unlockers
    from swell.core.ez_decoded_event_logs
    where event_name = 'LockRemoved'
    group by 1
    )

    select
    coalesce(l.day, u.day) as day,
    coalesce(total_locks, 0) as total_locks,
    coalesce(unique_lockers, 0) as unique_lockers,
    coalesce(total_unlocks, 0) as total_unlocks,
    coalesce(unique_unlockers, 0) as unique_unlockers
    from locked l
    full outer join unlocked u
    on l.day = u.day
    order by day;

    Last run: 2 months ago
    DAY
    TOTAL_LOCKS
    UNIQUE_LOCKERS
    TOTAL_UNLOCKS
    UNIQUE_UNLOCKERS
    1
    2024-12-18 00:00:00.0002211
    2
    2024-12-19 00:00:00.0006600
    3
    2024-12-20 00:00:00.000242400
    4
    2024-12-21 00:00:00.000303000
    5
    2024-12-22 00:00:00.000414111
    6
    2024-12-23 00:00:00.000353500
    7
    2024-12-24 00:00:00.000414100
    8
    2024-12-25 00:00:00.000484800
    9
    2024-12-26 00:00:00.000505000
    10
    2024-12-27 00:00:00.000525100
    11
    2024-12-28 00:00:00.000565500
    12
    2024-12-29 00:00:00.000666500
    13
    2024-12-30 00:00:00.000605911
    14
    2024-12-31 00:00:00.000969600
    15
    2025-01-01 00:00:00.000888800
    16
    2025-01-02 00:00:00.00010910900
    17
    2025-01-03 00:00:00.000808000
    18
    2025-01-04 00:00:00.000626200
    19
    2025-01-05 00:00:00.000505000
    20
    2025-01-06 00:00:00.000878700
    ...
    109
    4KB
    2s