KuramaUntitled Query
    Updated 2022-06-14

    WITH labels_secret as (SELECT PROJECT_NAME, RAW_METADATA[0]:denom as currency, RAW_METADATA[1]:exponent as decimals FROM osmosis.core.dim_labels
    WHERE PROJECT_NAME = 'SCRT'),

    traders_swaps_from_secret as (
    SELECT to_date(block_timestamp) as date, trader,
    sum(from_amount/pow(10,6)) as secret_sold FROM osmosis.core.fact_swaps
    where tx_status = 'SUCCEEDED'
    and from_currency in (select distinct currency from labels_secret)
    and to_date(block_timestamp) = '2022-01-20'
    group by 1, 2
    order by secret_sold desc
    limit 10
    )

    select * from traders_swaps_from_secret

    select TRADER, from_currency, PROJECT_NAME,sum(FROM_AMOUnT/POW(10,RAW_METADATA[1]:exponent)) as amount FROM osmosis.core.fact_swaps A
    LEFT JOIN osmosis.core.dim_labels B
    ON A.FROM_CURRENCY = RAW_METADATA[0]:denom --as currency, RAW_METADATA[1]:exponent as decimals FROM osmosis.core.dim_labels
    where tx_status = 'SUCCEEDED'
    and from_currency <> 'ibc/0954E1C28EB7AF5B72D24F3BC2B47BBB2FDF91BDDFD57B74B99E133AED40972A'
    and to_currency <> 'ibc/0954E1C28EB7AF5B72D24F3BC2B47BBB2FDF91BDDFD57B74B99E133AED40972A'
    and to_date(block_timestamp) = '2022-01-20'
    and trader = 'osmo10ker5u9tgu4gcr3gx5njwta8vv7zm4lfl7mh62'
    group by 1, 2, 3

    select TRADER, from_currency, PROJECT_NAME,sum(TO_AMOUnT/POW(10,RAW_METADATA[1]:exponent)) as amount FROM osmosis.core.fact_swaps A
    LEFT JOIN osmosis.core.dim_labels B
    ON A.TO_CURRENCY = RAW_METADATA[0]:denom --as currency, RAW_METADATA[1]:exponent as decimals FROM osmosis.core.dim_labels
    where tx_status = 'SUCCEEDED'
    and from_currency <> 'ibc/0954E1C28EB7AF5B72D24F3BC2B47BBB2FDF91BDDFD57B74B99E133AED40972A'
    and to_currency <> 'ibc/0954E1C28EB7AF5B72D24F3BC2B47BBB2FDF91BDDFD57B74B99E133AED40972A'
    and to_date(block_timestamp) = '2022-01-20'
    and trader = 'osmo10ker5u9tgu4gcr3gx5njwta8vv7zm4lfl7mh62'
    Run a query to Download Data