For the year ended December 31, 2019, net cash used in investing activities was $5.6 million. This cash used primarily consisted of capital expenditures of $10.1 million and acquisition of intangible assets of $1.8 million. These cash uses were offset by $5.4 million in equity security sales.
For the year ended December 31, 2018, net cash provided by investing activities was $32.9 million. This cash provided primarily consisted of net proceeds of $53.7 million primarily from the sale of the spectrum intangible assets, offset by capital expenditures of $19.4 million and acquisition of intangible assets of $1.5 million.
For the year ended December 31, 2017, net cash used in investing activities was $21.7 million. This cash used primarily consisted of capital expenditures of $20.4 million and acquisition of intangible assets of $1.8 million.
Cash Flows from Financing Activities
Historically, Legacy Vivint Smart Home’s cash flows provided by financing activities primarily related to the issuance of debt, all to fund the portion of upfront costs associated with generating new subscribers that are not covered through operating cash flows or through the Vivint Flex Pay program. Uses of cash for financing activities are generally associated with the return of capital to Legacy Vivint Smart Home stockholders, the repayment of debt and the payment of financing costs associated with the issuance of debt.
For the year ended December 31, 2019, net cash provided by financing activities was $218.9 million, consisting primarily of $225.0 million in borrowings on notes, $342.5 million in borrowings on the revolving credit facility and $4.7 million from a capital contribution. This was offset with $233.1 million of repayments on notes, $97.5 million of repayments on the revolving credit facility, $4.9 million in financing costs, $9.8 million of repayments under finance lease obligations, $5.4 million in returns of capital associated with the Wirelessspin-off and $2.6 million in cost associated with offering securities.
For the year ended December 31, 2018, net cash provided by financing activities was $196.4 million, consisting primarily of $810.0 million in borrowings on notes, $201.0 million in borrowings on the revolving credit facility and $4.7 million from a capital contribution. This was offset with $522.2 million of repayments on notes, $261.0 million of repayments on the revolving credit facility, $20.6 million in financing costs, $12.4 million of repayments under capital lease obligations and $3.1 million in cost associated with offering securities.
For the year ended December 31, 2017, net cash provided by financing activities was $291.2 million, consisting primarily of $724.8 million in borrowings on notes and $196.9 million in borrowings on the revolving credit facility. This was offset with $450.0 million of repayments on notes, $136.9 million of repayments on the revolving credit facility, $29.4 million in financing costs, $10.0 million of repayments under capital lease obligations, $3.0 million in repayments under spectrum lease obligations and $1.2 million in cost associated with offering securities.
Long-Term Debt
We are a highly leveraged company with significant debt service requirements. As of December 31, 2019, Legacy Vivint Smart Home had $3,294.2 million of aggregate principal total debt outstanding, consisting of $454.3 million of outstanding 2020 notes, $270 million of outstanding 2022 private placement notes, $900.0 million of outstanding 2022 notes, $400.0 million of outstanding 2023 notes, $225.0 million of outstanding 2024 notesand $799.9 million of outstanding 2024 Term Loan B with $32.1 million of availability under the revolving credit facility (after giving effect to $11.1 million of outstanding letters of credit and $245.0 million of borrowings).
Revolving Credit Facility
On November 16, 2012, APX entered into a $200.0 million senior secured revolving credit facility, with a five year maturity. In addition, APX may request one or more term loan facilities, increased commitments under the revolving credit facility or new revolving credit commitments, in an aggregate amount not to exceed $225.0 million.
On June 28, 2013, APX amended and restated the credit agreement to provide for a new repriced tranche of revolving credit commitments with a lower interest rate. Nearly all of the existing tranches of revolving credit commitments were terminated and converted into the repriced tranche, with the unterminated portion of the existing tranche continuing to accrue interest at the original higher rate.
24