maybeyonasthor_multiswap_zoho
    Updated 2023-03-27
    with multi_swaps_txs as (
    select tx_id from (
    select
    tx_id,
    count(tx_id) as swaps
    from thorchain.swaps
    group by 1
    )
    where swaps > 1
    ),
    swap_from as (
    select
    block_timestamp,
    tx_id,
    from_asset,
    from_amount,
    from_amount_usd
    from thorchain.swaps
    where to_asset = 'THOR.RUNE'
    and tx_id in ( select tx_id from multi_swaps_txs)
    ),
    swap_to as (
    select
    block_timestamp,
    tx_id,
    to_asset,
    to_amount,
    to_amount_usd
    from thorchain.swaps
    where from_asset = 'THOR.RUNE'
    and tx_id in ( select tx_id from multi_swaps_txs)
    ),
    multi_swap as (
    select
    f.block_timestamp,
    f.tx_id,
    Run a query to Download Data