{
    "Function": "_short",
    "File": "contracts/AMM.sol",
    "Parent Contracts": [
        "contracts/legos/Governable.sol",
        "node_modules/@openzeppelin/contracts/proxy/utils/Initializable.sol",
        "contracts/legos/Governable.sol",
        "contracts/Interfaces.sol"
    ],
    "High-Level Calls": [
        "IVAMM",
        "SafeCast",
        "SafeCast",
        "IVAMM"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "openInterestNotional",
        "_addReserveSnapshot"
    ],
    "Library Calls": [
        "toUint256",
        "toInt256"
    ],
    "Low-Level Calls": [],
    "Code": "function _short(int256 baseAssetQuantity, uint min_dy) internal returns (uint256 quoteAssetQuantity) {\n        require(baseAssetQuantity < 0, \"VAMM._short: baseAssetQuantity is >= 0\");\n\n        uint _lastPrice;\n        (quoteAssetQuantity, _lastPrice) = vamm.exchange(\n            1, // sell base asset\n            0, // get quote asset\n            (-baseAssetQuantity).toUint256(), // short exactly. Note that statement asserts that baseAssetQuantity <= 0\n            min_dy\n        );\n\n        _addReserveSnapshot(_lastPrice);\n        // since maker position will be opposite of the trade\n        posAccumulator -= baseAssetQuantity * 1e18 / vamm.totalSupply().toInt256();\n        emit Swap(baseAssetQuantity, quoteAssetQuantity, _lastPrice, openInterestNotional());\n    }"
}