Quarterly report pursuant to Section 13 or 15(d)

CONDENSED CONSOLIDATED STATEMENTS OF CASH FLOWS

v3.10.0.1
CONDENSED CONSOLIDATED STATEMENTS OF CASH FLOWS - USD ($)
$ in Thousands
6 Months Ended 12 Months Ended
Jun. 30, 2018
Jun. 30, 2017
Dec. 31, 2017
Dec. 31, 2016
Cash Flows From Operating Activities:        
Net income from continuing operations $ 474,299 $ 52,992    
Adjustments to reconcile net income from continuing operations to net cash provided by operating activities:        
Amortization of premiums and discounts on investment securities, net 44,891 23,293    
Amortization of deferred debt issuance costs on convertible senior notes 441 176    
Other-than-temporary impairment losses 268 429    
Realized and unrealized losses on investment securities 53,846 21,103    
(Gain) loss on servicing asset (81,660) 61,195    
Gain on residential mortgage loans held-for-sale (556) (1,794)    
Gain on residential mortgage loans held-for-investment and collateralized borrowings in securitization trusts 0 (8,077)    
Realized and unrealized (gain) loss on interest rate swaps and swaptions (162,029) 56,305    
Unrealized loss on other derivative instruments 22,040 35,111    
Equity based compensation 6,398 8,214    
Depreciation of fixed assets 348 550    
Purchases of residential mortgage loans held-for-sale 0 (567)    
Proceeds from sales of residential mortgage loans held-for-sale 0 3,708    
Proceeds from repayment of residential mortgage loans held-for-sale 1,754 4,532    
Net change in assets and liabilities:        
Decrease (increase) in accrued interest receivable 7,201 (10,217)    
Increase in deferred income taxes, net (1,954) (16,078)    
(Increase) decrease in income taxes receivable (316) 80    
Increase in prepaid and fixed assets (143) (253)    
(Increase) decrease in other receivables (2,267) 4,637    
Decrease in servicing advances 2,332 5,031    
(Decrease) increase in accrued interest payable (3,402) 25,797    
Increase in income taxes payable 0 51    
Decrease in accrued expenses and other liabilities (2,053) (6,695)    
Net cash provided by operating activities of discontinued operations 0 16,838    
Net cash provided by operating activities 359,438 276,361    
Cash Flows From Investing Activities:        
Purchases of available-for-sale securities (3,221,949) (8,883,595)    
Proceeds from sales of available-for-sale securities 3,719,959 5,092,318    
Principal payments on available-for-sale securities 949,116 627,277    
Purchases of mortgage servicing rights, net of purchase price adjustments (282,283) (266,003)    
Proceeds from sales of mortgage servicing rights 399 627    
(Purchases) short sales of derivative instruments, net (78,944) (33,562)    
Proceeds from sales and settlement (payments for termination and settlement) of derivative instruments, net 278,460 15,905    
Proceeds from repayment of residential mortgage loans held-for-investment in securitization trusts 0 181,806    
Redemptions of Federal Home Loan Bank stock 12,981 33,080    
Increase (decrease) in due to counterparties, net 743,977 (54,152)    
Net cash used in investing activities of discontinued operations 0 (366,204)    
Net cash provided by (used in) investing activities 2,121,716 (3,652,503)    
Cash Flows From Financing Activities:        
Proceeds from repurchase agreements 64,622,311 78,592,898    
Principal payments on repurchase agreements (66,867,695) (74,781,325)    
Principal payments on collateralized borrowings in securitization trusts 0 (179,717)    
Principal payments on Federal Home Loan Bank advances (350,000) (761,238)    
Proceeds from revolving credit facilities 170,000 74,000    
Principal payments on revolving credit facilities (20,000) (104,000)    
Proceeds from convertible senior notes 0 282,469    
Proceeds from issuance of preferred stock, net of offering costs 13 138,872    
Proceeds from issuance of common stock, net of offering costs 195 256    
Dividends paid on preferred stock (25,696) 0    
Dividends paid on common stock (83,057) (170,665)    
Net cash provided by financing activities of discontinued operations 0 370,832    
Net cash (used in) provided by financing activities (2,553,929) 3,462,382    
Net (decrease) increase in cash, cash equivalents and restricted cash (72,775) 86,240    
Cash, cash equivalents and restricted cash of continuing operations at beginning of period 1,054,995 758,916 $ 758,916  
Cash, cash equivalents and restricted cash of discontinued operations at beginning of period     0 $ 56,279
Cash, cash equivalents and restricted cash at beginning of period 1,054,995 815,195 815,195  
Cash, cash equivalents and restricted cash at end of period 982,220 901,435 1,054,995  
Supplemental Disclosure of Cash Flow Information:        
Cash paid for interest 208,377 89,296    
Cash paid for taxes 3 192    
Noncash Activities:        
Transfers of residential mortgage loans held-for-sale to other receivables for foreclosed government-guaranteed loans (403) (2,292)    
Transfer of fair value of mortgage servicing rights to fair value of Ginnie Mae residential mortgage loans held-for-sale upon buyout 0 (9)    
Additions to mortgage servicing rights due to sale of residential mortgage loans held-for-sale 0 20    
Cumulative-effect adjustment for adoption of new accounting principle 9,918 0    
Dividends declared but not paid at end of period 96,219 95,049 12,552  
Reconciliation of residential mortgage loans held-for-sale:        
Residential mortgage loans held-for-sale at beginning of period 30,414 40,146 40,146  
Purchases of residential mortgage loans held-for-sale 0 567    
Transfers to other receivables for foreclosed government-guaranteed loans (403) (2,292)    
Transfer of fair value of mortgage servicing rights to fair value of Ginnie Mae residential mortgage loans held-for-sale upon buyout 0 (9)    
Proceeds from sales of residential mortgage loans held-for-sale 0 (3,708)    
Proceeds from repayment of residential mortgage loans held-for-sale (1,754) (4,532)    
Realized and unrealized gains on residential mortgage loans held-for-sale 556 1,774    
Residential mortgage loans held-for-sale at end of period $ 28,813 $ 31,946 $ 30,414