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

Make block ranges consistent (take2) #330

Merged
merged 5 commits into from
Jan 10, 2024
Merged

Conversation

harisang
Copy link
Contributor

@harisang harisang commented Jan 7, 2024

This PR is based heavily on PR #329 but proposes a slightly different convention. Specifically, it assumes that we compute a start and end block for the accounting period, and both start and end block are included in the accounting, as it seems more natural to the author.

E.g., this means that for consecutive weeks, we have

week 1: [a,b]
week 2: [b+1, c]
week 3: [c+1, d]

etc.

All queries (except for the vouch registry one) have been updated in the form of forks. The plan would be to test this branch locally in the upcoming payouts of Jan 9, and compare results (or alternatively, use this branch in the dry-run script)

Once we are convinced that all changes are correct, we would then need to update the original Dune queries so that we continue using the same query ids.

@harisang harisang requested a review from fhenneke January 7, 2024 01:26
Copy link
Collaborator

@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.

I do like the approach with included start and end blocks better. It is way more intuitive to me. I would personally favor to include blocks on the start time and exclude blocks on the end time.

Regarding changing between to inequalities, one could even go with between everywhere. Since now we follow the SQL convention of in including the bounds. But being explicit is also fine.

queries/dune_v2/period_block_interval.sql Show resolved Hide resolved
queries/dune_v2/period_slippage.sql Outdated Show resolved Hide resolved
queries/dune_v2/period_block_interval.sql Show resolved Hide resolved
queries/dune_v2/period_slippage.sql Outdated Show resolved Hide resolved
@harisang
Copy link
Contributor Author

@fhenneke Should we merge this?

@harisang harisang merged commit 841ad72 into main Jan 10, 2024
6 checks passed
@harisang harisang deleted the consistent_block_range_take2 branch January 10, 2024 12:35
@github-actions github-actions bot locked and limited conversation to collaborators Jan 10, 2024
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