RamaharSolend SOL Lending/Borrowing
    Updated 2022-02-16
    with borrow as (select
    date(block_timestamp) as dayz,
    sum(instruction:parsed:info:lamports::float) / POW(10,9) as borrowing_amount
    from solana.events
    where
    event_type = 'transfer' AND
    posttokenbalances[0]:mint = 'So11111111111111111111111111111111111111112' AND
    posttokenbalances[0]:owner = 'DdZR6zRFiUt4S5mg7AV1uKB2z1f1WzcNYCaTEEWPAuby' AND
    posttokenbalances[0]:accountIndex = '5' AND
    --posttokenbalances[1]:mint = 'So11111111111111111111111111111111111111112' AND
    --posttokenbalances[1]:owner = '9RuqAN42PTUi9ya59k9suGATrkqzvb9gk2QABJtQzGP5' AND
    dayz >= '2022-02-05'
    group by dayz),

    lend as (select
    date(block_timestamp) as dayz,
    sum(instruction:parsed:info:lamports::float) / POW(10,9) as lending_amount
    from solana.events
    where
    event_type = 'transfer' AND
    posttokenbalances[2]:mint = '5h6ssFpeDeRbzsEHDbTQNH7nVGgsKrZydxdSTnLm6QdV' AND
    posttokenbalances[2]:owner = 'DdZR6zRFiUt4S5mg7AV1uKB2z1f1WzcNYCaTEEWPAuby' AND
    posttokenbalances[2]:accountIndex = '7' AND
    dayz >= '2022-02-05'
    group by dayz),

    withdraw as (select
    date(block_timestamp) as dayz,
    sum(instruction:parsed:info:lamports::float) / POW(10,9) as withdrawn_amount
    from solana.events
    where
    event_type = 'transfer' AND
    posttokenbalances[0]:mint = 'So11111111111111111111111111111111111111112' AND
    posttokenbalances[0]:owner = 'DdZR6zRFiUt4S5mg7AV1uKB2z1f1WzcNYCaTEEWPAuby' AND
    posttokenbalances[0]:accountIndex = '2' AND
    dayz >= '2022-02-05'
    Run a query to Download Data