elsinadaily
    Updated 2025-03-10
    with base as (
    select
    event_name,
    block_timestamp,
    tx_hash,
    decoded_log:"benefactor" as users,
    decoded_log:"collateral_amount"/pow(10,6) as collateral,
    decoded_log:"avusd_amount"/pow(10,18) as mint_amount
    from avalanche.core.ez_decoded_event_logs
    where
    contract_address = '0x1499cb3197427b78dc0e2d356a1e0e4149e0ed51' and
    event_name in ('Mint', 'Redeem') and
    tx_succeeded = 'TRUE'
    )

    select
    date_trunc('day', block_timestamp) as date,
    count(distinct tx_hash) as tx_count,
    count(distinct iff(event_name = 'Mint', tx_hash, null)) as mints_count,
    count(distinct iff(event_name = 'Redeem', tx_hash, null)) as redeems_count,
    count(distinct users) as total_users,
    count(distinct iff(event_name = 'Mint', users, null)) as minters_count,
    count(distinct iff(event_name = 'Redeem', users, null)) as redeemers_count,
    sum(iff(event_name = 'Mint', collateral, 0)) as collateral_mint,
    sum(iff(event_name = 'Redeem', collateral, 0)) as collateral_redeem,
    sum(iff(event_name = 'Mint', mint_amount, 0)) as avusd_mint,
    sum(iff(event_name = 'Redeem', mint_amount, 0)) as avusd_redeem,
    collateral_mint - collateral_redeem as net_collateral,
    avusd_mint - avusd_redeem as net_avusd,
    sum(sum(iff(event_name = 'Mint', mint_amount, -mint_amount))) over (order by date) as cumulative_net_avusd
    Last run: about 2 months ago
    DATE
    TX_COUNT
    MINTS_COUNT
    REDEEMS_COUNT
    TOTAL_USERS
    MINTERS_COUNT
    REDEEMERS_COUNT
    COLLATERAL_MINT
    COLLATERAL_REDEEM
    AVUSD_MINT
    AVUSD_REDEEM
    NET_COLLATERAL
    NET_AVUSD
    CUMULATIVE_NET_AVUSD
    1
    2024-11-15 00:00:00.000110110100099.85010099.8599.85
    2
    2024-11-28 00:00:00.000110110523.6072270523.6072270523.607227523.607227623.457227
    3
    2024-11-29 00:00:00.0002202203030.93589603030.93589603030.9358963030.9358963654.393123
    4
    2024-11-30 00:00:00.0002202205000.303105000.303105000.30315000.30318654.696223
    5
    2024-12-01 00:00:00.0001101102120.27061102120.27061102120.2706112120.27061110774.966834
    6
    2024-12-03 00:00:00.0001101102113.72782302113.72782302113.7278232113.72782312888.694657
    7
    2024-12-05 00:00:00.00011011010000100001000100013888.694657
    8
    2024-12-06 00:00:00.0001101105005.00533505005.00533505005.0053355005.00533518893.699992
    9
    2024-12-11 00:00:00.000121202201001099.801001099.801001099.81001099.81019993.499992
    10
    2024-12-15 00:00:00.00011011017619.290385017619.290385017619.29038517619.2903851037612.790377
    11
    2024-12-16 00:00:00.0001101102085.3197702085.3197702085.319772085.319771039698.110147
    12
    2024-12-17 00:00:00.000110110108.3114430108.3114430108.311443108.3114431039806.42159
    13
    2024-12-18 00:00:00.0001101102063.16512202063.16512202063.1651222063.1651221041869.586712
    14
    2024-12-20 00:00:00.0001011010107.7698860108.311443-107.769886-108.3114431041761.275269
    15
    2024-12-27 00:00:00.000330110203462.3320390203462.3320390203462.332039203462.3320391245223.607308
    16
    2024-12-29 00:00:00.000110110109.3569310109.3569310109.356931109.3569311245332.964239
    17
    2024-12-31 00:00:00.000141401101343441.04273401343441.04273401343441.0427341343441.0427342588774.006973
    18
    2025-01-02 00:00:00.0001101101000010000100010002589774.006973
    19
    2025-01-03 00:00:00.000220220701070107017012590475.006973
    20
    2025-01-04 00:00:00.000220110200020002002002590675.006973
    79
    9KB
    3s