-
Notifications
You must be signed in to change notification settings - Fork 1
Simplify protocol fee calculations and remove consistency rewards (mirroring solver rewards changes) #114
Conversation
fhenneke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good.
The only thing missing are new tests for order rewards, right?
Co-authored-by: Felix Henneke <[email protected]>
Co-authored-by: Felix Henneke <[email protected]>
This is now addressed. It would be good to check old vs new behavior (by recovering the results from Dune). It seems there are some discrepancies, which i believe should be due to rounding/slightly different ways of computing protocol fees, but would like to check 1-2 examples in more detail. |
|
I ran the proposed order rewards query for the accounting period of Oct 8-15, 2024, and it seems that indeed results look fine. https://dune.com/queries/4186410 The only non-trivial discrepancies where showing up for trades involving this token: https://etherscan.io/token/0x30ae41d5f9988d359c733232c6c693c0e645c77e which is a token with 0 decimals. Not sure how we handle such tokens throughout our scripts tbh. So i am fine merging this PR, if you also agree @fhenneke |
This PR mirrors the changes in the solver rewards repo from the following two PRs:
Concretely, the calculation of protocol fees in the sql query is simplified by a lot, and consistency rewards are removed as they are no longer used.
Note: some tests needed updating since the new way of fetching protocol fees is not available for the block range the test was set up for. The tests were updated accordingly, and one (bit strange) way to verify the numbers is to run the following dune query, as the data for that block range on Dune have been uploaded via the old (and NOT the proposed) and tested way. The tiny discrepancies are a result of rounding "errors", but they are very small.
For the batch rewards test, this query should be used
while for the order rewards test, this query should be used
As for the integrator fees test, this range on Dune should be user:
block_number>= 20934805 and block_number <= 20934809