Skip to content

Commit

Permalink
rpl: adding coalesces and outstanding supply by token
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwes committed Aug 27, 2024
1 parent b636228 commit cf1a203
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ select
, 0 as operating_expenses
, COALESCE(token_incentives_usd, 0) as total_expenses
, protocol_revenue - token_incentives as protocol_earnings
, COALESCE(os.reth_supply, 0) as outstanding_supply
, staked_eth_metrics.amount_staked_usd as net_deposits,
, staked_eth_metrics.amount_staked_usd as tvl,
, COALESCE(t.treasury_value, 0) as treasury_value
, COALESCE(tn.treasury_native, 0) as treasury_native
, COALESCE(tn.treasury_native, 0) as treasury_value_native
, COALESCE(nt.net_treasury_value, 0) as net_treasury_value
, COALESCE(p.fdmc, 0) as fdmc
, COALESCE(p.market_cap, 0) as market_cap
Expand All @@ -113,6 +116,7 @@ select
from staked_eth_metrics
left join fees_revs_cte f using(date)
left join token_incentives_cte ti using(date)
left join outstanding_supply_cte using(date)
left join treasury_cte t using(date)
left join treasury_native_cte tn using(date)
left join net_treasury_cte nt using(date)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ select
, COALESCE(ti.token_incentives, 0) as token_incentives
, 0 as operating_expenses
, COALESCE(token_incentives, 0) as total_expenses
, protocol_revenue - token_incentives as protocol_earnings
, staked_eth_metrics.num_staked_eth as net_deposit
, os.reth_supply as outstanding_supply
, staked_eth_metrics.num_staked_eth as tvl
, coalesce(protocol_revenue,0) - coalesce(token_incentives,0) as protocol_earnings
, coalesce(staked_eth_metrics.num_staked_eth, 0) as net_deposit
, coalesce(os.reth_supply, 0) as outstanding_supply
, coalesce(staked_eth_metrics.num_staked_eth, 0) as tvl
, COALESCE(t.treasury_value, 0) as treasury_value
, COALESCE(tn.treasury_native, 0) as treasury_native
, COALESCE(nt.net_treasury_value, 0) as net_treasury_value
Expand Down

0 comments on commit cf1a203

Please sign in to comment.