{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/market/OverlayV1PricePoint.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "abstract contract OverlayV1PricePoint {\n\n    using FixedPoint for uint256;\n\n    uint256 private constant E = 0x25B946EBC0B36351;\n    uint256 private constant INVERSE_E = 0x51AF86713316A9A;\n\n    struct PricePoint {\n        int24 macroTick;\n        int24 microTick;\n        uint256 depth;\n    }\n\n    uint256 public pbnj;\n\n    uint256 public updated;\n\n    uint256 immutable public priceFrameCap;\n\n    // mapping from price point index to realized historical prices\n    PricePoint[] internal _pricePoints;\n\n    event NewPricePoint(uint bid, uint ask, uint depth);\n\n    constructor(\n        uint256 _priceFrameCap\n    ) {\n\n        require(1e18 <= _priceFrameCap, \"OVLV1:!priceFrame\");\n\n        priceFrameCap = _priceFrameCap;\n\n        updated = block.timestamp;\n\n\n    }\n\n    function fetchPricePoint () public view virtual returns (PricePoint memory);\n\n    function _tickToPrice (int24 _tick) public virtual view returns (uint quote_);\n\n\n    /// @notice Get the index of the next price to be realized\n    /// @dev Returns the index of the _next_ price\n    /// @return nextIndex_ The length of the price point array\n    function pricePointNextIndex() public view returns (\n        uint nextIndex_\n    ) {\n\n        nextIndex_ = _pricePoints.length;\n\n    }\n\n\n    /// @notice All past price points.\n    /// @dev Returns the price point if it exists.\n    /// @param _pricePointIndex Index of the price point being queried.\n    /// @return bid_ Bid.\n    /// @return ask_ Ask.\n    /// @return depth_ Market liquidity in OVL terms.\n    function pricePoints(\n        uint256 _pricePointIndex\n    ) external view returns (\n        uint256 bid_,\n        uint256 ask_,\n        uint256 depth_\n    ) {\n\n        uint _len = _pricePoints.length;\n\n        require(_pricePointIndex <  _len ||\n               (_pricePointIndex == _len && updated != block.timestamp),\n               \"OVLV1:!price\");\n\n        if (_pricePointIndex == _len) {\n\n            ( bid_, ask_, depth_ ) = readPricePoint(fetchPricePoint());\n\n        } else {\n\n            ( bid_, ask_, depth_ ) = readPricePoint(_pricePointIndex);\n\n        }\n\n    }\n\n\n    /// @notice Current price point.\n    /// @dev Returns the price point if it exists.\n    /// @return bid_ Bid.\n    /// @return ask_ Ask.\n    /// @return depth_ Market liquidity in OVL terms.\n    function pricePointCurrent () public view returns (\n        uint bid_,\n        uint ask_,\n        uint depth_\n    ){\n\n        uint _now = block.timestamp;\n        uint _updated = updated;\n\n        if (_now != _updated) {\n\n            ( bid_, ask_, depth_ ) = readPricePoint(fetchPricePoint());\n\n        } else {\n\n            ( bid_, ask_, depth_ ) = readPricePoint(_pricePoints.length - 1);\n\n        }\n\n    }\n\n    /// @notice Allows inheriting contracts to add the latest realized price\n    function setPricePointNext(\n        PricePoint memory _pricePoint\n    ) internal {\n\n        _pricePoints.push(_pricePoint);\n\n        (   uint _bid, \n            uint _ask,  \n            uint _depth ) = readPricePoint(_pricePoint);\n\n        emit NewPricePoint(\n            _bid, \n            _ask, \n            _depth\n        );\n\n    }\n\n    function readPricePoint (\n        uint _pricePoint\n    ) public view returns (\n        uint256 bid_,\n        uint256 ask_,\n        uint256 depth_\n    ) {\n\n        return readPricePoint(_pricePoints[_pricePoint]);\n\n    }\n\n    function readPricePoint(\n        PricePoint memory _pricePoint\n    ) public view returns (\n        uint256 bid_,\n        uint256 ask_,\n        uint256 depth_\n    ) {\n\n        uint _microPrice = _tickToPrice(_pricePoint.microTick);\n\n        uint _macroPrice = _tickToPrice(_pricePoint.macroTick);\n\n        uint _spread = pbnj;\n\n        ask_ = Math.max(_macroPrice, _microPrice).mulUp(E.powUp(_spread));\n\n        bid_ = Math.min(_macroPrice, _microPrice).mulDown(INVERSE_E.powUp(_spread));\n\n        depth_ = _pricePoint.depth;\n\n\n    }\n\n\n}"
}