```\n    function getReservedUsd(\n        DataStore dataStore,\n        Market.Props memory market,\n        MarketPrices memory prices,\n        bool isLong\n    ) internal view returns (uint256) {\n        uint256 reservedUsd;\n        if (isLong) {\n            // for longs calculate the reserved USD based on the open interest and current indexTokenPrice\n            // this works well for e.g. an ETH / USD market with long collateral token as WETH\n            // the available amount to be reserved would scale with the price of ETH\n            // this also works for e.g. a SOL / USD market with long collateral token as WETH\n            // if the price of SOL increases more than the price of ETH, additional amounts would be\n            // automatically reserved\n            uint256 openInterestInTokens = getOpenInterestInTokens(dataStore, market, isLong);\n            reservedUsd = openInterestInTokens * prices.indexTokenPrice.max;\n        } else {\n            // for shorts use the open interest as the reserved USD value\n            // this works well for e.g. an ETH / USD market with short collateral token as USDC\n            // the available amount to be reserved would not change with the price of ETH\n            reservedUsd = getOpenInterest(dataStore, market, isLong);\n        }\n\n        return reservedUsd;\n    }\n```\n