EX-10.22.5





 Exhibit 10.22.5 

EXECUTION VERSION 

AMENDMENT NO. 5 
 TO
MASTER REPURCHASE AGREEMENT 
 Amendment No. 5 to Master Repurchase Agreement, dated as of March 21, 2017 (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 and Amendment No. 4, dated as of July 26, 2016, 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
“Buydown Application Request”, “Buydown Availability”, “Buydown Determination Date”, “Buydown Determination Period” and “                               
         ” in their proper alphabetical order. 

“Buydown Application Request” shall have the meaning set forth in Section 9(f) hereof. 

“Buydown Availability” shall mean that portion of the Buydown Amount in excess of the Minimum Balance
Requirement. 
 “Buydown Determination Date” shall mean the Friday of each calendar week; provided that if
such day is not a Business Day, the preceding Business Day. 
 “Buydown Determination Period” shall mean the
thirty (30) calendar days prior to any Buydown Determination Date. 

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXX 

  
 1 













 SECTION 2. Margin Amount Maintenance. Section 4 of the Existing Repurchase
Agreement is hereby amended by deleting subsection (b) in its entirety and replacing it with the following: 
 (b) If at any time the
aggregate Asset Values of Purchased Assets then subject to Transactions are less than the aggregate Purchase Prices (taking into account the application of any Buydown Availability pursuant to Section 9(f) hereof) for such Purchased Assets (a
“Margin Deficit”), then Buyer may by notice to Seller (as such notice is more particularly set forth below, a “Margin Call”), require Seller to transfer to Buyer or its designee cash in the amount of the Margin
Deficit. 
 SECTION 3. Servicing. Section 9 of the Existing Repurchase Agreement is hereby amended by deleting subsection
(f) in its entirety and replacing it with the following: 
 (f) Buydown Amount. The Buydown Amount shall be held as unsegregated
cash margin and collateral for all Obligations under this Agreement. 
 (i) Provided that no Default or Event of Default
exists, upon one (1) Business Day’s prior notice (received on or before 5:00 p.m. Eastern time), no more than once per calendar week and to the extent the Buydown Utilization Threshold is met, the Seller may submit a written request in the
form of Exhibit H hereto (a “Buydown Application Request”) requesting Buyer apply the Buydown Availability to new Transactions pursuant to the terms identified therein XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX To the extent that the Buydown Utilization Threshold is not met on any Buydown Determination Date, all Transactions entered into on the
following Business Day and thereafter (until such time that the Buydown Utilization Threshold is met and Seller delivers a Buydown Application Request) shall be at the applicable Asset Value as set forth in the Pricing Letter without consideration
of any prior Buydown Application Request. 
 (ii) During the requested period of time that the application of the
Buydown Availability is effective (as identified in the Buydown Application Request), the Buyer shall apply the Buydown Availability from the Operating Account and shall allocate such amount to the outstanding Purchase Price of the Purchased
Mortgage Loans that become subject to Transactions during such time to match the applicable Buydown Application Request. To the extent there are insufficient funds in the Operating Account, Seller shall wire such funds at least one (1) Business
Day prior to the effective date of any Buydown Application Request. 
 (iii) Provided that no Default or Event of Default
exists, upon two (2) Business Days’ prior notice, no more than once per calendar week and to the extent the Buyer previously applied the Buydown Availability pursuant to the terms hereof, the Seller may submit a Buydown Application
Request, requesting that Buyer no longer apply such amounts to the outstanding Purchase Price of all Purchased Mortgage Loans. Upon the effective date thereof as set forth in the Buydown Availability Request, all Transactions shall revert to the
applicable Asset Value as set forth in the Pricing Letter and Buyer shall return such previously applied amounts to the Operating Account. 

  
 2 













 (iv) A Buydown Application Request shall be effective only upon Buyer’s
written acceptance thereof which may be by email. 
 (v) Any application of the Buydown Availability or return of the Buydown
Availability to the Operating Account shall be subject to the terms of the Program Documents, including, without limitation, Schedule 1 of the Pricing Letter. 

(vi) Without limiting the generality of the foregoing, in the event that a breach of a Concentration Limit, a Margin Call or
other Default exists, the Buyer shall be entitled to use any or all of the Buydown Amount (which for the avoidance of doubt, shall include amounts of Buydown Availability applied to the outstanding Purchase Price of Purchased Mortgage Loans pursuant
to the terms hereof) and to withdraw such amounts from the Operating Account or re-apply amounts previously applied to the outstanding Purchase Price in Buyer’s sole discretion to cure such circumstance
or otherwise exercise remedies available to the Buyer without prior notice to, or consent from, Seller. 
 (vii) Regardless
of whether a Margin Call or other Default exists, Buyer also may withdraw interest paid to the Operating Account in its discretion from time to time, and without prior notice to or consent from the Seller, as a full or partial off-set to Seller’s obligation hereunder to pay the Price Differential. 
 (viii)
Within two (2) Business Days’ receipt of written request from Seller, and provided no Margin Call or other Default exists, Buyer shall withdraw any portion of such Buydown Amount from the Operating Account and remit such amount back to
Seller. 
 SECTION 4. Exhibits. The Existing Repurchase Agreement is hereby amended by adding Exhibit H attached hereto
as Annex A in its proper alphabetical order. 
 SECTION 5. Conditions Precedent. This Amendment shall become effective as
of the date hereof, subject to the satisfaction of the following conditions precedent: 
 (w) Buyer shall have received this
Amendment, executed and delivered by duly authorized officers of the Buyer and Seller; and 
 (x) such other documents as the
Buyer or counsel to the Buyer may reasonably request. 
 SECTION 6. 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 7. 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. 

  
 3 













 SECTION 8. 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 9. 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 10. 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 11. Binding
Effect. This Amendment shall be binding upon and inure to the benefit of the parties hereto and their respective successors and assigns. 

SECTION 12. 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] 

  
 4 













 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. 5 to Master Repurchase Agreement 












 ANNEX A TO THE AMENDMENT 

EXHIBIT H 
 FORM OF BUYDOWN
APPLICATION REQUEST 
 UBS AG 
 1285 Avenue of the Americas

 New York, NY 10019 
 Attention: UBS Warehouse Lending
Operations 
 Email: OL-mosg-funding@ubs.com 

With a copy to: 
 UBS Warehouse Finance Group 

Email: OL-SGMF-business@ubs.com 

Re: The Master Repurchase Agreement, dated as of June 1, 2015 (the “Repurchase Agreement”), between UBS AG, by and
through its branch office at 1285 Avenue of the Americas, New York, New York (“Buyer”) and loanDepot.com, LLC (“Seller”) 

Ladies and Gentlemen: 
 In accordance with
Section 9(f) of the Repurchase Agreement, Seller hereby requests [that the Buydown Availability be applied to the outstanding Purchase Price] [previously applied amounts of the Buydown Availability be returned to the Operating Account] as
further set forth below: 
 [Terms to Application of Buydown Availability:] 

Temporary Purchase Price Percentage: _______%. (no decimal points) 

Effective Date: [                ] 

Expiration Date: [                ] 

Amount of Fund to be wired to Operating Account (if any): $[                ]

 Unless otherwise terminated pursuant to the Repurchase Agreement, this Buydown Application Request shall terminate on the Expiration Date
indicated above.] 
 [Return of Previously Applied Buydown Availability:] 

Return to Contractual Purchase Price Percentage: _______. (check) 

  
 Exh. H-1 













 Effective Date:
[                ] 
 All terms used herein and not
otherwise defined herein shall have the respective meanings ascribed to such terms in the Repurchase Agreement. 
 As of the date hereof,
this Buydown Availability Request shall supersede all previous Buydown Availability Requests entered into between Buyer and Seller in all respects including, without limitation, with respect to Purchased Mortgage Loans that are subject to
Transactions that are outstanding as of the date hereof. 
  

			
	loanDepot.com, LLC, as Seller
		
	By:	 	  

		 	Name:
		 	Title:


 Request Date: ________________ 

  
 Exh. H-2