adriaparcerisasTrado swaps by asset
    Updated 5 days ago
    -- forked from Trado swaps @ https://flipsidecrypto.xyz/studio/queries/eb696c0e-a44f-4591-801f-100bcdcd6dd8

    -- unrwap wflow to flow 0x9db24dee5d3d7cca9ebbbf738ec78722c24f49bb16de4f23f45906b61efab267
    -- wrap flow to wflow 0x6f81ff66eaaea5214b89c7c22ca37a1b0a2010f22438fd9419968d768d9f371d

    with
    swaps as (
    select x.tx_hash, x.origin_from_address, x.contract_address, y.tx_fee, x.block_timestamp
    from flow.core_evm.fact_event_logs x
    join flow.core_evm.fact_transactions y
    on x.tx_hash=y.tx_hash
    where (y.to_address='0x3EF68D3f7664b2805D4E88381b64868a56f88bC4' or x.origin_function_signature='0xac9650d8')
    and x.TX_SUCCEEDED='TRUE'
    and x.contract_address in ('0x1b97100ea1d7126c4d60027e231ea4cb25314bdb','0x7f27352d5f83db87a5a3e00f4b07cc2138d8ee52','0xd3bf53dac106a0290b0483ecbc89d40fcc961f3e','0x5598c0652b899eb40f169dd5949bdbe0bf36ffde')
    ),
    news as (
    select distinct origin_from_address as swapper, contract_address, min(trunc(block_timestamp,'day')) as debut
    from swaps group by 1,2
    )
    select
    trunc(block_timestamp,'day') as date,
    case when x.contract_address='0x1b97100ea1d7126c4d60027e231ea4cb25314bdb' then 'ankrFLOWEVM'
    when x.contract_address='0x7f27352d5f83db87a5a3e00f4b07cc2138d8ee52' then 'USDC.e'
    when x.contract_address='0x5598c0652b899eb40f169dd5949bdbe0bf36ffde' then 'stFlow'
    else 'wFLOW'
    end as asset,
    count(distinct origin_from_address) as active_swappers,
    count(distinct swapper) as new_swappers,
    sum(new_swappers) over (partition by asset order by date) as total_swappers,
    count(DISTINCT tx_hash) as swaps,
    sum(swaps) over (partition by asset order by date) as total_swaps,
    sum(tx_fee) as flow_fees,
    avg(tx_fee) as avg_tx_flow_fee
    from swaps x left join news y on trunc(block_timestamp,'day')=debut and x.contract_address=y.contract_address
    group by 1,2 order by 1 desc

    Last run: 5 days ago
    DATE
    ASSET
    ACTIVE_SWAPPERS
    NEW_SWAPPERS
    TOTAL_SWAPPERS
    SWAPS
    TOTAL_SWAPS
    FLOW_FEES
    AVG_TX_FLOW_FEE
    1
    2025-05-19 00:00:00.000USDC.e3016373509051.4273134e-111.955223836e-13
    2
    2025-05-19 00:00:00.000wFLOW3028273535952.8546268e-111.955223836e-13
    3
    2025-05-18 00:00:00.000ankrFLOWEVM10147221040.000089459520.00002981984
    4
    2025-05-18 00:00:00.000stFlow1070215755.497478e-121.963385e-13
    5
    2025-05-18 00:00:00.000wFLOW50282269535220.00011427154512.124006414e-7
    6
    2025-05-18 00:00:00.000USDC.e31163244508324.7968152e-111.957883755e-13
    7
    2025-05-17 00:00:00.000USDC.e3016264505881.2405056e-111.93829e-13
    8
    2025-05-17 00:00:00.000stFlow107055541.005575e-122.01115e-13
    9
    2025-05-17 00:00:00.000ankrFLOWEVM21147321021.098332e-122.196664e-13
    10
    2025-05-17 00:00:00.000wFLOW6128272532532.8127618e-111.953306806e-13
    11
    2025-05-16 00:00:00.000USDC.e2016265505241.2724344e-111.957591385e-13
    12
    2025-05-16 00:00:00.000wFLOW2028165531812.5448688e-111.957591385e-13
    13
    2025-05-15 00:00:00.000wFLOW51281213531160.00003598868358.448047771e-8
    14
    2025-05-15 00:00:00.000ankrFLOWEVM11146120990.000017994300360.00001799430036
    15
    2025-05-15 00:00:00.000USDC.e30162211504594.1200133e-111.952612938e-13
    16
    2025-05-15 00:00:00.000stFlow107015493.84832e-131.92416e-13
    17
    2025-05-14 00:00:00.000stFlow117025487.9907e-131.997675e-13
    18
    2025-05-14 00:00:00.000ankrFLOWEVM20145420987.11395e-131.7784875e-13
    19
    2025-05-14 00:00:00.000USDC.e30162159502483.1092173e-111.955482579e-13
    20
    2025-05-14 00:00:00.000wFLOW61280163529036.3680894e-111.953401656e-13
    ...
    751
    55KB
    5s