Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Allow configuring contracts which are exempt from protocol fees #2461

Closed
fleupold opened this issue Mar 3, 2024 · 2 comments · Fixed by #2573
Closed

chore: Allow configuring contracts which are exempt from protocol fees #2461

fleupold opened this issue Mar 3, 2024 · 2 comments · Fixed by #2573
Assignees
Labels
E:4.2 Protocol Fee Implementation See https://github.com/cowprotocol/pm/issues/29 for details help wanted Extra attention is needed

Comments

@fleupold
Copy link
Contributor

fleupold commented Mar 3, 2024

Background

Our CoW AMM experiment is placing a lot of limit orders, some of which are being classified as out of market orders (mainly because they are partially fillable and usually a bit larger than what is currently fillable at the specified price).
It therefore pays significant protocol fees, impacting it's own PnL (cf. https://cowservices.slack.com/archives/C067ZLV8U13/p1709148518771459). In the next phase of the experiment, we want solvers to settle CoW AMM orders as JIT liquidity (thus not paying any protocol fee) and will think about monetizing this type of order separately.

Details

While it would be nice to index all CoW AMM orders automatically and exempt them from fees, I think the easiest and most pragmatic way for now would be to allow for a list of exempt traders (possibly with a discount factor).
In the future, we may have on-chain registries and more complicated logic for fee discounts (e.g. holding X CoW token results in X fee discount), but we can cross that bridge when we get there.

Acceptance criteria

https://explorer.cow.fi/address/0xBEEf5aFE88eF73337e5070aB2855d37dBF5493A4 no longer pays any protocol fees.

@fleupold fleupold added the E:4.2 Protocol Fee Implementation See https://github.com/cowprotocol/pm/issues/29 for details label Mar 3, 2024
@sunce86
Copy link
Contributor

sunce86 commented Mar 4, 2024

Does this mean using Liquidity orders type? This would make us move further from actually deprecating this type of order.

Edit: it would also mean that no gas fees are paid for them, as well.

@fleupold
Copy link
Contributor Author

fleupold commented Mar 4, 2024

In the current phase, these orders are placed via the API as limit orders, which should be exempt from protocol fees (but subject to surplus). I don't suggest to use liquidity orders for this, but instead have a list of owners which are exempt from fees.

In the next phase solvers are supposed to compute the optimal executed amounts just-in-time. However, the orders will still capture surplus. For this, we need to ammend the JIT fulfillment subtype. Note, the JIT orders are never passing through the API (they are created on the solver side and part of the solution), so I think we should still deprecate the Liquidity order type in the Orderbook and API as soon as possible.

@fleupold fleupold added the help wanted Extra attention is needed label Mar 15, 2024
@m-lord-renkse m-lord-renkse self-assigned this Mar 27, 2024
m-lord-renkse added a commit that referenced this issue Apr 5, 2024
# Description
Allow configuring contracts which are exempt from protocol fees.
Our CoW AMM experiment is placing a lot of limit orders, some of which
are being classified as out of market orders (mainly because they are
partially fillable and usually a bit larger than what is currently
fillable at the specified price).
It therefore pays significant protocol fees, impacting it's own PnL

# Changes
- Configure the driver to accept whitelisted address for protocol fee
discount
- Skip protocol fee for whitelisted addresses

## How to test
1. e2e tests
2. unit tests

Fixes #2461
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E:4.2 Protocol Fee Implementation See https://github.com/cowprotocol/pm/issues/29 for details help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants