From 60e2af71b7481b395a76b69eca073b5df1a0696e Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Tue, 25 Jul 2023 10:54:41 +0300 Subject: [PATCH 1/3] use large cluster for slippage query execution --- src/fetch/dune.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fetch/dune.py b/src/fetch/dune.py index 3b0aad44..0057b3ea 100644 --- a/src/fetch/dune.py +++ b/src/fetch/dune.py @@ -108,7 +108,8 @@ def get_period_slippage(self, job_id: Optional[str] = None) -> list[DuneRecord]: ] # trigger dashboard update self.dune.execute( - self._parameterized_query(QUERIES["DASHBOARD_SLIPPAGE"], params=params) + self._parameterized_query(QUERIES["DASHBOARD_SLIPPAGE"], params=params), + performance="large" ) return self._get_query_results( From fb363c626587d38a6f4800975dbb5ed0dbaddf4f Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Tue, 25 Jul 2023 15:41:37 +0300 Subject: [PATCH 2/3] had the config in the wrong place --- src/fetch/dune.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fetch/dune.py b/src/fetch/dune.py index 0057b3ea..762d82b6 100644 --- a/src/fetch/dune.py +++ b/src/fetch/dune.py @@ -49,12 +49,17 @@ def _parameterized_query( return query_data.with_params(params) def _get_query_results( - self, query: Query, job_id: Optional[str] = None + self, + query: Query, + job_id: Optional[str] = None, + performance: str = "medium", ) -> list[dict[str, str]]: """Internally every dune query execution is routed through here.""" log.info(f"Fetching {query.name} from query: {query}") if not job_id: - exec_result = self.dune.refresh(query, ping_frequency=15) + exec_result = self.dune.refresh( + query, performance=performance, ping_frequency=15 + ) else: exec_result = self.dune.get_result(job_id) @@ -109,7 +114,6 @@ def get_period_slippage(self, job_id: Optional[str] = None) -> list[DuneRecord]: # trigger dashboard update self.dune.execute( self._parameterized_query(QUERIES["DASHBOARD_SLIPPAGE"], params=params), - performance="large" ) return self._get_query_results( @@ -122,4 +126,5 @@ def get_period_slippage(self, job_id: Optional[str] = None) -> list[DuneRecord]: ], ), job_id, + performance="large", ) From dc755b8ff0aaae4383a813268453d0d8649c1b39 Mon Sep 17 00:00:00 2001 From: Benjamin Smith Date: Tue, 25 Jul 2023 19:45:01 +0300 Subject: [PATCH 3/3] Update src/fetch/dune.py --- src/fetch/dune.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetch/dune.py b/src/fetch/dune.py index 762d82b6..52edfe8b 100644 --- a/src/fetch/dune.py +++ b/src/fetch/dune.py @@ -113,7 +113,7 @@ def get_period_slippage(self, job_id: Optional[str] = None) -> list[DuneRecord]: ] # trigger dashboard update self.dune.execute( - self._parameterized_query(QUERIES["DASHBOARD_SLIPPAGE"], params=params), + self._parameterized_query(QUERIES["DASHBOARD_SLIPPAGE"], params=params) ) return self._get_query_results(