-
Notifications
You must be signed in to change notification settings - Fork 91
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: Rank by Surplus Tracker #2382
Comments
Currently the autopilot just accepts the score from the driver as true. Do we want to change this and have the autopilot compute surplus and fees? |
I would prefer so. If autopilot can calculate the surplus (or any other value we use for ranking) from the solution itself, then there is no need for additional field as part of the /solve response. |
This is somewhat aligned with the idea explained here: #2225 |
Well, instead (at least as outlined in #2225) there is need for the entire encoded settlement (which is much more than the score). I think if the value can be computed by what we already send then sure let the autopilot verify it, but if not, I think it's fine to trust the driver with this (at the end of the day the driver could also "lie" about their encoded settlement) |
Replacement for #2406 and #2421 Implements task 1 from #2382 Fixes #1494 # Description Implements surplus and protocol fees calculation, **based on the solution (received from solvers) trades, which are in a settlement smart contract format**. This ensures that these values are calculated after the protocol fee is already applied and the whole settlement is prepared for settling. This is important because the autopilot (and reward script) will use the same math so we are aligned 1:1. The main calculation is in `crates/driver/src/domain/competition/settled/mod.rs`. CIP38 scoring is currently called in a read only mode. The score is calculated but not used. ## How to test Tested locally with e2e tests. Surplus + protocol fee is always equal to legacy `quality` - `surplus_fee` which is expected.
All tasks covered with individual issues so closing this one. |
Problem
Issue tracker for rank by surplus implementation.
Solutions ranking needs to be changed from
rank by score
torank by surplus
.Here is how surplus is defined in the
driver
:surplus
- raw surplus that is defined by original clearing prices provided by solverssurplus' = surplus - surplus_fee
surplus'' = surplus' - protocol_fee
So, we want to rank by
surplus'
.Tasks:
Nice to have:
score
wherever used (from solvers interface for example). Keep it in the driver interface since it will be reused to report surplus to autopilot since autopilot won't calculate this but it will trust the driver - chore: Cleanup driver score function #2493The text was updated successfully, but these errors were encountered: