opensource-observer / oso

Measuring the impact of open source software
https://opensource.observer
Apache License 2.0
69 stars 16 forks source link

Resolve discovered contracts shared by more than one project #1701

Closed ccerv1 closed 3 months ago

ccerv1 commented 3 months ago

What is it?

See here for query and snapshot result in Google Sheet

with cte as (
select
  to_artifact_name,
  event_source,
  count(distinct project_name) as num_projects,
  array_agg(distinct project_name) as projects,
  sum(amount) as gas_fees
from `oso.rf4_events_daily_to_project`
where event_type = 'CONTRACT_INVOCATION_DAILY_L2_GAS_USED'
group by 1,2
order by 3 desc)

select
  to_artifact_name,
  event_source,
  num_projects,
  projects,
  gas_fees / num_projects / 1e18 as gas_fees 
from cte
where cte.num_projects > 1
order by gas_fees desc
ccerv1 commented 3 months ago

https://github.com/opensource-observer/oss-directory/pull/419