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

Potential bug with auctions being settled late #380

Open
fhenneke opened this issue Aug 14, 2024 · 0 comments
Open

Potential bug with auctions being settled late #380

fhenneke opened this issue Aug 14, 2024 · 0 comments

Comments

@fhenneke
Copy link
Collaborator

fhenneke commented Aug 14, 2024

There might be a bug with slippage/fee reimbursements.

When auctions are settled late by a solver, they do not receive a reward but instead are penalized as if the settlement had not happened. This is intended behavior. Looking at Dune records shows that there might be an issue/unintended handling of fees in such cases:
image
The (network) fee seems to be negative in such cases. This might have an impact on total payments to solvers.

fhenneke added a commit that referenced this issue Aug 15, 2024
This PR adds a grace period of one block to the deadline for settling on
chain. It also removes the use of block deadlines in computing fees and
other quantities.

The PR changes two things:
- Settlements are still rewarded if solvers settle one block after the
deadline. This change is implemented to not punish solvers for slightly
suboptimal transaction canceling in the driver. The alternative would be
to implement very cautios canceling which might negatively impact revert
rates.
- The use of block deadlines for setting `surplus`, `fee`, and
`execution_cost` to zero was removed. For every successful settlemen,
even if after the deadline by many blocks, those values will just be
copies of the respective values in the `settlement_observations` table.
The change to `surplus`and `execution_cost`does not have any effect on
solver payments. Those values are only used for analytics. The change to
`fee` has an effect since it enters the computation of
`network_fee_eth`. Before the change, the network fee was computed to be
negative and essentially equal to `-protocol_fee_eth`. On the one hand,
network fees were already removed from slippage using per order data. On
the other hand, slippage is also modified by adding the value of network
fees to reimburse solvers the cost of execution. Since network fees were
computed to be negative protocol fees, instead of paying solvers those
network fees they paid us protocol fees. See #380. With the proposed
change, network fees are always paid as part of slippage to the solver.
This is consistent with how slippage is handled in general.

The estimated impact on solver from adding a grace period is an increase
in overall rewards by about 1.48 ETH in the accounting period
2024-08-06--2024-08-13.
The impact of the second change on slippage is not estimated precisely.
The overcharging of protocol fees amounts to 0.6 ETH. The missing
reimbursement of network fees is not estimated.
See [this Dune query](https://dune.com/queries/3987946).

The changes should be mirrored to dune-sync and data for the accounting
period starting on 2024-08-13 should be re-synced.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant