Skip to content
Discussion options

You must be logged in to vote

I got my question answered after going through the formal verification paper here

x * y = k is not true throughout the lifetime of the contract. Otherwise, you could never add extra money (for either token - x or y) without removing some from the other (how else would you have a product of two non-negative numbers be constant, right?). Therefore when it comes to adding liquidity, the value of x * y is expected to strictly increase.

The invariant in this situation is the ratio e:t:l (e -> ether, t -> exchange token, l -> total liquidity amount). Say you want to provide Δe to liquidity pool, in order to preserve the e:t:l ratio they also expect you to provide alpha * t to t and, in turn you…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@TilakMaddy
Comment options

Answer selected by PatrickAlphaC
@shobhit-gupta
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants