hess1. Daily Swap Volume
    Updated 2025-03-08
    with base as (select tx_hash,
    block_timestamp,
    origin_from_address AS swapper,
    DECODED_LOG:"amount0In"::NUMBER AS amount0In,
    DECODED_LOG:"amount0Out"::NUMBER AS amount0Out,
    DECODED_LOG:"amount1In"::NUMBER AS amount1In,
    DECODED_LOG:"amount1Out"::NUMBER AS amount1Out,
    DECODED_LOG:"sender"::STRING AS sender,
    DECODED_LOG:"to"::STRING AS recipient,
    contract_address as pool_address,
    case when decoded_log:amount1Out::NUMBER = 0 then decoded_log:amount1In::NUMBER else decoded_log:amount1Out::NUMBER end AS token_1_amounts,
    case when decoded_log:amount0In::NUMBER = 0 then decoded_log:amount0Out::NUMBER else decoded_log:amount0In::NUMBER end AS token_0_amounts,
    DECODED_LOG:"amount0"::NUMBER as amount0,
    DECODED_LOG:"amount1"::NUMBER as amount1,
    case when amount0 > 0 then amount0 else abs(amount0) end as token0,
    case when amount1 > 0 then amount1 else abs(amount1) end as token1,
    Coalesce(token_1_amounts,token1) as token_1_amount,
    Coalesce(token_0_amounts,token0) as token_0_amount
    FROM ink.core.ez_decoded_event_logs
    WHERE event_name = 'Swap'
    and origin_to_address = lower('0x652e53c6a4fe39b6b30426d9c96376a105c89a95')
    and TX_SUCCEEDED = 'TRUE')
    ,
    pool as (select concat('0x', substr(topics[1], 24 + 3, 32 + 8)) as token_0_address,
    concat('0x', substr(topics[2], 24 + 3, 32 + 8)) as token_1_address,
    regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}') AS pool_data,
    concat('0x', substr(pool_data[0], 25, 40)) as pool_address
    from ink.core.fact_event_logs
    having pool_address is not null)
    ,
    pair as ( select a.*,
    token_0_address,
    token_1_address
    from base a left outer join pool b on a.pool_address = b.pool_address)
    ,
    token_bonk as ( select * from $query('43200306-984d-4255-816a-7685810d5804'))
    Last run: 30 days ago
    DATE
    Swappers
    Swaps
    Volume (USD)
    Cumulative Volume (USD)
    Avg Volume Per Swapper
    Cumulative Swaps
    Avg Swap per Swapper
    Tokens (IN)
    Tokens (OUT)
    AVG
    Median
    MAX
    1
    2025-01-14 00:00:00.00071272.6238398372.6238398310.374834261121.714286216.0519866530.338599385163.697575
    2
    2025-02-18 00:00:00.0006321241238693.5241403086562929.07990079377.679626804481191.96360876144.4876054122.9985991715408.681556469
    3
    2025-01-27 00:00:00.000392678127154.4353938731365162.70764573324.37355967863451.72959276132.4525368696.2472208339122.566688346
    4
    2025-01-28 00:00:00.000649991211522.249130241576684.95677597325.92026060173361.52696587166.9473158093.07362617739995.341668
    5
    2025-02-11 00:00:00.0006911442234329.1330916875054686.74450461339.115966848384712.08683168124.9755376498.5554759428384.8029525
    6
    2025-02-19 00:00:00.0005501072158540.1367272966721469.21662809288.25479405491911.94909147114.9674668071.99856167416811.727001882
    7
    2025-01-24 00:00:00.000314590143049.0639497211057778.40709867455.57026735643331.87898179190.73208526613.5603051569999.533333
    8
    2025-01-15 00:00:00.0008922735049.61040910635122.234248936393.8158472932392.55056277143.645944314.6115345596546.6825
    9
    2025-03-01 00:00:00.00016242316410791.97089580710418489.2084375252.950720995690381.42610878147.1317947331.00234727859949.05928372
    10
    2025-02-20 00:00:00.0005301194184103.4248392526905572.64146734347.364952527503852.2528335118.6233407474.1888131239999.597083
    11
    2025-02-26 00:00:00.00013902250436311.2928545759128296.75725128313.893016442620561.61870545153.6307369211.4050711658935.2671647
    12
    2025-02-04 00:00:00.0007581372117304.7865245813374911.00981363154.755655046272821.8100266864.3118347172.7509825055773.656620952
    13
    2025-01-16 00:00:00.000318583101002.201609344136124.435858281317.6169861938221.83333387168.9000026913.353353753822.823275
    14
    2025-02-24 00:00:00.00011692063279388.4761899838246895.28206082238.997841052560511.76475667108.923382533.62451492614993.965082241
    15
    2025-02-12 00:00:00.0006521373227580.5979831185282267.34248773349.049996907398442.10582845124.29306279814.4334775854010.311569867
    16
    2025-02-28 00:00:00.00011731991631145.72399938110007697.2375417538.06114578667221.69735768238.7989875140.9213044095139031.597814346
    17
    2025-02-01 00:00:00.00015533436368274.261162242937182.0633896237.137322062230802.2124928981.85691512814.17139985640002.57238275
    18
    2025-03-02 00:00:00.00012951963457725.43649272310876214.6449302353.455935516710011.5158388186.5982211550.999386134249957.511732089
    19
    2025-02-27 00:00:00.00016352675248254.756291029376551.5135423151.837771432647311.6360866773.7755590761.1644612524998.339685366
    20
    2025-02-16 00:00:00.000970179999423.5188857085953448.57145153102.498473078456321.8546396842.6344420612.3843045945012.871799244
    54
    7KB
    5s