Skip to content

Commit

Permalink
[Revenue] Add Revenue by solver/integrator per chain (#109)
Browse files Browse the repository at this point in the history
* [Revenue] Add monthly DAO revenue query

* some more comments for readability

* top level query comments

* [Revenue] Per Chain Queries

* fix lint

* exclude mispriced trades

* some bugfixes

* [Revenue] Add Reveny by solver/integrator per chain
  • Loading branch information
fleupold authored Jan 8, 2025
1 parent bb45caf commit 4cae9c1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- This query returns the daily revenue grouped by integration for a specific target chain
-- Parameters:
-- {{ui_fee_recipient}} - the partner address that receives the CoW Swap UI fee
-- {{blockchain}} - the chain for which to collect the data

select
s.name,
date(block_time) as "day",
coalesce(sum("Limit"), 0) + coalesce(sum("Market"), 0) + coalesce(sum("UI Fee"), 0) + coalesce(sum("Partner Fee Share"), 0) as total
from "query_4217030(blockchain='{{blockchain}}',ui_fee_recipient='{{ui_fee_recipient}}')" as r
left join cow_protocol_{{blockchain}}.solvers as s
on r.solver = s.address
group by 1, 2
13 changes: 13 additions & 0 deletions cowprotocol/revenue/daily_revenue_by_solver_per_chain_4515000.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- This query returns the daily revenue grouped by solver for a specific target chain
-- Parameters:
-- {{ui_fee_recipient}} - the partner address that receives the CoW Swap UI fee
-- {{blockchain}} - the chain for which to collect the data

select
s.name,
date(block_time) as "day",
coalesce(sum("Limit"), 0) + coalesce(sum("Market"), 0) + coalesce(sum("UI Fee"), 0) + coalesce(sum("Partner Fee Share"), 0) as total
from "query_4217030(blockchain='{{blockchain}}',ui_fee_recipient='{{ui_fee_recipient}}')" as r
left join cow_protocol_{{blockchain}}.solvers as s
on r.solver = s.address
group by 1, 2

0 comments on commit 4cae9c1

Please sign in to comment.