Flipside Teamnear platforms - token total tvl copy
    Updated 2024-11-27
    -- forked from near platforms - token total tvl @ https://flipsidecrypto.xyz/edit/queries/d0adf18d-e41c-4784-8e3b-baf9cf12923b

    with
    prices as (
    select date_trunc(day, TIMESTAMP) as date, TOKEN_CONTRACT, avg(PRICE_USD) as price
    from near.price.fact_prices
    where TOKEN_CONTRACT!='aurora'
    group by 1,2
    union all
    select date_trunc(day, TIMESTAMP) as date, 'phoenix-bonds.near', avg(PRICE_USD) as price
    from near.price.fact_prices
    where TOKEN_CONTRACT='wrap.near'
    group by 1,2
    union all
    select date_trunc(day, TIMESTAMP) as date, 'near', avg(PRICE_USD) as price
    from near.price.fact_prices
    where TOKEN_CONTRACT='wrap.near'
    group by 1,2
    union all
    select date_trunc(day, HOUR) as date, 'token.sweat' TOKEN_ADDRESS, avg(PRICE) as price
    from crosschain.price.ez_prices_hourly
    where symbol='SWEAT' and BLOCKCHAIN='ethereum'
    group by 1,2
    union all
    select date_trunc(day, HOUR) as date, 'aurora' TOKEN_ADDRESS, avg(PRICE) as price
    from crosschain.price.ez_prices_hourly
    where TOKEN_ADDRESS='0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' and BLOCKCHAIN='ethereum'
    group by 1,2
    ),

    tokens as (
    select SYMBOL, CONTRACT_ADDRESS as TOKEN_CONTRACT, DECIMALS
    from near.core.dim_ft_contract_metadata
    QUALIFY row_number() over (partition by TOKEN_CONTRACT order by SYMBOL desc)=1
    union all
    select 'pNEAR', 'phoenix-bonds.near', 24
    Last run: about 2 months agoAuto-refreshes every 3 hours
    Symbol
    TVL
    TVL (USD)
    1
    STNEAR4498047.6725581331582920.0628036
    2
    NEAR35784099.5897962185012771.957087
    3
    WOO2967803.23398619636863.581874441
    4
    AURORA919899.059891226203990.295999775
    5
    WBTC24.0241044032323698.25016956
    6
    NearX120743.692301004731905.364387661
    7
    USDC.e4671360.050952594672540.25342136
    8
    ETH825.3709296612799319.79132935
    9
    LINEAR7534291.0907252949734966.8695737
    10
    USDT.e2044694.883400392042483.65973501
    11
    pNEAR57496.968917543297273.753440995
    12
    USDC1238780.429943441239093.40340422
    13
    USDt392814.647414826392389.840246028
    14
    SWEAT13216572.235605291702.052034297
    15
    DAI2147725.056640222147649.87868482
    15
    647B
    92s