EX-10.22.8





 Exhibit 10.22.8 

EXECUTION 
 AMENDMENT NO.
8 
 TO MASTER REPURCHASE AGREEMENT 

Amendment No. 8 to Master Repurchase Agreement, dated as of April 24, 2018 (this “Amendment”), between UBS AG, by
and through its branch office at 1285 Avenue of the Americas, New York, New York (the “Buyer”) and loanDepot.com, LLC (the “Seller”). 

RECITALS 
 The Buyer and
Seller are parties to that certain (a) Master Repurchase Agreement, dated as of June 1, 2015 (as amended by Amendment No. 1, dated as of September 4, 2015, Amendment No. 2, dated as of October 30, 2015, Amendment
No. 3, dated as of April 26, 2016, Amendment No. 4, dated as of July 26, 2016, Amendment No. 5, dated as of March 21, 2017, Amendment No. 6, dated as of April 25, 2017, and Amendment No. 7, dated as of
December 15, 2017, the “Existing Repurchase Agreement”; as further amended by this Amendment, the “Repurchase Agreement”) and (b) Pricing Letter, dated as of June 1, 2015 (as amended, restated,
supplemented or otherwise modified from time to time, the “Pricing Letter”). Capitalized terms used but not otherwise defined herein shall have the meanings given to them in the Existing Repurchase Agreement. 

Accordingly, the Buyer and Seller hereby agree, in consideration of the mutual promises and mutual obligations set forth herein, that the
Existing Repurchase Agreement is hereby amended as follows: 
 SECTION 1. Definitions. Section 2 of the Existing Repurchase
Agreement is hereby amended by adding the following definitions of “Ginnie Mae Modified Loan”, “Modification Agreement”, “RD Loan”, “RD Loan Guaranty Agreement”, “VA
Loan” and “VA Loan Guaranty Agreement” in their proper alphabetical order: 
 “Ginnie Mae Modified
Loan” shall mean an FHA Loan, VA Loan or RD Loan that (i) is modified in accordance with the Ginnie Mae guide, (ii) conforms to the requirements of Ginnie Mae for securitization; (iii) is not a Wet Loan and (iv) is
otherwise acceptable to Buyer in its sole discretion. 
 “Modification Agreement” shall mean, with respect to a Ginnie Mae
Modified Loan, the agreement that modifies the terms of the Mortgage Loan in accordance with the Ginnie Mae guide. 
 “RD
Loan” shall mean a Mortgage Loan which is the subject of a RD Loan Guaranty Agreement as evidenced by a loan guaranty. 

“RD Loan Guaranty Agreement” shall mean the agreement evidencing the contractual obligation of the RD respecting the guaranty
of an RD Loan. 
 “VA Loan” shall mean a Mortgage Loan which is the subject of a VA Loan Guaranty Agreement as evidenced by
a loan guaranty certificate. 
 “VA Loan Guaranty Agreement” shall mean the agreement evidencing the contractual obligation
of the VA respecting the guaranty of a VA Loan. 

  
 1 













 SECTION 2. Representations and Warranties. Schedule 1 to the Existing Repurchase
Agreement is hereby amended by: 
 2.1 deleting subparagraphs (b), (c), (e), (f), (g), (h), (j), (t), (w), (dd), (kk) and (ggg) in their
entirety and replacing them with the following: 
 (b) Payments Current. No payment required under the Mortgage Loan is 30 days or
more delinquent nor has any payment under the Mortgage Loan (other than a Ginnie Mae Modified Loan) been 30 days or more delinquent at any time since the origination of the Mortgage Loan; and, if the Mortgage Loan is a
Co-op Loan, no foreclosure action or private or public sale under the Uniform Commercial Code has ever to the knowledge of Seller, been threatened or commenced with respect to the Co-op Loan.  
 (c) Origination Date. Unless otherwise approved by Buyer and other than with
respect to a Ginnie Mae Modified Loan, the initial Purchase Date is no more than (i) with respect to Mortgage Loans other than Correspondent Mortgage Loans in non-escrow states, thirty (30) days
following the origination date of the Mortgage Note; (ii) with respect to Mortgage Loans other than Correspondent Mortgage Loans in escrow states, forty-five (45) days following the origination date of the Mortgage Note and (iii) with
respect to Correspondent Mortgage Loans, sixty (60) days following the origination date of the Mortgage Note. 
 (e) No Outstanding
Charges. There are no defaults in complying with the terms of the Mortgage, and all taxes, governmental assessments, insurance premiums, water, sewer and municipal charges, leasehold payments or ground rents which previously became due and owing
have been paid, or an escrow of funds has been established in an amount sufficient to pay for every such item which remains unpaid and which has been assessed but is not yet due and payable. Other than with respect to a Ginnie Mae Modified Loan,
Seller has not advanced funds, or induced, solicited or knowingly received any advance of funds by a party other than the Mortgagor, directly or indirectly, for the payment of any amount required under the Mortgage Loan, except for interest accruing
from the date of the Mortgage Note or date of disbursement of the Mortgage Loan proceeds, whichever is earlier, to the day which precedes by one month the Due Date of the first installment of principal and interest. 

(f) Original Terms Unmodified. Other than with respect to a Ginnie Mae Modified Loan, the terms of the Mortgage Note (and the
Proprietary Lease, the Assignment of Proprietary Lease and Stock Power with respect to each Co-op Loan) and Mortgage have not been impaired, waived, altered or modified in any respect, from the date of
origination except by a written instrument which has been recorded, if necessary to protect the interests of Buyer, and which has been delivered to the Custodian or to such other Person as Buyer shall designate in writing, and the terms of which are
reflected in the Mortgage Loan Schedule. The substance of any such waiver, alteration or modification has been approved by the issuer of any related PMI Policy and the title insurer, if any, to the extent required by the policy, and its terms are
reflected on the Mortgage Loan Schedule, if applicable. No Mortgagor has been released, in whole or in part, except in connection with an assumption agreement, approved by the issuer of any related PMI Policy and the issuer of the title insurer, to
the extent required by the policy, and which assumption agreement is part of the Mortgage File delivered to the Custodian or to such other Person as Buyer shall designate in writing and the terms of which are reflected in the Mortgage Loan Schedule.
Each Ginnie Mae Modified Loan has been modified in accordance with the Ginnie Mae guide. 

  
 2 













 (g) No Defenses. The Mortgage Loan (and the Assignment of Proprietary Lease related
to each Co-op Loan) is not subject to any right of rescission, set-off, counterclaim or defense, including without limitation the defense of usury, nor will the
operation of any of the terms of the Mortgage Note or the Mortgage or with respect to a Ginnie Mae Modified Loan, the terms of the Modification Agreement, or the exercise of any right thereunder, render either the Mortgage Note or the Mortgage or
with respect to a Ginnie Mae Modified Loan, the Modification Agreement unenforceable, in whole or in part, or subject to any right of rescission, set-off, counterclaim or defense, including without limitation
the defense of usury, and no such right of rescission, set-off, counterclaim or defense has been asserted with respect thereto, and no Mortgagor was a debtor in any state or federal bankruptcy or insolvency
proceeding at, or subsequent to, the time the Mortgage Loan was originated or with respect to a Ginnie Mae Modified Loan, at the time the Modification Agreement was entered into. 

(h) Hazard Insurance. Pursuant to the terms of the Mortgage, all buildings or other improvements upon the Mortgaged Property are insured
by a generally acceptable insurer against loss by fire, hazards of extended coverage and such other hazards as are provided for in the Fannie Mae guides or by Freddie Mac, as well as all additional requirements set forth in the Approved Underwriting
Guidelines. If required by the National Flood Insurance Act of 1968, as amended, and the Flood Disaster Protection Act of 1973, as amended, each Mortgage Loan is covered by a flood insurance policy meeting the requirements of the current guidelines
of the Federal Insurance Administration as in effect which policy conforms to Fannie Mae and Freddie Mac, as well as all additional requirements set forth in the Servicing Agreement. All individual insurance policies contain a standard mortgagee
clause naming Seller and its successors and assigns as mortgagee, and all premiums thereon have been paid and such policies may not be reduced, terminated or cancelled without 30 days’ prior written notice to the mortgagee. The Mortgage
obligates the Mortgagor thereunder to maintain the hazard insurance policy at the Mortgagor’s cost and expense, and on the Mortgagor’s failure to do so, authorizes the holder of the Mortgage to obtain and maintain such insurance at such
Mortgagor’s cost and expense, and to seek reimbursement therefor from the Mortgagor. Where required by state law or regulation, the Mortgagor has been given an opportunity to choose the carrier of the required hazard insurance, provided the
policy is not a “master” or “blanket” hazard insurance policy covering a condominium, or any hazard insurance policy covering the common facilities of a planned unit development. The hazard insurance policy is the
valid and binding obligation of the insurer, is in full force and effect, and will be in full force and effect and inure to the benefit of Buyer upon the consummation of the transactions contemplated by this Agreement. Seller has not engaged in, and
has no knowledge of the Mortgagor’s or any servicer’s having engaged in, any act or omission which would impair the coverage of any such policy, the benefits of the endorsement provided for herein, or the validity and binding effect of
such policy, including, without limitation, no unlawful fee, commission, kickback or other unlawful compensation or value of any kind has been or will be received, retained or realized by any attorney, firm or other person or entity, and no such
unlawful items have been received, retained or realized by Seller. 

  
 3 













 (j) No Satisfaction of Mortgage. The Mortgage has not been satisfied, canceled,
subordinated or rescinded, in whole or in part, and the Mortgaged Property has not been released from the lien of the Mortgage, in whole or in part, nor has any instrument been executed that would affect any such release, cancellation, subordination
or rescission. Other than with respect to a Ginnie Mae Modified Loan, Seller has not waived the performance by the Mortgagor of any action, if the Mortgagor’s failure to perform such action would cause the Mortgage Loan to be in default, nor
has Seller waived any default resulting from any action or inaction by the Mortgagor. 
 (t) No Defaults. Other than payments due but
not yet 30 days or more delinquent, there is no default, breach, violation or event which would permit acceleration existing under the Mortgage or the Mortgage Note and no event which, with the passage of time or with notice and the expiration of
any grace or cure period, would constitute a default, breach, violation or event which would permit acceleration, and neither Seller nor any of its affiliates nor any of their respective predecessors, have waived any default, breach, violation or
event which would permit acceleration other than with respect to a Ginnie Mae Modified Loan in accordance with the Ginnie Mae guide and the Modification Agreement; and with respect to each Co-op Loan, there is
no default in complying with the terms of the Mortgage Note, the Assignment of Proprietary Lease and the Proprietary Lease and all maintenance charges and assessments (including assessments payable in the future installments, which previously became
due and owing) have been paid, and Seller has the right under the terms of the Mortgage Note, Assignment of Proprietary Lease and Recognition Agreement to pay any maintenance charges or assessments owed by the Mortgagor. 

(w) Origination; Payment Terms. Except with respect to a Correspondent Mortgage Loan, the Mortgage Loan was originated by Seller. Seller
is a mortgagee approved by the Secretary of Housing and Urban Development pursuant to Sections 203 and 211 of the National Housing Act, a savings and loan association, a savings bank, a commercial bank, credit union, insurance company or other
similar institution which is supervised and examined by a federal or state authority. The documents, instruments and agreements submitted for loan underwriting were not falsified and contain no untrue statement of material fact or omit to state a
material fact required to be stated therein or necessary to make the information and statements therein not misleading. No Mortgage Loan contains terms or provisions which would result in negative amortization. Principal payments on the Mortgage
Loan that is not a Ginnie Mae Modified Loan commenced no more than sixty days after funds were disbursed in connection with the Mortgage Loan. The mortgage interest rate as well as the lifetime rate cap and the periodic cap are as set forth on the
Mortgage Loan Schedule. The Mortgage Note is payable in equal monthly installments of principal and interest, which installments of interest, with respect to adjustable rate Mortgage Loans, are subject to change due to the adjustments to the
mortgage interest rate on each interest rate adjustment date, with interest calculated and payable in arrears, sufficient to amortize the Mortgage Loan fully by the stated maturity date, over an original term of not more than thirty years from
commencement of amortization. Unless otherwise specified, the Mortgage Loan is payable on the first day of each month. There are no Mortgage Loans which contain a provision allowing the Mortgagor to convert the Mortgage Note from an adjustable
interest rate Mortgage Note to a fixed interest rate Mortgage Note. 
 (dd) Delivery of Mortgage Documents. The Mortgage Note, the
Mortgage, the Assignment of Mortgage and any other documents required to be delivered under the Custodial Agreement for each Mortgage Loan have been delivered to the Custodian including, the Modification Agreement with respect to a Ginnie Mae
Modified Loan. Seller is in possession of a complete, true and accurate Mortgage File, except for such documents the originals of which have been delivered to the Custodian. 

  
 4 













 (kk) Mortgaged Property Undamaged; No Condemnation Proceedings. There is no
proceeding pending or, to the knowledge of the Seller, threatened for the total or partial condemnation of the Mortgaged Property, other than with respect to a Ginnie Mae Modified Loan. The Mortgaged Property is undamaged by waste, fire, earthquake
or earth movement, windstorm, flood, tornado or other casualty so as to affect adversely the value of the Mortgaged Property as security for the Mortgage Loan or the use for which the premises were intended and each Mortgaged Property is in good
repair. 
 (ggg) Recordation. Each original Mortgage was recorded and, except for those Mortgage Loans subject to the MERS
identification system, all subsequent assignments of the original Mortgage (other than the assignment to Buyer) have been recorded in the appropriate jurisdictions wherein such recordation is necessary to perfect the lien thereof as against
creditors of Seller, or is in the process of being recorded. With respect to each Ginnie Mae Modified Loan, the related Modification Agreement has been recorded or has been sent for recordation. 

2.2 adding the following paragraphs: 

(zzz) Ginnie Mae Modified Loan. Each Ginnie Mae Modified Loan (i) was modified in accordance with the Ginnie Mae guide;
(ii) with respect to (x) a FHA Loan, is fully insured by the FHA pursuant to a FHA Mortgage Insurance Certificate; (y) a VA Loan, is guaranteed by the VA pursuant to a VA Loan Guaranty Agreement and (z) a RD Loan, is guaranteed
by the RD pursuant to a RD Loan Guaranty Agreement and (iii) conforms to the requirements of Ginnie Mae for securitization. 
 (aaaa)
FHA Loans, VA Loans and RD Loans. With respect to each FHA Loan, VA Loan and RD Loan, as applicable, (i) the FHA Mortgage Insurance Certificate is in full force and effect, there exists no impairment to full recovery, the VA Loan
Guaranty Agreement is in full force and effect to the maximum extent stated therein and there exists no impairment to full recovery thereunder and the RD Loan Guaranty Agreement is in full force and effect to the maximum extent stated therein and
there exists no impairment to full recovery thereunder, (ii) all necessary steps have been taken to keep such guaranty or insurance valid, binding and enforceable and each of such is the binding, valid and enforceable obligation of the FHA, the
VA and RD, as applicable, to the full extent thereof, without surcharge, set-off or defense, (iii) such FHA Loan is insured, or eligible to be insured, pursuant to the National Housing Act and such VA
Loan is guaranteed, or eligible to be guaranteed, under the provisions of Chapter 37 of Title 38 of the United States Code, as applicable, (iv) with respect to each FHA Mortgage Insurance Certificate, VA Loan Guaranty Agreement and RD Loan
Guaranty Agreement, as applicable, Seller has complied with applicable provisions of the insurance for guaranty contract and federal statutes and regulations, all premiums or other charges due in connection with such insurance or guarantee have been
paid, there has been no act or omission which would or may invalidate any such insurance or guaranty, and the insurance or guaranty is, or when issued, will be, in full force and effect with respect to such Mortgage Loan and (v) Seller has no
knowledge of any circumstance which would cause such FHA Loan to be ineligible for FHA mortgage insurance, such VA Loan to be ineligible for a VA loan guaranty, such RD Loan to be ineligible for a RD loan guaranty or cause the FHA, the
VA or RD to deny or reject the related Mortgagor’s application for FHA mortgage insurance, a VA loan guaranty or RD loan guaranty, as applicable. 

  
 5 













 SECTION 3. Conditions Precedent. This Amendment shall become effective as
of the date hereof, subject to the satisfaction of the following conditions precedent: 
 (a) Buyer shall have received this Amendment,
executed and delivered by duly authorized officers of the Buyer and Seller; and 
 (b) such other documents as the Buyer or counsel to the
Buyer may reasonably request. 
 SECTION 4. Ratification of Agreement. As amended by this Amendment, the Existing Repurchase
Agreement is in all respects ratified and confirmed and the Existing Repurchase Agreement as so modified by this Amendment shall be read, taken, and construed as one and the same instrument. 

SECTION 5. Representations and Warranties. Seller hereby represents and warrants to the Buyer that, giving effect to this
Amendment, it is in compliance with all the terms and provisions set forth in the Repurchase Agreement on its part to be observed or performed, and that no Default or Event of Default has occurred or is continuing, and hereby confirms and reaffirms
the representations and warranties contained in Section 10 of the Repurchase Agreement. Seller hereby represents and warrants that this Amendment has been duly and validly executed and delivered by it, and constitutes its legal, valid and
binding obligation, enforceable against it in accordance with its terms. 
 SECTION 6. Limited Effect. Except as expressly
amended and modified by this Amendment, the Existing Repurchase Agreement shall continue to be, and shall remain, in full force and effect in accordance with its terms. 

SECTION 7. Severability. Each provision and agreement herein shall be treated as separate and independent from any other provision
or agreement herein and shall be enforceable notwithstanding the unenforceability of any such other provision or agreement. 

SECTION 8. Counterparts. This Amendment may be executed in any number of counterparts, all of which taken together shall
constitute one and the same instrument, and any of the parties hereto may execute this Amendment by signing any such counterpart. The parties agree that this Amendment, any documents to be delivered pursuant to this Amendment and any notices
hereunder may be transmitted between them by email and/or by facsimile. Delivery of an executed counterpart of a signature page of this Amendment in Portable Document Format (PDF) or by facsimile shall be effective as delivery of a manually executed
original counterpart of this Amendment. The original documents shall be promptly delivered, if requested. 
 SECTION 9. Binding
Effect. This Amendment shall be binding upon and inure to the benefit of the parties hereto and their respective successors and assigns. 

  
 6 













 SECTION 10. GOVERNING LAW. THIS AMENDMENT AND ANY CLAIM, CONTROVERSY
OR DISPUTE ARISING UNDER OR RELATED TO THIS AMENDMENT, THE RELATIONSHIP OF THE PARTIES TO THIS AMENDMENT, AND/OR THE INTERPRETATION AND ENFORCEMENT OF THE RIGHTS AND DUTIES OF THE PARTIES TO THIS AMENDMENT SHALL BE GOVERNED BY AND CONSTRUED IN
ACCORDANCE WITH THE INTERNAL LAWS AND DECISIONS OF THE STATE OF NEW YORK, WITHOUT REGARD TO THE CHOICE OF LAW RULES THEREOF. THE PARTIES HERETO INTEND THAT THE PROVISIONS OF SECTION 5-1401 OF THE NEW YORK
GENERAL OBLIGATIONS LAW SHALL APPLY TO THIS AMENDMENT. NOTWITHSTANDING ANYTHING TO THE CONTRARY, THE EFFECTIVENESS, VALIDITY AND ENFORCEABILITY OF ELECTRONIC CONTRACTS, OTHER RECORDS, ELECTRONIC RECORDS AND ELECTRONIC SIGNATURES USED IN CONNECTION
WITH ANY ELECTRONIC TRANSACTION BETWEEN BUYER AND SELLER SHALL BE GOVERNED BY E-SIGN. 

[SIGNATURE PAGE FOLLOWS] 

  
 7 













 IN WITNESS WHEREOF, the parties have caused their names to be signed hereto by their
respective officers thereunto duly authorized as of the day and year first above written. 
  

			
	 UBS AG, BY AND THROUGH ITS BRANCH OFFICE AT 1285 AVENUE OF THE AMERICAS, NEW YORK, NEW
YORK, as Buyer



 
			
		
	By:	 	  

		 	Name:
		 	Title:
		
	By:	 	  

		 	Name:
		 	Title:


 
			
	
	LOANDEPOT.COM, LLC, as Seller


 
			
		
	By:	 	  

		 	Name:
		 	Title:



  
 Signature Page to
Amendment No. 8 to Master Repurchase Agreement