RayyykVultisig THORChain (Swap Path)
    Updated 3 days ago
    with table_1 as (select date_trunc('day', block_timestamp) as day,
    affiliate_address,
    affiliate_fee_basis_points,
    from_address,
    tx_id,
    split(from_asset, '-')[0] as from_assets,
    case
    when from_assets ilike '%/%' then split(from_assets, '/')[1]
    else split(from_assets, '.')[1]
    end as from_asset_names,
    split(to_asset, '-')[0] as to_assets,
    case
    when to_assets ilike '%/%' then split(to_assets, '/')[1]
    else split(to_assets, '.')[1]
    end as to_asset_names,
    concat(from_asset_names, ' -> ', to_asset_names) as assets,
    case when assets ilike '%RUNE' then 2
    else 1
    end as numbering,
    sum(from_amount_usd/rune_usd) as rune_volume,
    sum(from_amount_usd) as usd_volume
    from thorchain.defi.fact_swaps
    where affiliate_address in ('vi', 'va', 'v0')
    group by 1,2,3,4,5,6,7,8),

    table_2 as (select day,
    from_address,
    tx_id,
    affiliate_address,
    affiliate_fee_basis_points,
    array_agg(distinct assets) within group (order by assets asc) as swap_direction,
    sum(rune_volume) as swap_volume_rune,
    sum(usd_volume) as swap_volume_usd
    from table_1
    group by 1,2,3,4,5),

    Last run: 3 days ago
    SWAP_PATH
    SWAPPER_COUNT
    AFFILIATE_FEE_USD
    VOLUME_USD
    START_DATE
    END_DATE
    1
    BTC -> RUNE -> BNB5545354.5168435649070903.3687127203/01/20242025-06-12 00:00:00.000
    2
    BTC -> RUNE -> AVAX6233561.064751546712212.9503080603/01/20242025-06-12 00:00:00.000
    3
    RUNE -> USDC5730090.358493946008558.4410533403/01/20242025-06-12 00:00:00.000
    4
    BTC -> RUNE7522374.9191226024474983.8245204103/01/20242025-06-12 00:00:00.000
    5
    USDT -> RUNE2220226.0339246794045202.5343856503/01/20242025-06-12 00:00:00.000
    6
    USDC -> RUNE5618550.3865825723710077.3165143703/01/20242025-06-12 00:00:00.000
    7
    RUNE -> BTC8314836.8001528482967360.0305696703/01/20242025-06-12 00:00:00.000
    8
    BNB -> RUNE -> USDC113435.994159472687198.8318939503/01/20242025-06-12 00:00:00.000
    9
    RUNE -> ETH7713465.9288826822672984.491902203/01/20242025-06-12 00:00:00.000
    10
    ETH -> RUNE -> BTC1412021.2386286792404247.7257358803/01/20242025-06-12 00:00:00.000
    11
    BNB -> RUNE2011855.4983347982371060.7101653903/01/20242025-06-12 00:00:00.000
    12
    RUNE -> USDT296616.2654424951323253.0884989103/01/20242025-06-12 00:00:00.000
    13
    RUNE -> TCY536404.607419781280921.4839559503/01/20242025-06-12 00:00:00.000
    14
    ETH -> RUNE786091.0260648051166615.6608742403/01/20242025-06-12 00:00:00.000
    15
    BTC -> RUNE -> USDT73645.629542169729125.90843372503/01/20242025-06-12 00:00:00.000
    16
    BTC -> RUNE -> ETH293518.767252082702414.54188144503/01/20242025-06-12 00:00:00.000
    17
    BNB -> RUNE -> BTC53085.415615969617083.12319370103/01/20242025-06-12 00:00:00.000
    18
    USDC -> RUNE -> ETH132451.713483434490342.69668683503/01/20242025-06-12 00:00:00.000
    19
    DOGE -> RUNE -> BTC62073.061125107414612.22502137203/01/20242025-06-12 00:00:00.000
    20
    BTC -> RUNE -> USDC152009.035074643401807.0149286503/01/20242025-06-12 00:00:00.000
    ...
    103
    9KB
    4s