-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add partner fees verification query #29
Conversation
cowprotocol/accounting/rewards/mainnet/partner_fees_query_3602560.sql
Outdated
Show resolved
Hide resolved
cowprotocol/accounting/rewards/mainnet/partner_fees_query_3602560.sql
Outdated
Show resolved
Hide resolved
cowprotocol/accounting/rewards/mainnet/partner_fees_query_3602560.sql
Outdated
Show resolved
Hide resolved
-- {{result}} - two views of the result, one aggregated and one on a per tx basis | ||
|
||
with | ||
per_settlement_prelim as ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is probably not per settlement but per trade
per_settlement_prelim as ( | |
per_trade as ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I did rename some of the tables. Let me know what you think.
per_settlement as ( | ||
select * | ||
from | ||
per_settlement_prelim | ||
where | ||
raw_integrator_fee_in_eth > 0 | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get a per settlement value you would probably need
per_settlement as ( | |
select * | |
from | |
per_settlement_prelim | |
where | |
raw_integrator_fee_in_eth > 0 | |
), | |
per_settlement as ( | |
select | |
block_time, | |
tx_hash, | |
partner_recipient, | |
sum(est_partner_revenue) as est_partner_revenue, | |
sum(est_cow_revenue) as est_cow_revenue, | |
sum(raw_integrator_fee_in_eth) as raw_integrator_fee_in_eth | |
from | |
per_trade | |
where | |
raw_integrator_fee_in_eth > 0 | |
), |
This PR adds the query 3602560 that we use to verify partner fees each week under version control