mariyaMarket-CAP bLUNA & bETH
    Updated 2022-04-09
    with bLuna as(
    with t1 as(
    select
    sum (bonded_amount) as bond_bLuna
    from anchor.bonds
    where bonded_currency='uluna'
    ),
    t2 as (
    with bluna_coll as (
    select sum(amount) as coll_1
    from anchor.collateral
    where currency = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp'
    and event_type= 'provide'
    ),
    bluna_with as (
    select
    sum(amount) as coll_2
    from anchor.collateral
    where currency = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp'
    and event_type = 'withdraw'
    ),
    bluna_liq as (
    select
    sum(liquidated_amount) as coll_3
    from anchor.liquidations
    where liquidated_currency = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp'
    )
    select
    (coll_1 - coll_2 - coll_3) as bLuna_collateral
    from bluna_coll , bluna_with , bluna_liq
    )
    select
    'bLUNA' as bAsset,
    (bond_bLuna - bLuna_collateral) as market_cap,
    bLuna_collateral as collateral_anchor,
    (collateral_anchor/market_cap)*100 as Locked_percentage
    Run a query to Download Data