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

Use large cluster for slippage execution #321

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 8 additions & 2 deletions src/fetch/dune.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Contributor

Choose a reason for hiding this comment

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

In my opinion since this is business critical we should be defaulting to large. What do you think?

Suggested change
performance: str = "medium",
performance: str = "large",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I like it. In that case we can set the default performance when instantiating the client. I'll move the parameter to the appropriate place.

) -> 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)

Expand Down Expand Up @@ -121,4 +126,5 @@ def get_period_slippage(self, job_id: Optional[str] = None) -> list[DuneRecord]:
],
),
job_id,
performance="large",
)
Loading