Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Warn and merge if solvers appear in prod and barn (#411)
This PR adds default handling in case solvers appear in prod and barn. In such cases, a warning is emitted and data is merged. At the moment, if settlement in prod and barn are settled by the same address (or rather if the same address is reported during bidding), solvers can appear in multiple rows in `batch_rewards_df` here. Since we later merge on solvers, we might assign slippage or quote rewards to a solver twice. A similar thing can happen with `quote_rewards_df`. With this PR, duplicate entries are detected after fetching data and suitably merged. All numerical columns are summed in merging. The columns containing list entries on partner fees are concatenated. The assumption on unique solvers is later checked at the point where it is required. This is more of a hot fix and refactoring is required to make the code understandable. One alternative would be to implement all processing of the fetched data in `payouts.py` where the rest of the processing happens. With this PR there is a mix of fetching, checking, merging of rewards, followed by checking and merging of rewards, followed by checking them again in `construct_payout_dataframe`. Before this PR, there was fetching, merging of rewards, then merging of rewards, then checking and merging. So generally quote confusing. # Testing plan I tested the code for the accounting week 2024-10-15 -- 2024-10-22 and it produced the roughly same amounts which were used for payments. There was a difference of 0.003 ETH and around 100 COW. This difference if probably because in the actual payment, data was not merged but removed. I have not added a test yet.
- Loading branch information