{
    "Function": "convert0to1",
    "File": "contracts/libraries/PanopticMath.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "Math",
        "Math",
        "LeftRight",
        "Math",
        "LeftRight",
        "Math",
        "Math"
    ],
    "Internal Calls": [],
    "Library Calls": [
        "toInt256",
        "absUint",
        "mulDiv64",
        "mulDiv128",
        "toInt256",
        "absUint",
        "mulDiv192"
    ],
    "Low-Level Calls": [],
    "Code": "function convert0to1(int256 amount, uint160 sqrtPriceX96) internal pure returns (int256) {\n        unchecked {\n            // the tick 443636 is the maximum price where (price) * 2**192 fits into a uint256 (< 2**256-1)\n            // above that tick, we are forced to reduce the amount of decimals in the final price by 2**64 to 2**128\n            if (sqrtPriceX96 < 340275971719517849884101479065584693834) {\n                int256 absResult = Math\n                    .mulDiv192(Math.absUint(amount), uint256(sqrtPriceX96) ** 2)\n                    .toInt256();\n                return amount < 0 ? -absResult : absResult;\n            } else {\n                int256 absResult = Math\n                    .mulDiv128(Math.absUint(amount), Math.mulDiv64(sqrtPriceX96, sqrtPriceX96))\n                    .toInt256();\n                return amount < 0 ? -absResult : absResult;\n            }\n        }\n    }"
}