function calcSwapFeeAndOutput(uint x, uint X, uint Y) public pure returns (uint output, uint swapFee) {
    uint xAddX = x + X;
    uint rawOutput = FullMath.mulDiv(x, Y, xAddX);
    swapFee = FullMath.mulDiv(rawOutput, x, xAddX);
    output = rawOutput - swapFee;
}

function calcSwapValueInBaseWithPool(address pool, uint amount) public view returns (uint _output){
    uint _baseAmount = iPOOL(pool).baseAmount();
    uint _tokenAmount = iPOOL(pool).tokenAmount();
    (_output, ) = calcSwapFeeAndOutput(amount, _tokenAmount, _baseAmount);
}
