MasiNew Swappers
    Updated 2025-02-02
    with tb1 as ( select trunc(block_timestamp,'day') as day,
    tx_hash,
    swapper,
    --case when amount_in_usd is null then amount_out_usd else amount_in_usd end as amount_usd,
    concat(symbol_in,'/',symbol_out) as pair,
    symbol_in,
    amount_in,
    amount_out,
    token_in,
    token_out,
    symbol_out,
    platform,
    amount_in_usd,
    amount_out_usd
    from aptos.defi.ez_dex_swaps
    --where (AMOUNT_IN_USD between AMOUNT_OUT_USD - 5000 and AMOUNT_OUT_USD + 5000) -- Credited to Abbas from old Dashboards
    where platform = 'thala'
    )
    ,
    tb2 as ( select trunc(hour,'day') as day,
    token_address,
    avg(price) as token_price
    from aptos.price.ez_prices_hourly
    group by 1,2 )
    ,
    tb3 as ( select a.*,
    amount_in_usd*b.token_price as amount_in_usd0,
    amount_out_usd*c.token_price as amount_out_usd0,
    case when symbol_in = 'USDC' then amount_in else amount_in_usd end as amount_usd0,
    case when symbol_out = 'USDC' then amount_out else amount_out_usd end as amount_usd1,
    case when amount_usd0 is null then amount_usd1 else amount_usd0 end as amount0,
    case when amount_in_usd is null then amount_out_usd else amount_in_usd end as amount1,
    case when amount0 is null then amount1 else amount0 end as amount_usd
    from tb1 a left outer join tb2 b on a.token_in = b.token_address and a.day = b.day
    left outer join tb2 c on a.token_out = c.token_address and a.day = c.day
    )
    Last run: 3 months ago
    DAY
    New Swappers
    Cumulative New Swappers
    1
    2023-03-31 00:00:00.0001717
    2
    2023-04-01 00:00:00.000120137
    3
    2023-04-02 00:00:00.000217354
    4
    2023-04-03 00:00:00.000282636
    5
    2023-04-04 00:00:00.000215851
    6
    2023-04-05 00:00:00.0008491700
    7
    2023-04-06 00:00:00.0002681968
    8
    2023-04-07 00:00:00.0002302198
    9
    2023-04-08 00:00:00.0001682366
    10
    2023-04-09 00:00:00.0001532519
    11
    2023-04-10 00:00:00.0001362655
    12
    2023-04-11 00:00:00.0002062861
    13
    2023-04-12 00:00:00.0002233084
    14
    2023-04-13 00:00:00.0002523336
    15
    2023-04-14 00:00:00.0002623598
    16
    2023-04-15 00:00:00.0001523750
    17
    2023-04-16 00:00:00.0002023952
    18
    2023-04-17 00:00:00.0002074159
    19
    2023-04-18 00:00:00.0001754334
    20
    2023-04-19 00:00:00.0001854519
    ...
    675
    25KB
    5s