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

Update winners picking logic #3073

Merged
merged 4 commits into from
Oct 21, 2024
Merged

Update winners picking logic #3073

merged 4 commits into from
Oct 21, 2024

Conversation

sunce86
Copy link
Contributor

@sunce86 sunce86 commented Oct 18, 2024

Description

In a discussion with the solver team, several different algorithms were proposed to pick winners.
https://www.notion.so/cownation/Rewards-for-multiple-winners-1218da5f04ca80f2a59ed8f0174b3a69?pvs=4#1228da5f04ca8050ac31e965b120709d

We choose winners iteratively:

  1. Choose solutions with largest score from remaining solutions as next winner.
  2. Choose largest score of solutions with overlap to winner as reference score. The reward is winning score - reference score, the penalty is reference score.
  3. Remove all remaining solutions which have token pairs in common with the winner. Whenever a solution is filtered in this procedure, additionally use all token pairs of that filtered solution for filtering remaining solutions.
  4. Repeat.

Currently, the best option is "second price with aggressive filtering". This PR implements this logic.

Changes

  • Instead of adding only winner's swapped tokens to already swapped tokens list, add every solution's swapped tokens, regardless if they are a winner or not.

@sunce86 sunce86 self-assigned this Oct 18, 2024
@sunce86 sunce86 requested a review from a team as a code owner October 18, 2024 12:18
Copy link
Contributor

@squadgazzz squadgazzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lg. IMO, posting links to private resources instead of quoting seems some kind of unfair from the open source project perspective.

@sunce86
Copy link
Contributor Author

sunce86 commented Oct 18, 2024

Lg. IMO, posting links to private resources instead of quoting seems some kind of unfair from the open source project perspective.

That's true (I remember we already talked about that). I've edited the description and added the important part. But the reason why I added the link is because there are a lot of examples there which are important to understand the new logic.

crates/autopilot/src/run_loop.rs Outdated Show resolved Hide resolved
@sunce86 sunce86 enabled auto-merge (squash) October 21, 2024 14:24
@sunce86 sunce86 merged commit fd743de into main Oct 21, 2024
11 checks passed
@sunce86 sunce86 deleted the update-winners-picking-logic branch October 21, 2024 14:42
@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants