CryptoIcicleOsmo-11.wETH Deposit Rate - Sushiswap
    Updated 2022-06-13
    -- Payout 24.04 RUNE
    -- Grand Prize 72.12 RUNE
    -- Level Intermediate

    -- Q105. Look at users swapping from native L1 assets to $RUNE. Are there any trends by chain or over time?
    -- Careful, you'll have to exclude rows where they swap from one asset to another via $RUNE
    -- Here is a sample query to help with that:
    -- https://app.flipsidecrypto.com/velocity/queries/41f0216e-bb0e-44f3-8078-34310134642b
    -- Hint: use thorchain.swaps

    WITH t AS (
    SELECT tx_hash, COUNT(1) AS n
    FROM ethereum.sushi.ez_swaps
    WHERE block_timestamp >= {{start_date}}
    GROUP BY 1
    ),
    swaps as (
    SELECT s.*, CASE WHEN t.n = 1 THEN 0 ELSE 1 END AS two_sided_swap
    FROM ethereum.sushi.ez_swaps s
    JOIN t ON t.tx_hash = s.tx_hash
    WHERE block_timestamp >= {{start_date}}
    and two_sided_swap = 0
    and symbol_out = 'WETH'
    )

    select
    date_trunc('month',block_timestamp) as date,
    symbol_in as asset,
    count(distinct tx_hash) as n_swaps,
    sum(amount_out) as swap_volume
    from swaps
    group by date, asset
    Run a query to Download Data