From 99f2c7ec113608228e24b4689c8fa449e563cb19 Mon Sep 17 00:00:00 2001 From: Felix Leupold Date: Wed, 18 Sep 2024 17:42:57 +0200 Subject: [PATCH] [Easy] Reorder payout dashboard columns (#40) * [Easy] Reorder payout dashboard columns * Update cowprotocol/accounting/rewards/mainnet/mainnet_dashboard_query_2510345.sql Co-authored-by: Felix Henneke * adding columns --------- Co-authored-by: Felix Henneke --- .../mainnet_dashboard_query_2510345.sql | 62 ++++++++++--------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/cowprotocol/accounting/rewards/mainnet/mainnet_dashboard_query_2510345.sql b/cowprotocol/accounting/rewards/mainnet/mainnet_dashboard_query_2510345.sql index 6bf57677..c3982cfa 100644 --- a/cowprotocol/accounting/rewards/mainnet/mainnet_dashboard_query_2510345.sql +++ b/cowprotocol/accounting/rewards/mainnet/mainnet_dashboard_query_2510345.sql @@ -168,33 +168,39 @@ extended_payout_data as ( cd.primary_reward_cow as total_cow_reward, cd.primary_reward_eth as total_eth_reward from combined_data_after_service_fee as cd -), - -final_results as ( - select --noqa: ST06 - epd.*, - case - when is_overdraft then null - when reimbursement_eth > 0 and total_cow_reward < 0 - then reimbursement_eth + total_eth_reward - when reimbursement_eth < 0 and total_cow_reward > 0 - then 0 - else reimbursement_eth - end as eth_transfer, - case - when is_overdraft then null - when reimbursement_eth > 0 and total_cow_reward < 0 - then 0 - when reimbursement_eth < 0 and total_cow_reward > 0 - then reimbursement_cow + total_cow_reward - else total_cow_reward - end as cow_transfer, - case - when is_overdraft then total_outgoing_eth - end as overdraft, - reward_target - from extended_payout_data as epd - left join named_results as nr on epd.solver = nr.solver ) -select * from final_results +select --noqa: ST06 + name, + epd.solver as solver_address, + reward_target, + quote_reward, + case + when is_overdraft then null + when reimbursement_eth > 0 and total_cow_reward < 0 + then reimbursement_eth + total_eth_reward + when reimbursement_eth < 0 and total_cow_reward > 0 + then 0 + else reimbursement_eth + end as eth_transfer, + case + when is_overdraft then null + when reimbursement_eth > 0 and total_cow_reward < 0 + then 0 + when reimbursement_eth < 0 and total_cow_reward > 0 + then reimbursement_cow + total_cow_reward + else total_cow_reward + end as cow_transfer, + case + when is_overdraft then total_outgoing_eth + end as overdraft, + slippage_eth, + slippage_per_tx, + service_fee_enabled, + reimbursement_eth, + reimbursement_cow, + total_cow_reward, + network_fee_eth, + execution_cost_eth +from extended_payout_data as epd +left join named_results as nr on epd.solver = nr.solver