; (2) in paragraph (4), by inserting under paragraph (7) after funds disgorged ; and (3) by adding at the end the following: (7) Disgorgement (A) In general In any action or proceeding brought by the Commission under any provision of the securities laws, the Commission may seek, and any Federal court may order, dis­gorge­ment of any unjust enrichment that a person obtained as a result of a violation of that provision. (B) Calculation Any disgorgement that is ordered with respect to a person under subparagraph (A) shall be offset by any amount of restitution that the person is ordered to pay under paragraph (8). (8) Restitution In any proceeding brought or instituted by the Commission under any provision of the securities laws, the Commission may seek, and any Federal court, or, with respect to a proceeding instituted by the Commission, the Commission, may order restitution to an investor in the amount of the loss that the investor sustained as a result of a violation of that provision by a person that is— (A) registered as, or required to be registered as, a broker, dealer, investment adviser, municipal securities dealer, municipal advisor, or transfer agent