    function mintTokenizedPosition(
        TokenId tokenId,
        uint128 positionSize,
        int24 slippageTickLimitLow,
        int24 slippageTickLimitHigh
    )
        external
        ReentrancyLock(tokenId.poolId())
        returns (LeftRightUnsigned[4] memory collectedByLeg, LeftRightSigned totalSwapped)
    {
        // create the option position via its ID in this erc1155
        _mint(msg.sender, TokenId.unwrap(tokenId), positionSize);
        ...
        // validate the incoming option position, then forward to the AMM for minting/burning required liquidity chunks
        (collectedByLeg, totalSwapped) = _validateAndForwardToAMM(
            tokenId,
            positionSize,
            slippageTickLimitLow,
            slippageTickLimitHigh,
            MINT
        );
    }
    function _createLegInAMM(
        IUniswapV3Pool univ3pool,
        TokenId tokenId,
        uint256 leg,
        LiquidityChunk liquidityChunk,
        bool isBurn
    )
        internal
        returns (
            LeftRightSigned moved,
            LeftRightSigned itmAmounts,
            LeftRightUnsigned collectedSingleLeg
        )
    {
        ...
        uint128 updatedLiquidity;
        uint256 isLong = tokenId.isLong(leg);
        LeftRightUnsigned currentLiquidity = s_accountLiquidity[positionKey]; //cache
        {
            ...
            uint128 startingLiquidity = currentLiquidity.rightSlot();
            uint128 removedLiquidity = currentLiquidity.leftSlot();
            uint128 chunkLiquidity = liquidityChunk.liquidity();

            if (isLong == 0) {
                // selling/short: so move from msg.sender *to* uniswap
                // we're minting more liquidity in uniswap: so add the incoming liquidity chunk to the existing liquidity chunk
                updatedLiquidity = startingLiquidity + chunkLiquidity;

                /// @dev If the isLong flag is 0=short but the position was burnt, then this is closing a long position
                /// @dev so the amount of removed liquidity should decrease.
                if (isBurn) {
                    removedLiquidity -= chunkLiquidity;
                }
            } else {
                // the _leg is long (buying: moving *from* uniswap to msg.sender)
                // so we seek to move the incoming liquidity chunk *out* of uniswap - but was there sufficient liquidity sitting in uniswap
                // in the first place?
                if (startingLiquidity < chunkLiquidity) {
                    // the amount we want to move (liquidityChunk.legLiquidity()) out of uniswap is greater than
                    // what the account that owns the liquidity in uniswap has (startingLiquidity)
                    // we must ensure that an account can only move its own liquidity out of uniswap
                    // so we revert in this case
                    revert Errors.NotEnoughLiquidity();
                } else {
                    // startingLiquidity is >= chunkLiquidity, so no possible underflow
                    unchecked {
                        // we want to move less than what already sits in uniswap, no problem:
                        updatedLiquidity = startingLiquidity - chunkLiquidity;
                    }
                }

                /// @dev If the isLong flag is 1=long and the position is minted, then this is opening a long position
                /// @dev so the amount of removed liquidity should increase.
                if (!isBurn) {
                    // we can't remove more liquidity than we add in the first place, so this can't overflow
                    unchecked {
                        removedLiquidity += chunkLiquidity;
                    }
                }
            }

            // update the starting liquidity for this position for next time around
            s_accountLiquidity[positionKey] = LeftRightUnsigned
                .wrap(0)
                .toLeftSlot(removedLiquidity)
                .toRightSlot(updatedLiquidity);
        }

        ...
    }
  function test_removedLiquidityOverflow() public {
    _initPool(0);

    _cacheWorldState(USDC_WETH_30);

    sfpm.initializeAMMPool(token0, token1, fee);

    int24 width = 4090;
    int24 strike = 0;

    populatePositionData(width, strike, 0, 0);

    uint128 psnSize = type(uint128).max / 70;

    TokenId shortTokenId = TokenId.wrap(0).addPoolId(poolId).addLeg(
      0,
      1,
      isWETH,
      0,
      0,
      0,
      strike,
      width
    );

    TokenId longTokenId = TokenId.wrap(0).addPoolId(poolId).addLeg(
      0,
      1,
      isWETH,
      1,
      0,
      0,
      strike,
      width
    );

    // repeatedly mint contracts of the short and long positions
    for (uint256 i = 0; i < 32311; i++) {
      sfpm.mintTokenizedPosition(
        shortTokenId,
        psnSize,
        TickMath.MIN_TICK,
        TickMath.MAX_TICK
      );

      sfpm.mintTokenizedPosition(
        longTokenId,
        psnSize,
        TickMath.MIN_TICK,
        TickMath.MAX_TICK
      );
    }

    accountLiquidities = sfpm.getAccountLiquidity(
      address(USDC_WETH_30),
      Alice,
      0,
      tickLower,
      tickUpper
    );

    // at this moment, the removed liquidity does not overflow uint128 yet
    uint128 accountLiquidities_leftSlot_before_overflow = accountLiquidities.leftSlot();
    assertLt(accountLiquidities_leftSlot_before_overflow, type(uint128).max);

    // mint contracts of the short and long positions for one more time
    sfpm.mintTokenizedPosition(
      shortTokenId,
      psnSize,
      TickMath.MIN_TICK,
      TickMath.MAX_TICK
    );

    sfpm.mintTokenizedPosition(
      longTokenId,
      psnSize,
      TickMath.MIN_TICK,
      TickMath.MAX_TICK
    );

    accountLiquidities = sfpm.getAccountLiquidity(
      address(USDC_WETH_30),
      Alice,
      0,
      tickLower,
      tickUpper
    );

    // the removed liquidity has overflowed uint128 since it is now less than its previous value
    assertLt(accountLiquidities.leftSlot(), accountLiquidities_leftSlot_before_overflow);
  }
        if (!isBurn) {
          removedLiquidity += chunkLiquidity;
        }
