function addLiquidity(
    address lp,
    address to,
    uint256 baseInAmount,
    uint256 quoteInAmount,
    uint256 minimumShares,
    uint256 deadline
) external ensureDeadline(deadline) returns (uint256 baseAdjustedInAmount, uint256 quoteAdjustedInAmount, uint256 shares) {
    (baseAdjustedInAmount, quoteAdjustedInAmount) = _adjustAddLiquidity(lp, baseInAmount, quoteInAmount);
    IMagicLP(lp)._BASE_TOKEN_().safeTransferFrom(msg.sender, lp, baseAdjustedInAmount);
    IMagicLP(lp)._QUOTE_TOKEN_().safeTransferFrom(msg.sender, lp, quoteAdjustedInAmount);
    shares = _addLiquidity(lp, to, minimumShares);
}
(uint256 baseReserve, uint256 quoteReserve) = IMagicLP(lp).getReserves();
uint256 baseBalance = IMagicLP(lp)._BASE_TOKEN_().balanceOf(address(lp)) + baseInAmount;
uint256 quoteBalance = IMagicLP(lp)._QUOTE_TOKEN_().balanceOf(address(lp)) + quoteInAmount;
baseInAmount = baseBalance - baseReserve;
quoteInAmount = quoteBalance - quoteReserve;
(uint256 baseReserve, uint256 quoteReserve) = IMagicLP(lp).getReserves();
uint256 baseBalance = IMagicLP(lp)._BASE_TOKEN_().balanceOf(address(lp)) + baseInAmount;
uint256 quoteBalance = IMagicLP(lp)._QUOTE_TOKEN_().balanceOf(address(lp)) + quoteInAmount;
function previewAddLiquidity(
    address lp,
    uint256 baseInAmount,
    uint256 quoteInAmount
) external view returns (uint256 baseAdjustedInAmount, uint256 quoteAdjustedInAmount, uint256 shares) {
    (uint256 baseReserve, uint256 quoteReserve) = IMagicLP(lp).getReserves();
    uint256 baseBalance = IMagicLP(lp)._BASE_TOKEN_().balanceOf(address(lp)) + baseInAmount;
    uint256 quoteBalance = IMagicLP(lp)._QUOTE_TOKEN_().balanceOf(address(lp)) + quoteInAmount;
    baseInAmount = baseBalance - baseReserve;
    quoteInAmount = quoteBalance - quoteReserve;
