```\nfunction getPrice(address pair) external view returns (uint) {\n    (uint r0, uint r1,) = IUniswapV2Pair(pair).getReserves();\n\n    // 2 * sqrt(r0 * r1 * p0 * p1) / totalSupply\n    return FixedPointMathLib.sqrt(\n        r0\n        .mulWadDown(r1)\n        .mulWadDown(oracle.getPrice(IUniswapV2Pair(pair).token0()))\n        .mulWadDown(oracle.getPrice(IUniswapV2Pair(pair).token1()))\n    )\n    .mulDivDown(2e27, IUniswapV2Pair(pair).totalSupply());\n}\n```\n