Afonso_DiazTop Token Pairs
    Updated 10 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: 10 days ago
    TOKEN_PAIR
    SWAPS
    SWAPPERS
    VOLUME_USD
    AVERAGE_AMOUNT_USD
    1
    KAIA -> stKAIA249646732164975.028701412886.608585217
    2
    stKAIA -> KAIA3544136118792617.26585385302.657242058
    3
    KAIA -> BORA611277111264070.53224291842.943477134
    4
    KAIA -> GCKLAY27568328781086.509029183186.170721709
    5
    USDT -> KAIA728211997420681.515572561019.044426747
    6
    BORA -> KAIA63027747176723.220714071138.800891894
    7
    oXRP -> KAIA62069036977478.870090291124.311774104
    8
    KAIA -> USDT820013015290077.83173866645.131442895
    9
    KAIA -> oXRP78832455053807.11361399641.10200604
    10
    GCKLAY -> KAIA24735463930155.542614981589.225856294
    10
    590B
    66s