{
    "Function": "getBase",
    "File": "contracts/HubbleViewer.sol",
    "Parent Contracts": [
        "contracts/Interfaces.sol"
    ],
    "High-Level Calls": [
        "IClearingHouse",
        "IVAMM",
        "SafeCast",
        "SafeCast",
        "IVAMM",
        "IAMM"
    ],
    "Internal Calls": [],
    "Library Calls": [
        "toInt256",
        "toInt256"
    ],
    "Low-Level Calls": [],
    "Code": "function getBase(uint256 quoteAssetQuantity, uint idx, bool isLong) external view returns(int256 /* baseAssetQuantity */) {\n        IAMM amm = clearingHouse.amms(idx);\n        IVAMM vamm = amm.vamm();\n\n        uint256 baseAssetQuantity;\n        if (isLong) {\n            baseAssetQuantity = vamm.get_dy(0, 1, quoteAssetQuantity);\n            return baseAssetQuantity.toInt256();\n        }\n        baseAssetQuantity = vamm.get_dx(1, 0, quoteAssetQuantity);\n        return -(baseAssetQuantity.toInt256());\n    }"
}