KARTODSOL and USDC Supplied Per Day to Solend since January 1st (in USD)
    Updated 2022-07-03
    with sol as (
    select
    date_trunc('day', block_timestamp) as day,
    sum(INNER_INSTRUCTIONS[0]:instructions[1]:parsed:info:amount/1e9) as sol_supplied
    from solana.core.fact_transactions
    where
    INSTRUCTIONS[1]:programId = 'So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo'--
    and PRE_TOKEN_BALANCES[0]:mint = 'So11111111111111111111111111111111111111112'
    --and INNER_INSTRUCTIONS[0]:instructions[0]:parsed:info:amount is not null
    and INNER_INSTRUCTIONS[0]:instructions[1]:parsed:info:authority = 'DdZR6zRFiUt4S5mg7AV1uKB2z1f1WzcNYCaTEEWPAuby'
    and day >= '2022-01-01'
    and succeeded = 'TRUE'
    group by 1),
    usdc as (select date_trunc('day', block_timestamp) as day,
    sum(INNER_INSTRUCTIONS[0]:instructions[1]:parsed:info:amount/1e6) as usdc_supplied
    from solana.core.fact_transactions
    where -- tx_id = '4JePc2otvhtVdEBtANcUbmBRoSZQG5DL1Jrgydve5wWFXmcc29tqxnBWxNP36XpkuExfZ9YwH8m3Evxs8WxkgXq2' and
    INSTRUCTIONS[1]:programId = 'So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo'--
    and pre_token_balances[0]:mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
    --and INNER_INSTRUCTIONS[0]:instructions[0]:parsed:info:amount is not null
    and INNER_INSTRUCTIONS[0]:instructions[1]:parsed:info:authority = 'DdZR6zRFiUt4S5mg7AV1uKB2z1f1WzcNYCaTEEWPAuby'
    and day >= '2022-01-01'
    and succeeded = 'TRUE'
    group by 1),

    solprice as (select date_trunc('day', block_timestamp) as day,
    avg(swap_to_amount/swap_from_amount) as sol_price
    from solana.fact_swaps
    where day >= '2022-01-01'
    and swap_from_mint = 'So11111111111111111111111111111111111111112' --wSOL
    and swap_to_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' --USDC
    and swap_to_amount > 0
    and swap_from_amount > 0
    and succeeded = 'TRUE'
    group by 1),
    Run a query to Download Data