• © Goverland Inc. 2026
  • Privacy Policy
  • Terms of Use
CoW DAOCoW DAOby0x6B809ef125e708702d33111C4b7Ee49460260DF70x6B80…0DF7

CIP-38: Solver Computed Fees & Rank by Surplus

Voting ended almost 2 years agoSucceeded
CIP: 38
title: Solver Computed Fees & Rank by Surplus
author: @felixhenneke, @AndreaC, @harisang
status: active
created:  2023-11-28

Simple summary

Currently, CoW Protocol collects fees from users and then uses these fees to reimburse solvers’ gas costs. We instead propose that solvers collect a “network fee” directly to cover their gas costs. This would mean eliminating our current fees and ranking solutions based on surplus alone.

With the proposed changes we also simplify the collection of protocol fees (as introduced in CIP-34). Such fees are collected by solvers on behalf of the protocol and paid to the CoW DAO in COW tokens.

Motivation

Today, CoW protocol reimburses solvers' gas costs by collecting fees from users. Gas costs and fees are, however, not directly connected in the solver competition. This is inefficient for multiple reasons:

  • The benefit of batching orders (in terms of gas savings) is not always correctly passed on to users.
  • The protocol must monitor fees set by solvers, adding complexity.

This CIP proposes that we eliminate our current fee and stop reimbursing solvers for gas. In practice, we propose to stop reimbursing solvers for gas by ranking solutions based on “surplus” alone and rewarding the winning solver:

cap(surplus - second_highest_surplus)

paid in COW. Solvers would, therefore, no longer be guaranteed to receive a reward greater than their expenditure in gas costs, and will need to cover these costs by charging accurate fees. Competition between solvers guarantees that these fees equal gas costs, which is one of the main goals that motivated this proposed change.

Eliminating the current fees simplifies the protocol and how CoW DAO charges protocol fees (introduced in CIP-34). We propose that the protocol fee should be collected by solvers on behalf of CoW Protocol and then reimbursed weekly to the protocol in COW (the currency used for solver rewards). The protocol fee therefore introduces a new utility for the COW token (and a new source of demand, as part of normal protocol operations) that should positively impact its price. Maintaining a healthy token is in the interest of CoW DAO, so this should be seen as a positive development for CoW DAO and COW token holders.

Finally, we want to clarify that the above proposal does not incur any change in the quotes the users will be receiving, and the only difference is that the users would be signing zero-fee orders while the limit prices would remain unchanged.

Specification

Solutions submitted by solvers contain orders together with their sell, buy, and fee amounts (specified in the sell token), and prices for all tokens traded by orders in the solution. The quality of a solution is now defined as the sum of surplus of the different orders, measured in ETH; the conversion to ETH will be done the same way it is done now, i.e., via the native prices vector provided in the auction instance sent to solvers. The solver whose solution has the largest quality wins the solver competition and executes their solution. Following a second-price mechanism (similar to CIP-20), a winning solver who successfully executes its solution on chain, is paid

cap(winning_quality - reference_quality)

in COW tokens, and own all fees they collected in the settlement. The reference_quality is the quality of the second best solution or set to zero if there is only one solution.

On the other hand, if the winning solver fails to execute their solution on chain, they pay a penalty equal to

cap(reference_quality).

The (asymmetric) capping of rewards and penalties is currently specified in CIP-36. As with CIP-20, the rewards will only apply to Ethereum Mainnet.

For a solution to be valid we require the following properties. Let a user send Y tokens of A and receive X tokens of B. The solver sets a fee f in the sell token A. The reported prices for A and B are p_A and p_B, respectively. Then uniform clearing prices need to hold:

(Y - f) / X = p_B / p_A. [Uniform Clearing Prices, UCP]

In addition, we require

Y / X = const [Uniform directional prices, UDP]

on all trades selling A and buying B.

The UCP rule is the same as the one we currently use. The rule on directional prices is new and means that all users trading on a token pair see the same effective exchange rate (i.e., exchange rate after fees).

Note that UDP only specifies how fees are distributed within a single directed token pair. However, it does not provide rules/guidelines on batches where there are multiple disjoint orders getting settled. For that, we will invoke the EBBO and social consensus rules to ensure that no order is treated unfairly, and this entails each order getting charged a reasonable fee that is proportional to the gas cost it incurs within a batch. Moreover, the whole batch should pay a fee corresponding to the gas cost of executing the batch. In practice, we expect solvers to exercise common sense and charge reasonable fees to user orders, and the core team commits to proper monitoring of all settlements that take place so that such rules are checked on a per settlement basis. In case a solver intentionally misbehaves and violates some of the above rules, the DAO, via a vote, could slash a solver and its bond.

Ranking and network fees

With this proposal, solvers compute fees for all orders and the protocol stops accepting orders with a positive signed fee. This allows solvers to give all benefits from cost reductions to users. We note that solvers can already set fees for a subset of orders, namely the so-called limit orders. Within the previous ranking and payment mechanism, however, solvers were not explicitly incentivized to choose accurate fees. This changes with this proposal. With this proposal, all user fees are determined and owned by solvers, and these fees are removed from the ranking and reward mechanism. This creates an incentive for solvers to choose fees to exactly cover execution costs of batches.

The rule on directional uniform prices determines the distribution of fees across orders on the same token pair. It effectively means that fees are split proportional to volume. This rule thus provides additional guarantees for fairness on top of the current rules on uniform clearing prices.

The total fee on the batch as well as the distribution of fees of orders on different token pairs are not restricted by hard rules within the mechanism yet. The main protection for users in this case is through social consensus rules (e.g., EBBO). In particular it is not allowed to shift large fractions of fees of a batch to orders not responsible for correspondingly large parts of executions. This is a form of shifting surplus, forbidden by our current social consensus rules on provision of unfair prices (as specified in CIP-11).

We keep the second-price auction character of the competition from CIP-20, i.e., we reward solvers on how much their solutions improve upon those of the rest of the competition.

Solvers might choose to collect tokens from network fees in the settlement contract. We propose to treat those funds as slippage. This means that all buffer changes from a settlement are converted to ETH and paid to solvers in ETH once a week.

Extension to protocol fee

The mechanism described above can be extended to allow for a protocol fee (introduced in CIP-34) collected by solvers on behalf of the protocol. In that case, the quality of a solution is the sum of the surplus of the different orders and the protocol fees collected; the rationale being that solvers should still try to maximize the “size of the pie” and then distribute it accordingly to users and the protocol.

For each order, in addition to the sell, buy, and network fee amount, there is a protocol fee of f_{p,sell} and f_{p,buy} denominated in the sell token A or buy token B, respectively. The equation for uniform clearing prices then becomes

(Y - f - f_{p,sell}) / (X + f_{p,buy}) = p_B / p_A.

The equation for uniform directional prices becomes

(Y - f_{p,sell}) / (X + f_{p,buy}).

From the practical viewpoint, solvers collect the protocol fee (for example, by accumulating it in the settlement contract as positive slippage) and forward it to the protocol once a week as part of the weekly payouts. We will later decide whether the protocol fee is paid back to the protocol in COW or in ETH (and hence is netted out from one of the two payments). If the protocol fee is collected in ETH, it will be converted automatically into COW.

Timeline

We propose the following timeline:

  • Before the start of the new ranking, fixed-fee in-market orders from CoW Swap and third-party integrators will be continuously phased out in favor of zero-fee orders.
  • Starting on 19.3.2024 the new ranking by surplus is used in the competition.
  • The first payout based on surplus is on 26.3.2024.
  • Starting on 19.3.2024 orders with a non-zero fee are rejected by the protocol.
  • After 4 weeks of running the new ranking, we will analyze the caps for rewards. The caps will be reduced in case of overspending (with respect to the budget defined in CIP-36) and increased in case of underspending, as an amendment to CIP-36. At this time we will also start with automatic conversion of protocol fees to COW tokens.

Off-Chain Vote

For
52.74M vCOW96.9%
Against
1.69M vCOW3.1%
Abstain
5.02K vCOW0%
Quorum:156%
Download mobile app to vote

Timeline

Feb 23, 2024Proposal created
Feb 23, 2024Proposal vote started
Mar 01, 2024Proposal vote ended
Mar 01, 2024Proposal updated