This repository has been archived by the owner on Dec 20, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify protocol fee calculations and remove consistency rewards (mi…
…rroring solver rewards changes) (#114) This PR mirrors the changes in the solver rewards repo from the following two PRs: - cowprotocol/solver-rewards#401 - cowprotocol/solver-rewards#404 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 ``` select block_number, block_deadline, tx_hash, solver, data.execution_cost, data.surplus, data.protocol_fee, data.fee, data.uncapped_payment_eth, data.capped_payment, data.winning_score, data.reference_score from cowswap.raw_batch_rewards where block_deadline >= 20936269 and block_deadline <= 20936280 ``` while for the order rewards test, this query should be used ``` select block_number, order_uid, solver, data.quote_solver, tx_hash, data.surplus_fee, data.amount, data.protocol_fee, data.protocol_fee_token, data.protocol_fee_native_price, data.quote_sell_amount, data.quote_buy_amount, data.quote_gas_cost, data.quote_sell_token_price, data.partner_fee, data.partner_fee_recipient, data.protocol_fee_kind from cowswap.raw_order_rewards where block_number>= 20934809 and block_number <= 20934808 + 17 order by block_number ASC ``` As for the integrator fees test, this range on Dune should be user: `block_number>= 20934805 and block_number <= 20934809` --------- Co-authored-by: Felix Henneke <felix.henneke@protonmail.com>
- Loading branch information