-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR implements changes to solver rewards scripts for [CIP-38](https://snapshot.org/#/cow.eth/proposal/0xfb81daea9be89f4f1c251d53fd9d1481129b97c6f38caaddc42af7f3ce5a52ec) 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` to `primary_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: - Instead of computing payments from surplus and protocol fees, one could have used `winning_score`. This is a bit simpler but would require checking somewhere that the score is consistent with the on-chain settlement. - The slippage computation could have been adapted to not exclude network fees and use external prices for converting those fees to ETH. This would require uploading explicit information on fees and their native prices to dune. This should be done at some point, but maybe not for the release. The changes to computing rewards in `batch_rewards.sql` need to be ported to dune-sync. --------- Co-authored-by: Haris Angelidakis <[email protected]>
- Loading branch information
Showing
6 changed files
with
218 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.