Skip to content

Commit

Permalink
Commenting code, using materialized view and removing query not on dune
Browse files Browse the repository at this point in the history
  • Loading branch information
PoloX2021 committed Jan 20, 2025
1 parent 4f41541 commit 51238f3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 31 deletions.
15 changes: 7 additions & 8 deletions cowamm/profitability/lp_prices/cow_amm_lp_4420687.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
-- Issues with the other version (4420687)
-- Trying by accessing only once the logs table to get assets reserve
-- However for periods longer than 1 month, the query exceeds cluster capacity
-- The issue is with the join between both reserves_delta tables
-- Although this table is only 4000 rows at most (~10kb)

-- This query gets all the transfers during a day for all existing CoW AMMs:
-- Reserve tokens and lp tokens
--Parameters
-- {{blockchain}}: The blockchain to query
-- {{start}}: The start date of the analysis
Expand All @@ -19,14 +15,17 @@ with date_range as (
)) t (day) --noqa: AL01
),

--use the materialized view of query_3959044
--Use the materialized view of query_3959044
--This is necessary because of performance issues.
--For large time frames the query is slow because of multiple accesses to logs
--The query has to run after the materialization.
cow_amm_pool as (
select
created_at,
token_1_address as token0,
token_2_address as token1,
address as contract_address
from query_3959044
from dune.cowprotocol.result_balancer_co_w_am_ms
where blockchain = '{{blockchain}}'
),

Expand Down
23 changes: 0 additions & 23 deletions cowamm/profitability/lp_prices/output_model.sql

This file was deleted.

2 changes: 2 additions & 0 deletions cowamm/profitability/lp_prices/uni_style_lp_4420675.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-- This query gets the reserve of every Uni style pool at the end of a day
-- and the lp token transfers
--Parameters
-- {{blockchain}}: The blockchain to query
-- {{start}}: The start date of the analysis
Expand Down

0 comments on commit 51238f3

Please sign in to comment.