The Federal Reserve Act, as amended effective May 24, 2018, requires that aggregate Federal Reserve Bank surplus not exceed $6.825 billion. After providing for the costs of operations, payment of dividends, and the amount necessary to maintain a $6.825 billion surplus, any residual net earnings will be remitted to the U.S. Treasury.
https://www.federalreserve.gov/monetarypolicy/bst_fedsbalancesheet.htm