0-MIDtotal borr repay stats on arbitrum
    Updated 2023-04-13
    with tab1 as (
    select CONTRACT_ADDRESS
    ,ORIGIN_FROM_ADDRESS
    ,RAW_AMOUNT
    ,TX_HASH
    from arbitrum.core.fact_token_transfers
    where ORIGIN_FUNCTION_SIGNATURE ='0xd5eed868'
    and ORIGIN_TO_ADDRESS='0x794a61358d6845594f94dc1db02a252b5b4814ad'
    and ORIGIN_FROM_ADDRESS=TO_ADDRESS
    and FROM_ADDRESS<>'0x0000000000000000000000000000000000000000'
    --and BLOCK_TIMESTAMP>='2023-01-01'
    ),
    tab2 as (
    select ADDRESS
    ,DECIMALS
    ,SYMBOL
    from arbitrum.core.dim_contracts),
    tab3 as (
    select CONTRACT_ADDRESS
    ,ORIGIN_FROM_ADDRESS
    ,RAW_AMOUNT
    ,TX_HASH
    from arbitrum.core.fact_token_transfers
    where ORIGIN_FUNCTION_SIGNATURE in ('0x563dd613','0xdc7c0bff','0x94b576de')
    and ORIGIN_TO_ADDRESS='0x794a61358d6845594f94dc1db02a252b5b4814ad'
    and ORIGIN_FROM_ADDRESS=FROM_ADDRESS
    and TO_ADDRESS<>'0x0000000000000000000000000000000000000000'
    --and BLOCK_TIMESTAMP>='2023-01-01'
    ),
    tab4 as (
    select ADDRESS
    ,DECIMALS
    ,SYMBOL
    from arbitrum.core.dim_contracts)
    select 'BORROW'as type
    ,SYMBOL as asset
    Run a query to Download Data