{
    "Function": "convert1to0",
    "File": "contracts/libraries/PanopticMath.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "Math",
        "Math",
        "Math",
        "LeftRight",
        "LeftRight",
        "Math",
        "Math"
    ],
    "Internal Calls": [],
    "Library Calls": [
        "toInt256",
        "absUint",
        "mulDiv64",
        "mulDiv",
        "absUint",
        "mulDiv",
        "toInt256"
    ],
    "Low-Level Calls": [],
    "Code": "function convert1to0(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                    .mulDiv(Math.absUint(amount), 2 ** 192, uint256(sqrtPriceX96) ** 2)\n                    .toInt256();\n                return amount < 0 ? -absResult : absResult;\n            } else {\n                int256 absResult = Math\n                    .mulDiv(\n                        Math.absUint(amount),\n                        2 ** 128,\n                        Math.mulDiv64(sqrtPriceX96, sqrtPriceX96)\n                    )\n                    .toInt256();\n                return amount < 0 ? -absResult : absResult;\n            }\n        }\n    }"
}