{
    "Function": "removeLiquidity",
    "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": [
        "IMarginAccount",
        "IAMM"
    ],
    "Internal Calls": [
        "_msgSender",
        "updatePositions",
        "whenNotPaused"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function removeLiquidity(uint idx, uint256 dToken, uint minQuoteValue, uint minBaseValue) override external whenNotPaused {\n        address maker = _msgSender();\n        updatePositions(maker);\n        (int256 realizedPnl,) = amms[idx].removeLiquidity(maker, dToken, minQuoteValue, minBaseValue);\n        marginAccount.realizePnL(maker, realizedPnl);\n    }"
}