{
    "Function": "updatePositions",
    "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",
        "IMarginAccount"
    ],
    "Internal Calls": [
        "whenNotPaused",
        "require(bool,string)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function updatePositions(address trader) override public whenNotPaused {\n        require(address(trader) != address(0), 'CH: 0x0 trader Address');\n        int256 fundingPayment;\n        for (uint i = 0; i < amms.length; i++) {\n            fundingPayment += amms[i].updatePosition(trader);\n        }\n        // -ve fundingPayment means trader should receive funds\n        marginAccount.realizePnL(trader, -fundingPayment);\n    }"
}