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

Solver Dashboard #56

Closed
wants to merge 45 commits into from
Closed

Solver Dashboard #56

wants to merge 45 commits into from

Conversation

PoloX2021
Copy link
Contributor

Adds all the queries from 2 dune solver dashboards:

The first dashboards has the following 10 queries. The first 5 have been updated and adapted to fit every chain. "Solver_rewards_total" has yet to be revised but that is more complex and being tackled. The 4 last ones are no longer relevant.

  • active_solvers
  • batch_settlement_info
  • daily_solver_stats
  • ranked_active_solvers
  • solver_failure_rates_by_env
  • solver_rewards_total: yet to be revised
  • cost_coverage_by_solver_info: no longer useful as there are no more fees
  • cost_coverage_production_solver: no longer useful as there are no more fees
  • cow_rewards_total: up to date, ready to be extended to other chains
  • solver_yields: not useful

The second has the 5 following. No modification from the dashboard were added.

  • cow_protocol_rewards_and_quote_competition
  • batch_base_data
  • number_capped_reward_batches
  • order_base_data
  • protocol_rewards_daily

- Frequence to choose the agregation frequence
- LastNDays to choose the time period over which to compute the metric
…le coswap.raw_batch_rewards into each specific column
Copy link
Contributor

@fleupold fleupold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice initiative! Should we remove the queries that are no longer useful to make sure we don't display any useless or outdated data in that dashboard?

@PoloX2021
Copy link
Contributor Author

I think that the no longer used queries should disappear at some point. However, the cost_coverage might change to a new metric (still in debate) and the rewards need modifications.
So, I believe it is best to wait a bit to sort these details out before deleting them

@PoloX2021
Copy link
Contributor Author

Sorry for mixing up cow amm dashboard and solver dashboard in the same query, still figuring out the best practice for github. Will separate different prs in the future.
Apart from the cost coverage and the rewards which are not yet up to date, does the folder related to solvers seem correct?

@fleupold
Copy link
Contributor

Will separate different prs in the future.

I think it's still fairly easy to split this PR (by simply removing the solver dashboard folder and creating a new PR from those files). I feel somewhat confident commenting on the AMM parts (still a few comments seem unaddressed), but less sure about which parts of the solver dashboard we want to keep or if we just want to "dump" all queries under version control without improving them for now.

@harisang
Copy link
Contributor

Sorry for mixing up cow amm dashboard and solver dashboard in the same query, still figuring out the best practice for github. Will separate different prs in the future. Apart from the cost coverage and the rewards which are not yet up to date, does the folder related to solvers seem correct?

Sorry for being so late here. I am starting to review the part for the solver dashboard. Let us know if you can actually split this PR already, so that i wait and add my comments in the new PR

-- First we find the firest settlement for each solver
-- Then we fet the environment and name of the solver for the prod and barn environments
-- Finally we display the name of the solver with both of its addresses
-- Note: if a solver has x barn address and y prod address, we will display x*y rows for that solver
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. We might need to rethink that, although the goal is to have at most one address per solver per environment, or drop the distinction between prod and barn (for solvers) altogether.

I think i am fine with this, for now, although already today Barter has multiple and unnecessary entries because of that colocated and non-colocated addresses being whitelisted at the same time
https://dune.com/queries/1372857

-- Parameters
-- {{blockchain}} - blockchain name

WITH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
WITH
with

when '{{blockchain}}'='arbitrum' then
CONCAT('<a href="https://arbiscan.io/tx/', cast(tx_hash as varchar), '" target="_blank">', cast(tx_hash as varchar), '</a>')
end as txHash,
gas_price / pow(10, 9) as gas_price,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the current version of the query on Dune (not sure if it is identical to this PR though) and gas price looks like it's a integer-> https://dune.com/queries/1373033
so some fixing is probably needed here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comes from the way it is being displayed.
In the data it is represented as the value of Gwei for one unit of gas which is not an integer. But then, the table has been rounded to the closest integer, in the display parametets.

token_approvals
--case when tx_cost_usd > 0 then fee_value / tx_cost_usd else null end as coverage
FROM cow_protocol_{{blockchain}}.batches b
JOIN num_tokens_traded
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
JOIN num_tokens_traded
join num_tokens_traded

@harisang
Copy link
Contributor

Closing as the new PR #64 is meant to replace this one.

@harisang harisang closed this Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants