Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Sync price feed #125

Merged
merged 8 commits into from
Nov 11, 2024
Merged

Sync price feed #125

merged 8 commits into from
Nov 11, 2024

Conversation

harisang
Copy link
Contributor

@harisang harisang commented Nov 4, 2024

This PR adds a simple job that pushes all prices collected in the prices table of the analytics db to Dune. It mimics PR #103, and is meant to run as a cronjob. I followed the "legacy method" as there are some concerns about the current way Prefect has been integrated in this repo.

I also prepared this PR in the infra repo. https://github.com/cowprotocol/infrastructure/pull/2217

Note: there are currently not any tests. I saw there are some tests for the app-data sync, so i could try to basically copy-paste those, as i am not sure what's the best way to test this

@harisang harisang marked this pull request as ready for review November 4, 2024 23:41
@harisang harisang requested a review from fhenneke November 7, 2024 09:10
Copy link
Contributor

@fhenneke fhenneke left a comment

Choose a reason for hiding this comment

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

Code looks reasonable.

If you do not intend to add tests in this PR, please add an issue and add tests later. We need to test stuff like this.

@harisang
Copy link
Contributor Author

harisang commented Nov 11, 2024

Code looks reasonable.

If you do not intend to add tests in this PR, please add an issue and add tests later. We need to test stuff like this.

How would a test look like though?

As a sanity check, one can set

PRICE_FEED_TARGET_TABLE = "test_price_feed_ethereum"
DUNE_API_REQUEST_TIMEOUT = 600

run

python -m src.main --sync-table price_feed

and confirm the table on dune is being updated.

But i am not sure what a test would check, except for basically running the above command and syncing into some test table.

@harisang harisang merged commit 92e702d into main Nov 11, 2024
7 checks passed
@harisang harisang deleted the sync_mainnet_price_feed branch November 11, 2024 16:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants