messariDaily Share of Transactions Across Defi Activity Types copy
    Updated 2024-10-29
    -- forked from hess / Daily Share of Transactions @ https://flipsidecrypto.xyz/hess/q/JczMk_Rah6XQ/daily-share-of-transactions

    with liquid as (select tx_id
    from sei.core.fact_msg_attributes
    where attribute_key = '_contract_address'
    and attribute_value in ('sei1ln7ntsqmxl8s502f83km9a475zyhcfhpj7v2fsm3pcmckdyys3tsktx9vk','sei1e3gttzq5e5k49f9f5gzvrl0rltlav65xu6p9xc0aj7e84lantdjqp7cncc')
    and tx_succeeded = 'true'
    and block_timestamp::Date >= '2023-12-01'
    )
    ,
    liquid_user as ( select block_timestamp::Date as date,
    'Liquid Staking' as type,
    a.tx_id,
    attribute_value as user
    from sei.core.fact_msg_attributes a join liquid b on a.tx_id = b.tx_id
    where block_timestamp::Date >= '2023-12-01'
    and attribute_key = 'fee_payer'
    UNION all
    select block_timestamp::Date as date,
    'Spot Trading' as type,
    tx_id,
    swapper as user
    from sei.defi.fact_dex_swaps
    UNION all
    select block_timestamp::Date as date,
    'Liquidity' as type,
    tx_id,
    LIQUIDITY_PROVIDER_ADDRESS as user
    from sei.defi.fact_lp_actions
    UNION
    select block_timestamp::Date as date,
    'Lending and Borrow' as type,
    tx_hash as tx_id,
    origin_from_address as user
    from sei.core_evm.fact_event_logs a join sei.core_evm.dim_contracts b on a.contract_address = b.address
    where name ilike '%yei%'
    Last run: 6 days ago
    DATE
    TYPE
    TX
    USERS
    1
    2024-10-03 00:00:00.000Lending and Borrow1029278
    2
    2024-06-21 00:00:00.000Spot Trading380115
    3
    2024-04-14 00:00:00.000Liquid Staking14593
    4
    2024-07-10 00:00:00.000Liquid Staking792551
    5
    2024-04-02 00:00:00.000Spot Trading1831551
    6
    2023-08-22 00:00:00.000Spot Trading1034367
    7
    2024-11-17 00:00:00.000Lending and Borrow884211
    8
    2024-06-24 00:00:00.000Spot Trading680119
    9
    2024-03-11 00:00:00.000Liquidity39383
    10
    2023-12-29 00:00:00.000Liquidity583133
    11
    2024-09-14 00:00:00.000Lending and Borrow2748536
    12
    2024-11-18 00:00:00.000Spot Trading1109157
    13
    2025-01-05 00:00:00.000Lending and Borrow931317
    14
    2024-02-20 00:00:00.000Liquidity265111
    15
    2024-12-07 00:00:00.000Spot Trading339130
    16
    2024-03-22 00:00:00.000Liquid Staking321212
    17
    2024-10-09 00:00:00.000Spot Trading761120
    18
    2024-06-06 00:00:00.000Spot Trading545163
    19
    2024-06-11 00:00:00.000Lending and Borrow105962
    20
    2025-01-05 00:00:00.000Spot Trading17169
    ...
    1916
    95KB
    1041s