Skip to content
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

[Easy] Reorder payout dashboard columns #40

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading