{
    "Function": "getAccountInfo",
    "File": "contracts/HubbleViewer.sol",
    "Parent Contracts": [
        "contracts/Interfaces.sol"
    ],
    "High-Level Calls": [
        "IClearingHouse",
        "IMarginAccount",
        "SafeCast",
        "IClearingHouse",
        "IClearingHouse",
        "IClearingHouse"
    ],
    "Internal Calls": [],
    "Library Calls": [
        "toInt256"
    ],
    "Low-Level Calls": [],
    "Code": "function getAccountInfo(address trader) external view returns (\n        int totalCollateral,\n        int256 freeMargin,\n        int256 marginFraction,\n        uint notionalPosition,\n        int256 unrealizedPnl\n    ) {\n        int256 margin;\n        (margin, totalCollateral) = marginAccount.weightedAndSpotCollateral(trader);\n        marginFraction = clearingHouse.getMarginFraction(trader);\n        (notionalPosition, unrealizedPnl) = clearingHouse.getTotalNotionalPositionAndUnrealizedPnl(trader);\n        int256 minAllowableMargin = clearingHouse.minAllowableMargin();\n        freeMargin = margin + unrealizedPnl - clearingHouse.getTotalFunding(trader) - notionalPosition.toInt256() * minAllowableMargin / PRECISION_INT;\n    }"
}