-
Notifications
You must be signed in to change notification settings - Fork 83
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
feat: Forward protocol fee to driver when solving #2084
Comments
Why is this necessary? Shouldn't we be able to compute the fee per auction in hindsight simply by using the quoted amounts we find in the database (and our fee policy). We will then "invoice" solvers that fee amount regardless of what driver implementation they are using. The default driver will make sure that sufficient fee amount is captured in the form of positive slippage. But I don't think the autopilot needs to store the fee amount per auction.
Would it be more flexible to define the fee field per order? This way we can also return it as part of the |
But we need to know this right? And the policy can change between auctions, for example, if we at some point want to try out some different fee parameters and restart the autopilot. So, basically, I meant to say this:
|
Here, I think you are referring to the protocol fee as a final result (when the auction is done and settlement is mined etc). |
Right, as long as we store the auction somewhere, we can later on recover the fee parameters. I want to avoid keeping another table with duplicate records of the actual fee that was captured in an auction if this can be determined from the input. |
BTW I think Nick left an implementation idea for this feature here. Just pointing it out in case we want to draw some inspiration from it. |
# Description Tackles #2083 and #2084. Defines fee policy configuration parameters. Based on them, we can take the protocol fee as a cut from price improvement or as a percent of the order volume (fixed fee in absolute value will be implemented later). On top of that, we also need two flags, for skipping in-market limit orders and twap orders, since default initial configuration will be to run the fee experiment only for out-of-market limit orders. Note that the quote is not forwarded to the `driver` at this moment, since it is not needed for out-of-market limit orders. Also note that I am missing the cap for absolute value of protocol fee (default value 1000$ or 0.5ETH) but this cap is still discussed (will be added later if needed). Skipping forwarding protocol fee parameters for in-market limit orders will be done in a separate PR. # Changes <!-- List of detailed changes (how the change is accomplished) --> - [ ] Defines basic parameters for protocol fee calculation. - [ ] Forwards protocol fee parameters to the driver.
Closed with #2098 |
Problem
For each auction, a driver needs to know if a protocol fee should be taken, for which orders, and which fee parameters to use.
Additionally, a new database table should be created where the protocol fee parameters should be stored for each auction. This is to have the option to retrieve the parameters in postprocessing for each settlement and calculate the required protocol fee and check if the driver behaved honestly.
Suggested solution
I suggest to have an enum that will define types of protocol fees. Each type would contain it's own specific fee parameters. Right now, we would have only one:
QuoteDeviationForLimitOrders
. In the future we might addFixedFeeForLimitOrders
,VolumeBasedFeeForAllOrders
,FixedFeeForTWAPOrders
etc.There are two assumptions to consider when defining how to forward the fee to the driver:
Enum type
QuoteDeviationForLimitOrders
will have parameters:Acceptance criteria
The text was updated successfully, but these errors were encountered: