Flipside Teamnear platforms - tokens tvl copy
    Updated 2024-11-27
    -- forked from near platforms - tokens tvl @ https://flipsidecrypto.xyz/edit/queries/c5df0a7f-2b6e-4851-a37a-bde821b47bb5

    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
    Date
    Symbol
    TVL (USD)
    1
    2024-08-17 00:00:00.000SWEAT79740.608101761
    2
    2024-08-29 00:00:00.000SWEAT97670.578959225
    3
    2023-07-28 00:00:00.000SWEAT95541.01921968
    4
    2023-01-29 00:00:00.000SWEAT190632.623729055
    5
    2024-02-21 00:00:00.000SWEAT138714.23724325
    6
    2024-11-06 00:00:00.000SWEAT107653.700276674
    7
    2022-11-07 00:00:00.000SWEAT1070584.02474778
    8
    2023-02-20 00:00:00.000SWEAT206698.772948283
    9
    2023-11-03 00:00:00.000SWEAT122448.212350696
    10
    2024-01-09 00:00:00.000SWEAT134209.965240295
    11
    2023-07-08 00:00:00.000SWEAT91502.717560814
    12
    2023-02-26 00:00:00.000SWEAT182653.769466747
    13
    2024-10-02 00:00:00.000SWEAT87908.273522402
    14
    2023-11-09 00:00:00.000SWEAT121094.001854581
    15
    2024-09-04 00:00:00.000AURORA101065.111983115
    16
    2023-06-17 00:00:00.000AURORA77087.59099241
    17
    2023-12-29 00:00:00.000AURORA267822.579180596
    18
    2022-12-11 00:00:00.000AURORA193871.237577573
    19
    2024-04-01 00:00:00.000AURORA345321.634021168
    20
    2024-04-02 00:00:00.000AURORA327331.058031415
    ...
    14299
    733KB
    125s