```\nFile: BondBaseSDA.sol\n    function payoutFor(\n        uint256 amount_,\n        uint256 id_,\n        address referrer_\n    ) public view override returns (uint256) {\n        // Calculate the payout for the given amount of tokens\n        uint256 fee = amount_.mulDiv(_teller.getFee(referrer_), 1e5);\n        uint256 payout = (amount_ - fee).mulDiv(markets[id_].scale, marketPrice(id_));\n\n        // Check that the payout is less than or equal to the maximum payout,\n        // Revert if not, otherwise return the payout\n        if (payout > markets[id_].maxPayout) {\n            revert Auctioneer_MaxPayoutExceeded();\n        } else {\n            return payout;\n        }\n    }\n```\n