Query editor
-- This query gets all the rewards awarded to each solver, up untill the cip 20 rules-- It is decomposed by the different environmentswith--- The initial launch of solver rewards was March 2022.--- Solvers were awarded 100 COW tokens per settled batch.pre_cip_10 as (selectsolver_address as solver,cast(100 * count(*) as uint256) as cow_rewardfrom cow_protocol_ethereum.batches-- CIP-10 Cutoff from Snapshot:-- https://snapshot.org/#/cow.eth/proposal/0x5ccfa8fb4ae80d62b35ca83591e9986aae85a3169c10b55d8dd53b33a191fd6bwhereblock_date < date(timestamp '2022-06-21')and block_date > date(timestamp '2022-03-01') -- Start Date of Solver rewardsgroup by solver_address),--- CIP-10 introduced a modification to the reward scheme from 100 COW per batch to:--- 50 COW per batch + 35 COW per trade.pre_cip14 as (selectsolver_address as solver,cast(50 * count(*) + 35 * sum(num_trades) as uint256) as cow_rewardfrom cow_protocol_ethereum.batches-- pre CIP-14 https://snapshot.org/#/cow.eth/proposal/0x3c84fc8e3cfe9cc6df76198d5031fae6580d8f9531f5b92ca3adedbc976cb1e5whereblock_date < date(timestamp '2022-10-25')and block_date >= date(timestamp '2022-06-21') -- CIP-10 cutoffgroup by solver_address),--- Risky Batches are defined as--- batches containing interactions carrying revert risk due to changing prices (i.e. DEX interactions).--- These are "weakly" classified by interactions which are NOT token approvals, transfers and (un)wrapping (W)ETH--- This table gathers all transactions containing at least one interaction carrying revert risk.risky_batches as (select distinctevt_tx_hash,false as risk_freefrom gnosis_protocol_v2_ethereum.GPv2Settlement_evt_Interactionwhereevt_block_time >= timestamp '2022-10-25'and selector not in (0x095ea7b3, -- approve0x2e1a7d4d, -- withdraw0xa9059cbb, -- transfer0x23b872dd -- transferFrom)),--- CIP-14 introduced a "Risk Adjusted" reward scheme.--- Rewards (per order) are computed in the backend with a revert risk factor as part of the forumlation.--- These rewards are then stored in the backend and streamed into dune community sources.post_cip14 as (selectsolver,--- Note that raw cow_reward is not necessarily the final reward valuation.