{
    "Function": "closePosition",
    "File": "contracts/ClearingHouse.sol",
    "Parent Contracts": [
        "contracts/legos/HubbleBase.sol",
        "node_modules/@openzeppelin/contracts/metatx/ERC2771Context.sol",
        "node_modules/@openzeppelin/contracts/security/Pausable.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol",
        "contracts/legos/Governable.sol",
        "node_modules/@openzeppelin/contracts/proxy/utils/Initializable.sol",
        "contracts/legos/Governable.sol",
        "contracts/Interfaces.sol"
    ],
    "High-Level Calls": [
        "IAMM"
    ],
    "Internal Calls": [
        "_msgSender",
        "_openPosition",
        "whenNotPaused"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function closePosition(uint idx, uint quoteAssetLimit) override external whenNotPaused {\n        address trader = _msgSender();\n        (int256 size,,) = amms[idx].positions(trader);\n        _openPosition(trader, idx, -size, quoteAssetLimit);\n    }"
}