EX-10.22.12





 Exhibit 10.22.12 

EXECUTION 
 AMENDMENT NO.
12 
 TO MASTER REPURCHASE AGREEMENT 

Amendment No. 12 to Master Repurchase Agreement, dated as of April 21, 2020 (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, Amendment No. 7, dated as of
December 15, 2017, Amendment No. 8, dated as of April 24, 2018, Amendment No. 9, dated as of May 23, 2018, Amendment No. 10, dated as of November 16, 2018 and Amendment No. 11, dated as of April 23, 2019,
the “Existing Repurchase Agreement”; and 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 and Pricing Letter, as applicable. 

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: 
 1.1 deleting the definitions of “Electronic Record”, “Electronic Tracking
Agreement”, “Mortgage”, “Mortgage Loan” and “Other Conforming Mortgage Loan” in their entirety and replacing them with the following: 

“Electronic Record” shall mean, as the context requires, (i) “Record” and “Electronic
Record,” both as defined in E-Sign, and shall include but not be limited to, recorded telephone conversations, fax copies or electronic transmissions, including without limitation, those involving the
Warehouse Electronic System, and (ii) with respect to an eMortgage Loan, the related eNote and all other documents comprising the Mortgage File electronically created and that are stored in an electronic format, if any. 

“Electronic Tracking Agreement” shall mean one or more Electronic Tracking Agreements with respect to
(x) the tracking of changes in the ownership, mortgage servicers and servicing rights ownership of Purchased Mortgage Loans held on the MERS System, and (y) the tracking of the Control of eNotes held on the MERS eRegistry, each in a form
acceptable to Buyer. 

  
 1 













 “Mortgage” shall mean each mortgage, assignment of rents,
security agreement and fixture filing, or deed of trust, assignment of rents, security agreement and fixture filing, deed to secure debt, assignment of rents, security agreement and fixture filing, or similar instrument creating and evidencing a
first lien, or with respect to a State Bond Loan a first lien and all related subordinated liens, (subject to Permitted Encumbrances) on real property and other property and rights incidental thereto, unless such Mortgage is granted in connection
with a Co-op Loan, in which case the first lien position (subject to Permitted Encumbrances) is in the Co-op Shares and in the Proprietary Lease relating to such Co-op Shares. 
 “Mortgage Loan” shall mean any first lien, or with
respect to a State Bond Loan a first lien and all related subordinated liens, (subject to Permitted Encumbrances),
one-to-four-family residential mortgage loan evidenced by a Mortgage Note and secured by a Mortgage, which Mortgage Loan is
subject to a Transaction hereunder, which in no event shall include any mortgage loan which (a) is subject to Section 226.32 of Regulation Z or any similar state law (relating to high interest rate credit/lending transactions),
(b) includes any single premium credit, life or accident and health insurance or disability insurance, or (c) is a High Cost Mortgage Loan. 

“Other Conforming Mortgage Loan” shall mean a Mortgage Loan, which is secured by a first lien, or with respect
to a State Bond Loan a first lien and all related subordinated liens, (subject to Permitted Encumbrances), such Mortgage Loan (a) conforms to the requirements of an Agency for securitization or cash purchase, (b) is eligible to be insured
by FHA, guaranteed by VA or guaranteed by RD (excluding any Mortgage Loan which exceeds Agency guidelines for maximum general conventional loan amount) or (c) conforms to the requirements of the qualifying local or state governmental
homeownership program administered by a Housing Finance Agency (as defined under 24 CFR 266.5), but in the case of (a)-(c) does not otherwise meet all of the requirements of a Conforming Mortgage Loan or State Bond Loan as set forth herein. 

1.2 adding the following definitions in their proper alphabetical order: 

“Agency-Required eNote Legend” shall mean the legend or paragraph required by Fannie Mae or Freddie Mac, as
applicable, to be set forth in the text of an eNote, which includes the provisions set forth on Exhibit I to the Custodial Agreement, as may be amended from time to time by Fannie Mae or Freddie Mac, as applicable. 

“Authoritative Copy” shall mean, with respect to an eNote, the unique copy of such eNote that is within the
Control of the Controller. 
 “Control” shall mean, with respect to an eNote, the “control” of
such eNote within the meaning of UETA and/or, as applicable, E-Sign, which is established by reference to the MERS eRegistry and any party designated therein as the Controller. 

“Control Failure” shall mean, with respect to an eNote, (i) if the Controller status of the eNote shall
not have been transferred to Buyer, (ii) Buyer shall otherwise not be designated as the Controller of such eNote in the MERS eRegistry (other than pursuant to a Bailee Letter), (iii) if the eVault shall have released the Authoritative Copy of
an eNote in contravention of the requirements of the Custodial Agreement, or (iv) if the Custodian initiated any changes on the MERS eRegistry in contravention of the terms of the Custodial Agreement. 

  
 2 













 “Controller” shall mean, with respect to an eNote, the
party designated in the MERS eRegistry as the “Controller”, and who in such capacity shall be deemed to be “in control” or to be the “controller” of such eNote within the meaning of UETA or E-Sign, as applicable. 
 “Delegatee” shall mean, with respect to an
eNote, the party designated in the MERS eRegistry as the “Delegatee” or “Delegatee for Transfers”, who in such capacity is authorized by the Controller to perform certain MERS eRegistry transactions on behalf of the Controller
such as Transfers of Control and Transfers of Control and Location. 
 “Electronic Agent” shall mean
MERSCORP Holdings, Inc., or its successor in interest or assigns. 
 “eMortgage Loan” shall mean a Mortgage
Loan that is a Conforming Mortgage Loan (other than an FHA Loan, VA Loan or RD Loan) with respect to which there is an eNote and as to which some or all of the other documents comprising the related Mortgage File may be created electronically and
not by traditional paper documentation with a pen and ink signature. 
 “eNote” shall mean, with respect to
any eMortgage Loan, the electronically created and stored Mortgage Note that is a Transferable Record. 
 “eNote
Delivery Requirement” shall have the meaning set forth in Section 3(c)(ii) of the Repurchase Agreement. 

“eNote Replacement Failure” shall have the meaning set forth in the Custodial Agreement. 

“eVault” shall mean an electronic repository established and maintained by an eVault Provider for delivery and
storage of eNotes. 
 “eVault Provider” shall mean Document Systems, Inc. d/b/a DocMagic, or its successor
in interest or assigns, or such other entity agreed upon by Custodian and Buyer. 
 “Hash Value” shall mean,
with respect to an eNote, the unique, tamper-evident digital signature of such eNote that is stored with MERS. 

“Index Rate” shall have the meaning set forth in the Pricing Letter. 

“Location” shall mean, with respect to an eNote, the location of such eNote which is established by reference
to the MERS eRegistry. 
 “MERS eDelivery” shall mean the transmission system operated by the Electronic
Agent that is used to deliver eNotes, other Electronic Records and data from one MERS eRegistry member to another using a system-to-system interface and conforming to
the standards of the MERS eRegistry. 

  
 3 













 “MERS eRegistry” shall mean the electronic registry
operated by the Electronic Agent that acts as the legal system of record that identifies the Controller, Delegatee and Location of the Authoritative Copy of registered eNotes. 

“MERS Org ID” shall mean a number assigned by the Electronic Agent that uniquely identifies MERS members, or,
in the case of a MERS Org ID that is a “Secured Party Org ID”, uniquely identifies MERS eRegistry members, which assigned numbers for each of Buyer, Seller and Custodian have been provided to the parties hereto. 

“One-Month LIBOR” shall have the meaning set forth in the Pricing
Letter. 
 “Overnight LIBOR” shall have the meaning set forth in the Pricing Letter. 

“Servicing Agent” shall mean, with respect to an eNote, the field entitled, “Servicing Agent” in the
MERS eRegistry. 
 “State Bond Loan” shall mean a Mortgage Loan (including the first lien and all related
subordinated liens), which (a) is originated and underwritten in accordance with qualifying local or state governmental homeownership program administered by a Housing Finance Agency (as defined under 24 CFR 266.5) in a State approved by Buyer
in its sole discretion and (b) either (i) conforms to the requirements of an Agency for securitization or cash purchase and has (A) a minimum FICO score of 660, (B) a DTI of not more than 45% and (C) a LTV not greater than 100% or
(ii) is eligible to be insured by FHA, guaranteed by VA or guaranteed by RD and has (A) a minimum FICO score of 640; (B) a DTI of not more than 50% and (C) has a LTV not greater than 100%. 

“Successor Rate” shall mean a rate determined by Buyer in accordance with
Section 5(i) hereof. 
 “Transfer of Control” shall mean, with respect to an
eNote, a MERS eRegistry transfer transaction used to request a change to the current Controller of such eNote. 

“Transfer of Control and Location” shall mean, with respect to an eNote, a MERS eRegistry transfer transaction
used to request a change to the current Controller and Location of such eNote. 
 “Transfer of Location”
shall mean, with respect to an eNote, a MERS eRegistry transfer transaction used to request a change to the current Location of such eNote. 

“Transferable Record” shall mean an Electronic Record under E-Sign and
UETA that (i) would be a note under the Uniform Commercial Code if the Electronic Record were in writing, (ii) the issuer of the Electronic Record has expressly agreed is a “transferable record”, and (iii) for purposes of E-SIGN, relates to a loan secured by real property. 

  
 4 













 “UETA” shall mean the Official Text of the Uniform
Electronic Transactions Act as approved by the National Conference of Commissioners on Uniform State Laws at its Annual Conference on July 29, 1999. 

“Unauthorized Servicing Agent Modification” shall have the meaning set forth in the Custodial Agreement. 

SECTION 2. Initiation. The Existing Repurchase Agreement is hereby amended by deleting Section 3(c)(ii)
in its entirety and replacing it with the following: 
 (ii) Seller shall deliver to Custodian the Mortgage File with respect
to each Mortgage Loan subject to the requested Transaction (A) which is not a Wet Loan, in accordance with the timeframes set forth in the Custodial Agreement, and (B) with respect to each Wet Loan, on or prior to the Wet Delivery
Deadline; provided that, with respect to any eMortgage Loan, Seller shall deliver to Custodian each of Buyer’s and Seller’s MERS Org IDs, and shall cause (i) the Authoritative Copy of the related eNote to be delivered to the eVault
via a secure electronic file, (ii) the Controller status of the related eNote to be transferred to Buyer, (iii) the Location status of the related eNote to be transferred to Custodian, and (iv) the Delegatee status of the related
eNote to be transferred to Custodian, in each case using MERS eDelivery and the MERS eRegistry (collectively, the “eNote Delivery Requirements”). 

SECTION 3. Collections; Income Payments. Section 5 of the Existing Repurchase Agreement is hereby amended by adding the
following new subsection at the end thereof: 
 (i) If Buyer determines that, by reason of circumstances affecting the
relevant market, adequate and reasonable means do not exist for ascertaining One-Month LIBOR or Overnight LIBOR, Buyer shall give prompt notice thereof to Seller, whereupon the Index Rate and Operating Account
Rate, until such notice has been withdrawn by Buyer, shall be an alternative per annum rate based on an index approximating the behavior of One-Month LIBOR or Overnight LIBOR, as applicable, as determined by
Buyer in its sole discretion (such rate, a “Successor Rate”). 
 SECTION 4. Covenants. Section 11 of the
Existing Repurchase Agreement is hereby amended by: 
 4.1 (i) deleting the “and” at the end of
Section 11(c)(i)(E) and (ii) adding the following new clause immediately at the end thereof: 
  

	 	(F)	 upon Seller becoming aware of any Control Failure with respect to a Purchased Mortgage Loan that is an
eMortgage Loan or any eNote Replacement Failure; and 


  

	 	4.2	 adding the following new Section 11(ff) at the end thereof: 



  
 5 














	 	(ff)	 MERS. Seller shall comply in all material respects with the rules and procedures of MERS in connection
with the servicing of all Purchased Mortgage Loans that are registered with MERS and, with respect to Purchased Mortgage Loans that are eMortgage Loans, the maintenance of the related eNotes on the MERS eRegistry for as long as such Purchased
Mortgage Loans are so registered. 


 SECTION 5. Representations and Warranties. Schedule 1 to the Existing
Repurchase Agreement is hereby amended by: 
 5.1 deleting paragraphs (m), (o) and (ddd) in their entirety and replacing them with the
following, respectively: 
 (m) Valid First Lien. Each Mortgage is a valid and subsisting first lien (or in the case
of a State Bond Loan, a first lien and all subordinated liens) of record on a single parcel of real estate constituting the Mortgaged Property, including all buildings and improvements on the Mortgaged Property and all installations and mechanical,
electrical, plumbing, heating and air conditioning systems located in or annexed to such buildings, and all additions, alterations and replacements made at any time, subject in all cases to the exceptions to title set forth in the title insurance
policy with respect to the related Mortgage Loan, which exceptions are generally acceptable to prudent mortgage lending companies, and such other exceptions to which similar properties are commonly subject and which do not individually, or in the
aggregate, materially and adversely affect the benefits of the security intended to be provided by such Mortgage. The lien of the Mortgage is subject only to: 

(i) the lien of current real property taxes and assessments not yet due and payable; 

(ii) covenants, conditions and restrictions, rights of way, easements and other matters of the public record as of the date of
recording acceptable to prudent mortgage lending institutions generally and specifically referred to in the lender’s title insurance policy delivered to the originator of the Mortgage Loan and (a) specifically referred to or otherwise
considered in the appraisal made for the originator of the Mortgage Loan or (b) which do not adversely affect the Appraised Value of the Mortgaged Property set forth in such appraisal; and 

(iii) other matters to which like properties are commonly subject which do not materially interfere with the benefits of the
security intended to be provided by the Mortgage or the use, enjoyment, value or marketability of the related Mortgaged Property. 
 Any
security agreement, chattel mortgage or equivalent document related to and delivered in connection with the Mortgage Loan establishes and creates a valid, subsisting, enforceable and perfected first lien and first priority security interest on
the property described therein and Seller has full right to sell and assign the same to Buyer. The Mortgaged Property was not, as of the date of origination of the Mortgage Loan, subject to a mortgage, deed of trust, deed to secure debt or other
security instrument creating a lien subordinate to the lien of the Mortgage. 

  
 6 













 (o) Full Disbursement of Proceeds. The Mortgage Loan has been closed
and, except with respect to, Homestyle Renovation Mortgage Loans or HomePath Renovation Mortgage Loans, the proceeds of the Mortgage Loan have been fully disbursed and there is no requirement for future advances thereunder, and any and all
requirements as to completion of any on site or off site improvement and as to disbursements of any escrow funds therefor have been complied with. With respect to HomeStyle Renovation Mortgage Loans and HomePath Renovation Mortgage Loans, Seller has
made all advances and disbursements in accordance with the terms of the Mortgage and/or the terms and conditions of the related mortgage loan program, and such additional amounts have been advanced or disbursed from Seller’s own funds and not
from the funds representing any Purchase Price paid by Buyer to Seller hereunder. All costs, fees and expenses incurred in making or closing the Mortgage Loan and the recording of the Mortgage were paid, and the Mortgagor is not entitled to any
refund of any amounts paid or due under the Mortgage Note or Mortgage. All points and fees related to each Mortgage Loan were disclosed in writing to the Mortgagor in accordance with applicable state and federal law and regulation. Other than in
connection with a State Bond Loan, no Mortgagor was charged “points and fees” (whether or not financed) in an amount that exceeds 3% of the total loan amount (or such other applicable limits for lower balance Mortgages) as specified under
12 CFR 1026.43(e)(3), and the points and fees were calculated using the calculation required for qualified mortgages under 12 CFR 1026.32(b) to determine compliance with applicable requirements. 

(ddd) Qualified Mortgage. Each Mortgage Loan satisfies the following criteria: (i) such Mortgage Loan (other than a
State Bond Loan) is a Qualified Mortgage; (ii) prior to the origination of such Mortgage Loan, the related originator made a reasonable and good faith determination that the related Mortgagor would have a reasonable ability to repay such Mortgage
Loan according to its terms, in accordance with, at a minimum, the eight underwriting factors set forth in 12 CFR 1026.43(c)(2); and (iii) such Mortgage Loan is supported by documentation that evidences compliance with (x) the Ability to Repay Rule
and (y) other than with respect to a State Bond Loan, the QM Rule. 
 5.2 adding the following new paragraphs at the end thereof: 

(bbbb) State Bond Loans. With respect to State Bond Loans, the first lien Mortgage Loan and all subordinated Mortgage
Loans with respect thereto shall be subject to the same Transaction hereunder. 
 (cccc) eNote Legend. If the Mortgage
Loan is an eMortgage Loan, the related eNote contains the Agency-Required eNote Legend. 
 (dddd) eNotes. With respect
to each eMortgage Loan, the related eNote satisfies all of the following criteria: 
  

	 	(i)	 the eNote bears a digital or electronic signature; 



 

	 	(ii)	 the Hash Value of the eNote indicated in the MERS eRegistry matches the Hash Value of the eNote as reflected in
the eVault; 



  
 7 














	 	(iii)	 there is a single Authoritative Copy of the eNote, as applicable and within the meaning of Section 9-105 of the UCC or Section 16 of the UETA, as applicable, that is held in the eVault; 


  

	 	(iv)	 the Location status of the eNote on the MERS eRegistry reflects the MERS Org ID of the Custodian;



  

	 	(v)	 the Controller status of the eNote on the MERS eRegistry reflects the MERS Org ID of Buyer;



  

	 	(vi)	 the Delegatee status of the eNote on the MERS eRegistry reflects the MERS Org ID of Custodian;



  

	 	(vii)	 the Servicing Agent status of the eNote on the MERS eRegistry reflects the MERS Org ID of Servicer or Seller;



  

	 	(viii)	 There is no Control Failure, eNote Replacement Failure or Unauthorized Servicing Agent Modification with
respect to such eNote; 


  

	 	(ix)	 the eNote is a valid and enforceable Transferable Record or comprises “electronic chattel paper”
within the meaning of the UCC; 


  

	 	(x)	 there is no defect with respect to the eNote that would result in Buyer having less than full rights, benefits
and defenses of “Control” (within the meaning of the UETA or the UCC, as applicable) of the Transferable Record; and 


  

	 	(xi)	 there is no paper copy of the eNote in existence nor has the eNote been
papered-out. 


 SECTION 6. 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; 
 (b)
Amendment No. 29 to Pricing Letter, executed and delivered by duly authorized officers of the Buyer and Seller; 
 (c)
Addendum to Electronic Tracking Agreement for eNotes, dated as of the date hereof, executed and delivered by duly authorized officers of Buyer, Seller, MERSCORP Holdings, Inc. and Mortgage Electronic Registrations Systems, Inc.; and 

(d) such other documents as the Buyer or counsel to the Buyer may reasonably request. 

  
 8 













 SECTION 7. 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 8. Representations and Warranties. Seller hereby represents and warrants to the Buyer that 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 9. 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 10. 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 11. 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. The parties agree that this Amendment, any addendum or amendment hereto or any other document necessary for the consummation of the
transactions contemplated by this Amendment may be accepted, executed or agreed to through the use of an electronic signature in accordance with the E-Sign, UETA and any applicable state law. Any document
accepted, executed or agreed to in conformity with such laws will be binding on all parties hereto to the same extent as if it were physically executed and each party hereby consents to the use of any secure third party electronic signature capture
service providers with appropriate document access tracking, electronic signature tracking and document retention as may be approved by the Buyer in its sole discretion. 

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


  
 9 













 
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 SECTIONS
5-1401 AND 5-1402 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] 

  
 10 













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