-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Revenue] Add Revenue by solver/integrator per chain (#109)
* [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
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
cowprotocol/revenue/daily_revenue_by_integration_per_chain_4515022.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
13
cowprotocol/revenue/daily_revenue_by_solver_per_chain_4515000.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |