Updated 2022-03-15
    with t1 as ( with tt as (
    Select
    date_trunc('day',block_timestamp) as d1,
    count (distinct tx_id) as total
    From Solana.swaps
    Where swap_from_mint = 'So11111111111111111111111111111111111111112' and swap_to_mint!= 'So11111111111111111111111111111111111111112'
    and SWAP_PROGRAM= 'orca'
    and block_timestamp::date >= '2022-01-01' group by 1
    ),

    ff as(Select
    date_trunc('day',block_timestamp) as d2,
    count (distinct tx_id) as success
    From Solana.swaps
    Where swap_from_mint = 'So11111111111111111111111111111111111111112' and swap_to_mint!= 'So11111111111111111111111111111111111111112'
    and SWAP_PROGRAM= 'orca' and succeeded='TRUE'
    and block_timestamp::date >= '2022-01-01' group by 1)

    select tt.d1 as dt1,
    (success/total)*100 as success_ORCA
    from tt
    inner join ff on tt.d1 = ff.d2),

    t2 as (with tt as (
    Select
    date_trunc('day',block_timestamp) as d1,
    count (distinct tx_id) as total1
    From Solana.swaps
    Where swap_from_mint = 'So11111111111111111111111111111111111111112' and swap_to_mint!= 'So11111111111111111111111111111111111111112'
    and SWAP_PROGRAM= 'orca'
    and block_timestamp::date >= '2022-01-01' group by 1
    ),

    ff as(Select
    date_trunc('day',block_timestamp) as d2,
    count (distinct tx_id) as success1
    Run a query to Download Data