```\nfunction getBNBPrice() public view returns (uint256) {\n    IPancakePair pair = IPancakePair(stablePairAddress);\n    IERC20 token1 = pair.token0() == stableAddress\n        ? IERC20(pair.token1())\n        : IERC20(pair.token0());\n\n    (uint256 Res0, uint256 Res1, ) = pair.getReserves();\n\n    if (pair.token0() != stableAddress) {\n        (Res1, Res0, ) = pair.getReserves();\n    }\n    uint256 res0 = Res0 * 10**token1.decimals();\n    return (res0 / Res1); // return amount of token0 needed to buy token1\n}\n```\n