-
Notifications
You must be signed in to change notification settings - Fork 41
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
Implement AMM 2.0-light #1092
Merged
Merged
Implement AMM 2.0-light #1092
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maltekliemann
added
the
s:in-progress
The pull requests is currently being worked on
label
Sep 4, 2023
maltekliemann
added
s:review-needed
The pull request requires reviews
and removed
s:in-progress
The pull requests is currently being worked on
labels
Sep 4, 2023
maltekliemann
added
s:in-progress
The pull requests is currently being worked on
and removed
s:review-needed
The pull request requires reviews
labels
Sep 5, 2023
maltekliemann
added
s:review-needed
The pull request requires reviews
and removed
s:in-progress
The pull requests is currently being worked on
labels
Sep 5, 2023
maltekliemann
added
s:review-needed
The pull request requires reviews
and removed
s:review-needed
The pull request requires reviews
labels
Sep 5, 2023
maltekliemann
added
s:review-needed
The pull request requires reviews
and removed
s:review-needed
The pull request requires reviews
labels
Sep 29, 2023
Chralt98
reviewed
Oct 2, 2023
This pull request is now in conflicts. Could you fix it @maltekliemann? 🙏 |
mergify
bot
added
s:revision-needed
The pull requests must be revised
and removed
s:review-needed
The pull request requires reviews
labels
Oct 4, 2023
maltekliemann
added
s:review-needed
The pull request requires reviews
and removed
s:revision-needed
The pull requests must be revised
labels
Oct 4, 2023
Chralt98
reviewed
Oct 4, 2023
Chralt98
reviewed
Oct 4, 2023
Chralt98
previously approved these changes
Oct 4, 2023
sea212
reviewed
Oct 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, however I would separate the weight updates into another PR as they bloat the merge commit with unrelated changes.
This pull request is now in conflicts. Could you fix it @maltekliemann? 🙏 |
mergify
bot
added
s:revision-needed
The pull requests must be revised
and removed
s:review-needed
The pull request requires reviews
labels
Oct 11, 2023
maltekliemann
added
s:review-needed
The pull request requires reviews
and removed
s:revision-needed
The pull requests must be revised
labels
Oct 11, 2023
sea212
approved these changes
Oct 11, 2023
sea212
added
s:accepted
This pull request is ready for merge
and removed
s:review-needed
The pull request requires reviews
labels
Oct 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does it do?
Implements AMM 2.0-light according to internal design documents.
What important points should reviewers know?
do_*
function, which should contain absolutely no signing or weight logic. Sometimes this results in a double DB reads. A solution is proposed here: Research performance cost of duplicate reads and implement a solution if necessary #1081exit
requires a market to exist. Thus, destroying the underlying market makes the pool defunct. I see no need to make any changes to market destruction.extra_weight
stuff because it's Rikiddo-only.Pool
struct to avoid griefing attacks: Sending funds to the pool can be used to change balances and thus prices. Doesn't seem to be profitable, but certainly very annoying.< ED
is sent to an empty pool account and the entire transaction errors out. This doesn't affect non-native collateral because we're just whitelisting these accounts from dust collection. Native currency doesn't seem to support whitelisting, although I'm getting mixed signals (or I'm just dumb): Add a dust removal whitelist topallet-balances
paritytech/polkadot-sdk#227, https://substrate.stackexchange.com/questions/9824/reaping-vs-dusting-and-how-to-whitelist-an-account.Is there something left for follow-up PRs?
Follow-up PRs will do the following:
math.rs
.zrml-prediction-markets
benchmarks and definezrml-neo-swaps
benchmarksWhat alternative implementations were considered?
None.
Are there relevant PRs or issues?
Strangely enough, this PR doesn't close any issues. Please refer to the design document for more details.
References
Things I've Learned
Config
. Don't be a hero and try to make the struct independent ofConfig
. Otherwise, type inferrence and error handling is an utter mess.Pool
.