Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfuturistic committed Aug 31, 2024
1 parent 2f6b162 commit 7710262
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/UniswapV2Pair.sol
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ contract UniswapV2Pair is UniswapV2ERC20 {
// compute the current price with 1e6 decimals (1e18 can easily overflow)
uint112 price = (_reserve1 * 1e6) / _reserve0;

// NOTE: if we used reserve1 values instead prices, as in the paper, minting LP
// positions could make the algorithm unreliable. the price, however, incorporates
// information about reserve2 in the calculation (since price = reserve1 / reserve2).

// check if the sequencing rule info has been initialized for this block
if (sequencingRuleInfo.priceStart == 0) {
// if not, initialize it with the current price as the start price
Expand Down

0 comments on commit 7710262

Please sign in to comment.