SocioAnalyticaCurrent state breakdown by assets copy
    Updated 2025-02-04
    -- forked from Current state breakdown by assets @ https://flipsidecrypto.xyz/studio/queries/d3a408a1-2f7f-43dd-a591-7f34ebf97f74

    -- forked from All_burrow_txs step3 usd prices @ https://flipsidecrypto.xyz/studio/queries/a3235480-8138-4610-987d-234923aed2d5

    -- forked from All_burrow_txs step2 @ https://flipsidecrypto.xyz/studio/queries/eb9190d7-7456-4d01-94c9-f386b1e8c6a0

    -- forked from All_burrow_txs @ https://flipsidecrypto.xyz/studio/queries/af48d69a-042c-42bd-a5de-b1e1ec3e4e27

    --What types of user_ids are taking advantage of the existing APY?
    -- Are they doing anything else within Burrow? Or is there another Near protocol that is grabbing user_ids attention?
    -- Are there comparable protocols on other ecosystems that are performing better? Worse? The same?

    -- Translation: which user_ids are supplying on burrow but not staking to take advantage of the APY boosts? Why? What else are they doing (in burrow or otherwise)?

    -- Get some sample txs from the burrow contract: contract.main.burrow.near
    -- Problems: We have no staked Frax prize > we'll just pretend it's FRAX
    -- token_id: shadow_ref_v1-4179 (unknown name, symbol or price) > ¯\_(ツ)_/¯
    -- token_id: NearX (unknown deciamls and price) > ¯\_(ツ)_/¯
    -- LINEAR prices are not reliable in the prices table, often empty.
    WITH lending_and_borrowing_txs AS (
    SELECT
    L.*,
    CASE WHEN token_id = 'v2-nearx.stader-labs.near' THEN 'v2-nearx' ELSE C.name END as token_name,
    CASE WHEN token_id = 'v2-nearx.stader-labs.near' THEN 'NearX' ELSE C.symbol END as token_symbol,
    C.decimals,
    amount_unadj/POW(10,CASE WHEN C.decimals > 18 THEN C.decimals ELSE 18 END) as amount_adj,
    amount_adj*P.price as amount_usd
    FROM(
    SELECT
    block_timestamp,
    PARSE_JSON(clean_log)['data'][0]['amount'] as amount_unadj,
    PARSE_JSON(clean_log)['data'][0]['position'] as position,
    PARSE_JSON(clean_log)['data'][0]['token_id'] as token_id,
    PARSE_JSON(clean_log)['event'] as action,
    signer_id as user_id,
    tx_hash
    Last run: 3 months ago
    TOKEN_SYMBOL
    BOOST_STATUS
    TOTAL_ASSETS_USD
    HELD_COLLATERAL_USD
    TOTAL_BORROWED_USD
    TOTAL_USER_WITHDRAWN_VALUE_USD
    TOTAL_USER_INTEREST_PAID_USD
    NUMBER_OF_USERS
    1
    $METAboost_active009
    2
    $METAboost_off00323
    3
    $METAnever_boosted00162
    4
    AURORAboost_active15232.45633440489.48877046515260.2053150284842.65310971123
    5
    AURORAboost_off115753.44591824918509.407060331113298.2803772373602.326588215473
    6
    AURORAnever_boosted57238.3910901211055.95449553852514.93754833763.945588443354
    7
    BRRRboost_active123796.19226666108450.743082623187
    8
    BRRRboost_off360755.7875891191370440.802364051489
    9
    BRRRnever_boosted59188.899361852366426.9507278224910
    10
    DAIboost_active1228881.49696341.002178771.7798770681408976.7064002842316.75082673936
    11
    DAIboost_off18236432.565689741831.610174651536616.48042917617647668.3166965461311.778456998506
    12
    DAInever_boosted13841984.2970395151566.286369065806817.96514574115096346.2373167426317.220830415931
    13
    ETHboost_active854906.505172145266426.358658129300.212881284607214.01348281516433.49024156739
    14
    ETHboost_off17049224.064014482232.0242638263700.51381142616785686.0141988163723.829393542364
    15
    ETHnever_boosted5998745.84478257815211.3322827781105.3865647275601744.91386179134654.8260949971595
    16
    FRAXboost_active1981430.05883675342979.680402921777267.9909091382408034.0779948939107.99992733254
    17
    FRAXboost_off6495265.26823431493675.8342142011287326.723924455017064.3007820935773.556857393132
    18
    FRAXnever_boosted8366411.98448956539692.4852075312969743.173286897056943.006414877521.957476976640
    19
    LINEARboost_active0000045
    20
    LINEARboost_off00000351
    51
    5KB
    202s