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 -> BNB5547161.7463526119432349.2705221103/01/20242025-04-04 00:00:00.000
    2
    BTC -> RUNE -> AVAX6234902.7469262086980549.3852416703/01/20242025-04-04 00:00:00.000
    3
    BTC -> RUNE6521104.7141790934220942.8358185903/01/20242025-04-04 00:00:00.000
    4
    RUNE -> USDC4917928.0688021123576100.4997794203/01/20242025-04-04 00:00:00.000
    5
    RUNE -> BTC8115380.390506643076078.1013279703/01/20242025-04-04 00:00:00.000
    6
    RUNE -> ETH6913526.0168079532685002.0769564203/01/20242025-04-04 00:00:00.000
    7
    ETH -> RUNE -> BTC1312539.7386878782507947.7375755303/01/20242025-04-04 00:00:00.000
    8
    BNB -> RUNE -> USDC17581.4319999041516286.3999807903/01/20242025-04-04 00:00:00.000
    9
    USDT -> RUNE186821.6983630661364335.4220630603/01/20242025-04-04 00:00:00.000
    10
    USDC -> RUNE406178.1739769981235634.7953996703/01/20242025-04-04 00:00:00.000
    11
    ETH -> RUNE686039.6570222121156341.8523557103/01/20242025-04-04 00:00:00.000
    12
    RUNE -> USDT245485.1410043361097028.2008672503/01/20242025-04-04 00:00:00.000
    13
    BTC -> RUNE -> ETH233092.223687343617105.82893360503/01/20242025-04-04 00:00:00.000
    14
    BNB -> RUNE -> BTC43041.052361302608210.47226046303/01/20242025-04-04 00:00:00.000
    15
    USDC -> RUNE -> ETH112304.764560565460952.91211303303/01/20242025-04-04 00:00:00.000
    16
    DOGE -> RUNE -> BTC62149.829410502429965.88210048903/01/20242025-04-04 00:00:00.000
    17
    USDT -> RUNE -> USDC31501.058907243300211.78144855903/01/20242025-04-04 00:00:00.000
    18
    BTC -> RUNE -> DOGE31383.651080876276303.2878479203/01/20242025-04-04 00:00:00.000
    19
    BTC -> RUNE -> USDT41348.464074717269692.81494332603/01/20242025-04-04 00:00:00.000
    20
    DOGE -> RUNE -> USDT31216.436534235243287.30684694403/01/20242025-04-04 00:00:00.000
    87
    8KB
    5s