-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implementation of CIP-38 #345
Conversation
Should we try to remove unnecessary parts of the query? One thing that comes to mind is carrying around |
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.
Added a few comments
I thought about removing lots of stuff from the batch rewards query. I did not do it because I want to use a copy (of the first part of) the query without changes.We might want to sync more data on dune. |
I ran the script locally and it crashed in this line. solver-rewards/src/fetch/payouts.py Line 420 in 4f101e9
I suspect we need to rename |
update batch rewards query - remove network fee from payment computation (alternative: use winning_score) - remove execution cost in final result - add network fees in final result - combine data aggregation in the end - rename *_wei to * - rename payment_eth to primary_reward_eth - adapt tests update payouts - remove cost from reward type and data frames - remove execution cost from reward and reimbursement computation - add network fees to slippage (alternative: modify slippage computation) - rename payment_eth to primary_reward_eth - rename reward_* to primary_reward_* - adapt tests
- added `network_fee_eth` to checked dataframe columns, adapt test - added comments to batch rewards query to clarify what happens when data is missing - fix typo in data validation
we should at some point add a test for that
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.
Looks good.
@fhenneke Have you done a dry run to double-check that results make sense? |
This PR implements changes to solver rewards scripts for CIP-38 on ranking by surplus.
The main change is that rewards are computed based on surplus (and protocol fees) and not based on surplus and network fees (and protocol fees). Additionally, there is no cost reimbursement but the slippage computation includes a contribution from fees.
The implementation in this PR is quite minimal.
The batch rewards query ignores network fees for payment but explicitly returns aggregated network fees to add them to slippage. The other changes are only slight renames (e.g.
from
payment_eth
toprimary_reward_eth
). Test have been adapted accordingly.The slippage query does not change. Instead, when generating the final merged dataframe, network fees are explicitly added to slippage. Test have been adapted and a few comments were added.
A few things can be implemented differently:
winning_score
. This is a bit simpler but would require checking somewhere that the score is consistent with the on-chain settlement.The changes to computing rewards in
batch_rewards.sql
need to be ported to dune-sync.