{
    "Function": "restructure",
    "File": "contracts/routers/LoopRouter.sol",
    "Parent Contracts": [
        "contracts/routers/StrategyRouter.sol",
        "contracts/helpers/StrategyTypes.sol",
        "contracts/interfaces/IStrategyRouter.sol"
    ],
    "High-Level Calls": [
        "IStrategy",
        "IOracle",
        "IStrategy"
    ],
    "Internal Calls": [
        "_batchSell",
        "onlyController",
        "abi.decode()",
        "_batchBuy"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function restructure(address strategy, bytes calldata data)\n        external\n        override\n        onlyController\n    {\n        (\n          uint256 currentTotal,\n          int256[] memory currentEstimates,\n          address[] memory currentItems\n        ) = abi.decode(data, (uint256, int256[], address[]));\n\n        _batchSell(strategy, currentTotal, currentEstimates, currentItems);\n        (uint256 newTotal, int256[] memory newEstimates) = IStrategy(strategy).oracle().estimateStrategy(IStrategy(strategy));\n        address[] memory newItems = IStrategy(strategy).items();\n        _batchBuy(strategy, strategy, newTotal, newEstimates, newItems);\n    }"
}