Skip to content

Commit

Permalink
Fix initial price in above pool for twap
Browse files Browse the repository at this point in the history
  • Loading branch information
MilGard91 committed Nov 13, 2023
1 parent caf9559 commit 190a921
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/modules/capital/Ramm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ contract Ramm is IRamm, MasterAwareV2, ReentrancyGuard {
uint supply = tokenController().totalSupply();

uint bondingCurvePrice = pool().getTokenPrice();
uint initialPriceA = bondingCurvePrice + 1 ether * capital * (PRICE_BUFFER_DENOMINATOR + PRICE_BUFFER) / PRICE_BUFFER_DENOMINATOR / supply;
uint initialPriceA = bondingCurvePrice + 1 ether * capital * PRICE_BUFFER / PRICE_BUFFER_DENOMINATOR / supply;
uint initialPriceB = 1 ether * capital * (PRICE_BUFFER_DENOMINATOR - PRICE_BUFFER) / PRICE_BUFFER_DENOMINATOR / supply;

uint128 nxmReserveA = (INITIAL_LIQUIDITY * 1 ether / initialPriceA).toUint128();
Expand Down

0 comments on commit 190a921

Please sign in to comment.