{
    "Function": "getQuote",
    "File": "contracts/HubbleViewer.sol",
    "Parent Contracts": [
        "contracts/Interfaces.sol"
    ],
    "High-Level Calls": [
        "SafeCast",
        "SafeCast",
        "IVAMM",
        "IAMM",
        "IVAMM",
        "IClearingHouse"
    ],
    "Internal Calls": [],
    "Library Calls": [
        "toUint256",
        "toUint256"
    ],
    "Low-Level Calls": [],
    "Code": "function getQuote(int256 baseAssetQuantity, uint idx) public view returns(uint256 quoteAssetQuantity) {\n        IAMM amm = clearingHouse.amms(idx);\n        IVAMM vamm = amm.vamm();\n\n        if (baseAssetQuantity >= 0) {\n            return vamm.get_dx(0, 1, baseAssetQuantity.toUint256()) + 1;\n        }\n        // rounding-down while shorting is not a problem\n        // because lower the min_dy, more permissible it is\n        return vamm.get_dy(1, 0, (-baseAssetQuantity).toUint256());\n    }"
}