Afonso_DiazBy Platform
    Updated 7 days ago
    with

    pricet as (
    select
    hour::date as date,
    token_address,
    decimals,
    symbol,
    avg(price) as token_price_usd
    from
    kaia.price.ez_prices_hourly
    group by 1, 2, 3, 4
    ),

    swaps as (
    select
    tx_hash,
    block_timestamp,
    origin_from_address as swapper,
    replace(topics[2], '0x000000000000000000000000', '0x') as token_in_contract,
    replace(topics[3], '0x000000000000000000000000', '0x') as token_out_contract,
    utils.udf_hex_to_int('0x' || substring(data, 67, 64)) as amount_in_unadj,
    utils.udf_hex_to_int('0x' || right(data, 64)) as amount_out_unadj
    from
    kaia.core.fact_event_logs
    where
    tx_succeeded
    and topics[0] = '0x20efd6d5195b7b50273f01cd79a27989255356f9f13293edc53ee142accfdb75'
    and origin_to_address = '0xf50782a24afcb26acb85d086cf892bfffb5731b5'
    ),

    main as (
    select
    swaps.*,
    nvl(a.symbol, c.symbol) as symbol_in,
    nvl(b.symbol, d.symbol) as symbol_out,
    Last run: 7 days ago
    PLATFORM
    SWAPS
    SWAPPERS
    VOLUME_USD
    AVERAGE_AMOUNT_USD
    1
    dragonswap
    60797525252341147083758.49205.65776788
    2
    swapscanner
    90751673593241151551.198002383.014912626
    3
    klayswap
    1936731335831128865551.355.693251406
    4
    capybara
    1309139157382123375767.2163.279474756
    5
    kaiaswap
    3139363193150981031.89159.073138121
    6
    neopin
    3200549239765693042483.168414737
    6
    324B
    63s