kaibladeSynthetix data Others
    Updated 2023-06-23
    WITH
    snx_issers as (
    select '0x5810fc0e79f4323b2dd3c638914083fd23a941c0' as issuer_address
    union all select '0x2eb6860fadc59910bf187965da8714d91f20f4db' as issuer_address
    )

    , raw_mints as (
    select
    '0x' || substr(input,3+8+24,40) as minted_account,
    ethereum.public.udf_hex_to_int(substr(input,3+8+24+64,64))::integer / pow(10,18) as minted_amount,
    'Mint' as event_type,
    row_number() over (PARTITION BY tx_hash order by gas desc) as raw_trace_index,
    *
    from ethereum.core.fact_traces
    where to_address = '0x89fcb32f29e509cc42d0c8b6f058c993013a843f'
    and substr(input,0,10) = '0xc2f04b0a' -- function mintShare
    and block_timestamp > '2020-01-01'
    -- and block_timestamp < '2023-01-01'
    and tx_status = 'SUCCESS'
    )
    , raw_burns as (
    select
    '0x' || substr(input,3+8+24,40) as minted_account,
    ethereum.public.udf_hex_to_int(substr(input,3+8+24+64,64))::integer / pow(10,18) * -1 as minted_amount,
    'Burn' as event_type,
    row_number() over (PARTITION BY tx_hash order by gas desc) as raw_trace_index,
    *
    from ethereum.core.fact_traces
    where to_address = '0x89fcb32f29e509cc42d0c8b6f058c993013a843f'
    and substr(input,0,10) = '0x1a378f0d' -- function burnShare
    and block_timestamp > '2020-01-01'
    -- and block_timestamp < '2023-01-01'
    and tx_status = 'SUCCESS'
    )
    , raw_traces as (
    select
    Run a query to Download Data