par_rnTop Tokens OUT
    with failed as (
    select tx_hash from near.core.fact_receipts
    where Parse_json(status_value):"Failure" is not null
    ),
    average_price as
    (
    select timestamp::date as "date", token_contract,avg(price_usd) as avg_price from near.core.fact_prices
    group by "date",token_contract
    ),
    swap as
    (
    select
    fc.tx_hash,
    fc.block_timestamp,
    fc.method_name,
    -- fc.args,
    t.tx_receiver as platform,
    t.tx_signer as swapper,
    PARSE_JSON(args):actions[0]:"amount_in" as amount_in,
    PARSE_JSON(args):actions[0]:"pool_id" as pool_id,
    PARSE_JSON(args):actions[0]:"token_in" as token_in,
    PARSE_JSON(args):actions[0]:"token_out" as token_out
    from near.core.fact_actions_events_function_call fc
    inner join near.core.fact_transactions t on fc.tx_hash=t.tx_hash
    where t.tx_hash not in (select * from failed)
    and fc.method_name in ('swap','ft_transfer_call','proxy_swap')
    and platform='v2.ref-finance.near'
    and t.block_timestamp >= '2022-07-01'
    ),
    swap_data as
    (
    select
    s.tx_hash,
    s.block_timestamp,
    s.method_name,
    Run a query to Download Data