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

Add raw order data wrapper query #80

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

harisang
Copy link
Contributor

@harisang harisang commented Dec 3, 2024

Similar to PR #77 , for raw order data.
https://dune.com/queries/4364122

@harisang harisang marked this pull request as ready for review December 5, 2024 15:02
from_hex(d.solver) as solver,
from_hex(d.data.quote_solver) as quote_solver, --noqa: RF01
from_hex(d.tx_hash) as tx_hash,
cast(d.data.surplus_fee as decimal(38, 0)) as surplus_fee, --noqa: RF01
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there precedence for this number of decimals?
Our database uses decimal(78, 0) for most things, which can hold a (u)int256.

Copy link
Contributor Author

@harisang harisang Dec 5, 2024

Choose a reason for hiding this comment

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

If I run

select cast(10 as decimal(39,0))

I get an error Error: DECIMAL precision must be in range [1, 38]: 39

So i decided to max it out, but didn't think this through much tbh

Copy link
Contributor

Choose a reason for hiding this comment

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

Dune seems to only support 38 digits of precision.
An alternative would be to use integers, which is compatible with data types used by the smart contract.

past_data_ethereum as (
select
s.environment,
-1 as auction_id,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this encoded as -1 and not just Null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah i see your point.... Will update it.

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.

Generally looks fine.

The comments on the other PR for batch rewards still apply. E.g. if this is automatically generated, it should be moved out of this repo at some point (e.g. now).

@harisang
Copy link
Contributor Author

harisang commented Dec 5, 2024

if this is automatically generated, it should be moved out of this repo at some point (e.g. now).

I added both queries so that there is a way to review them. I agree that we could actually just use these PRs to review the queries but not merge them.

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