bnb-party / BNBParty.Factory

Smart contract manages Liquidity Pools and Token creation, enabling decentralized swaps and liquidity handling
MIT License
1 stars 0 forks source link

calculate `WBNBBalance` without `LPfee` #38

Closed YouStillAlive closed 1 month ago

YouStillAlive commented 1 month ago

https://github.com/bnb-party/BNBParty.Factory/blob/8620d02a27236d517db50a662848fbae7bc49b61/contracts/BNBPartyFactory.sol#L46-L47

YouStillAlive commented 1 month ago

https://uniswapv3book.com/milestone_5/swap-fees.html

YouStillAlive commented 1 month ago
// calculate accumulated fees
  uint128 tokensOwed0 =
     uint128(
        FullMath.mulDiv(
           feeGrowthInside0X128 - _self.feeGrowthInside0LastX128,
           _self.liquidity,
           FixedPoint128.Q128
        )
     );