Sbhn_NP2024-05-20 08:46 PM
    Updated 2025-01-11
    with price as (
    select hour::date as datee,
    token_address,
    avg(price) as usdprice
    from aptos.price.ez_prices_hourly
    group by 1,2
    )

    select date_trunc('day',block_timestamp) as date,
    name,
    count(DISTINCT ACCOUNT_ADDRESS) as users,
    sum(amount/pow(10,decimals)*usdprice) as borrowed
    from aptos.core.fact_transfers a
    join aptos.core.fact_transactions using(tx_hash)
    join price p on block_timestamp::date=datee and a.token_address=p.token_address
    left join aptos.core.dim_tokens t on a.token_address=t.token_address
    where payload:function = '0xc6bc659f1649553c1a3fa05d9727433dc03843baac29473c817d06d39e7621ba::scripts::borrow'
    and transfer_event = 'DepositEvent'
    group by 1,2



    Last run: 3 months ago
    DATE
    NAME
    USERS
    BORROWED
    1
    2024-12-26 00:00:00.000USD Coin1242541433.680898579
    2
    2024-06-15 00:00:00.000USD Coin3214267.615629872
    3
    2024-04-15 00:00:00.000USD Coin237951.736725402
    4
    2024-07-21 00:00:00.000Tether USD1913766.697370567
    5
    2024-06-15 00:00:00.000Tether USD84529.019001161
    6
    2024-11-04 00:00:00.000Staked Aptos Coin6018060.316769566
    7
    2024-05-19 00:00:00.000Tether USD75313.298975986
    8
    2025-01-02 00:00:00.000Staked Aptos Coin7090157.685962649
    9
    2024-04-22 00:00:00.000Wrapped Ether612559.28248586
    10
    2024-12-19 00:00:00.000USD Coin311417023.40585273
    11
    2024-07-10 00:00:00.000USD Coin3239213.076012703
    12
    2024-06-24 00:00:00.000USD Coin2255038.804376146
    13
    2024-09-24 00:00:00.000Move Dollar850065.285115859
    14
    2024-05-30 00:00:00.000Tether USD303530.596712619
    15
    2024-08-21 00:00:00.000Staked Aptos Coin121748999.50516755
    16
    2024-08-02 00:00:00.000USD Coin3080291.519688895
    17
    2024-08-05 00:00:00.000Aptos Coin33449667.277617299
    18
    2024-12-08 00:00:00.000Aptos Coin212193319.25423519
    19
    2024-07-04 00:00:00.000USD Coin4416458.034833437
    20
    2024-09-30 00:00:00.000Staked Aptos Coin1137231.002522598
    ...
    2084
    123KB
    235s