Skip to content

Scores inconsistent with autopilot #7

@fhenneke

Description

@fhenneke

There was a deny-listing of a solver using the reference driver for this settlement. The reason was that the circuit breaker computed a lower score than what the reference driver computed.

The settlement was executed by the reference driver which uses the same logic for computing scores as the autopilot. So there is an inconsistency between the circuit breaker and the autopilot.

A preliminary investigation points towards this being an issue with rounding and large scores (due to a native price being off). The trade in the settlement was charge a price improvement fee which was capped at 1% of volume.
The circuit breaker computed a protocol fee of 111.050383061657478768 while the autopilot computed 111.050383061657487315 (api) for an overestimation of 8547 atoms. Conversion to ETH using the native price of 240544305000403029226160128 / 10**18 gives an overestimation of 2055932174838 wei.
This is consistent with logs of the deny-listing:

Score in competition: 136031354747218084331662325448	Computed score: 136031354747218082275730150610	Difference 2055932174838

Any issues with rounding resulting in an overestimation of protocol fees or surplus can result in overestimation of scores. Most rounding in the driver should be conservative and err to computing a smaller score. There seem to be some places, where this is not the case.

Currently, the circuit breaker uses a formula of the form

round(trade.buy_amount * 1 / (1 - Fraction(0.01)))

to compute the buy amount before charging a volume fee. The computation in the autopilot should be checked and both computations should be aligned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions