RayyykVultisig THORChain (Swap Path)
    Updated 20 hours 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: about 20 hours ago
    SWAP_PATH
    SWAPPER_COUNT
    AFFILIATE_FEE_USD
    VOLUME_USD
    START_DATE
    END_DATE
    1
    BTC -> RUNE -> BNB5545354.5168435649070903.3687127203/01/20242025-05-30 00:00:00.000
    2
    BTC -> RUNE -> AVAX6233561.064751546712212.9503080603/01/20242025-05-30 00:00:00.000
    3
    RUNE -> USDC5629909.3478635645972356.3149781403/01/20242025-05-30 00:00:00.000
    4
    BTC -> RUNE7321995.6724983554399134.499671103/01/20242025-05-30 00:00:00.000
    5
    USDT -> RUNE2220132.4003560914026475.8206680203/01/20242025-05-30 00:00:00.000
    6
    USDC -> RUNE5418482.8666466273696573.3293253703/01/20242025-05-30 00:00:00.000
    7
    RUNE -> BTC8214836.8001528482967360.0305696703/01/20242025-05-30 00:00:00.000
    8
    BNB -> RUNE -> USDC113435.994159472687198.8318939503/01/20242025-05-30 00:00:00.000
    9
    RUNE -> ETH7413366.2979880262653058.3129710503/01/20242025-05-30 00:00:00.000
    10
    ETH -> RUNE -> BTC1412021.2386286792404247.7257358803/01/20242025-05-30 00:00:00.000
    11
    BNB -> RUNE1711830.8833972272366137.7226511903/01/20242025-05-30 00:00:00.000
    12
    RUNE -> USDT275839.2420664481167848.4132895503/01/20242025-05-30 00:00:00.000
    13
    ETH -> RUNE766072.0763343751162825.7147883503/01/20242025-05-30 00:00:00.000
    14
    RUNE -> TCY435477.0692110831095413.8422165103/01/20242025-05-30 00:00:00.000
    15
    BTC -> RUNE -> USDT73590.017699628718003.53992567703/01/20242025-05-30 00:00:00.000
    16
    BTC -> RUNE -> ETH273264.686911025651598.4736699103/01/20242025-05-30 00:00:00.000
    17
    BNB -> RUNE -> BTC53076.171118755615234.22375102303/01/20242025-05-30 00:00:00.000
    18
    USDC -> RUNE -> ETH122450.413001464490082.60029283303/01/20242025-05-30 00:00:00.000
    19
    DOGE -> RUNE -> BTC62073.061125107414612.22502137203/01/20242025-05-30 00:00:00.000
    20
    BTC -> RUNE -> USDC142001.093542545400218.70850895403/01/20242025-05-30 00:00:00.000
    ...
    103
    9KB
    4s