superflyUntitled Query
    Updated 2022-10-27
    with pool_tb as (
    select
    date_trunc('day', block_timestamp) as date,
    FROM_CURRENCY,
    TO_CURRENCY,
    tx_id,
    b.value::string as poolID
    from osmosis.core.fact_swaps, lateral flatten(input => pool_ids) b
    )
    ,label_tb1 as (
    select
    date,
    LABEL as from_label,
    TO_CURRENCY,
    tx_id,
    poolID
    from pool_tb a join osmosis.core.dim_labels b on a.from_currency = b.ADDRESS
    )
    ,label_tb2 as (
    select
    date,
    from_label,
    label as to_label,
    tx_id,
    poolID
    from label_tb1 a join osmosis.core.dim_labels b on a.TO_CURRENCY = b.ADDRESS
    )
    ,lst_tb as (
    select
    date,
    tx_id,
    poolID,
    concat(from_label, ' : ' , to_label) as pair
    from label_tb2
    )
    select
    Run a query to Download Data