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

update missing prices script #15

Merged
merged 6 commits into from
Oct 19, 2022
Merged

update missing prices script #15

merged 6 commits into from
Oct 19, 2022

Conversation

bh2smith
Copy link
Contributor

Used to generate: duneanalytics/spellbook#1639

Note that it requires having downloaded the query results of https://dune.com/queries/1317238 and saving them to "out/missing-token-prices.csv".

Note this is a total hack and could easily be cleaned up (with types instead of dicts).

Test Plan

python -m src.missing_prices

@bh2smith bh2smith requested a review from gentrexha October 19, 2022 10:33
Copy link
Contributor

@gentrexha gentrexha left a comment

Choose a reason for hiding this comment

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

Great job Ben!

Left one minor comment and a discussion comment for the future. Other than LGTM!

src/missing_prices.py Show resolved Hide resolved
Comment on lines +130 to +139
if token["address"].lower() in coins:
paprika_data = coins[token["address"].lower()]
dune_row = (
str(paprika_data["id"]),
"ethereum",
str(paprika_data["symbol"]),
str(paprika_data["address"].lower()),
int(token["decimals"]),
)
res.append(dune_row)
Copy link
Contributor

Choose a reason for hiding this comment

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

Also for the future we might wanna look into https://marshmallow.readthedocs.io/en/stable/ for easier object serialization/deserialization . What's your take on that?

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 would very much like to do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am just not so sure how well it will jive with the Ethereum Types. I have been having quite some difficulty with that lately.

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome! We should definitely give it a go and see how we can work with it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will create an issue for this and link it to the TODO about removing Any above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#20

@bh2smith bh2smith mentioned this pull request Oct 19, 2022
@bh2smith bh2smith merged commit 67a0f71 into main Oct 19, 2022
@bh2smith bh2smith deleted the update-missing-prices-script branch October 19, 2022 12:23
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.

2 participants