EX-10.40



 Exhibit 10.40 
 EXECUTION 
 AMENDMENT NUMBER EIGHT 

to the 
 MASTER
REPURCHASE AGREEMENT 
 Dated as of December 9, 2010, 
 among 
 PENNYMAC CORP., PENNYMAC MORTGAGE INVESTMENT TRUST HOLDINGS I, LLC and

 PENNYMAC LOAN SERVICES, LLC 
 and 
 CITIBANK, N.A. 

This AMENDMENT NUMBER EIGHT (this “Amendment Number Eight”) is made this 31st day of December, 2012 among PENNYMAC CORP. and PENNYMAC MORTGAGE
INVESTMENT TRUST HOLDINGS I, LLC (each, a “Seller” and jointly and severally, the “Seller” or “Sellers”), PENNYMAC LOAN SERVICES, LLC (“Servicer”) and CITIBANK, N.A.
(“Buyer”), to the Master Repurchase Agreement, dated as of December 9, 2010, among Sellers, Servicer and Buyer, as such agreement may be amended from time to time (the “Agreement”). Capitalized terms used but
not otherwise defined herein shall have the meanings assigned to such terms in the Agreement. 
 RECITALS 

WHEREAS, Sellers and Buyer have agreed to amend the Agreement to modify certain definitions, financial and reporting representations,
warranties, certifications and covenants, as more specifically set forth herein; and 
 WHEREAS, as of the date hereof, each
Seller and Servicer represents to Buyer that the Seller Parties are in full compliance with all of the terms and conditions of the Agreement and each other Program Document and no Default or Event of Default has occurred and is continuing under the
Agreement or any other Program Document. 
 NOW THEREFORE, for good and valuable consideration, the receipt and sufficiency of
which are hereby acknowledged, and for the mutual covenants herein contained, the parties hereto hereby agree as follows: 

SECTION 1. Amendments. Effective as of December 31, 2012 (the “Amendment Effective Date”), the
Agreement is hereby amended as follows: 
 (a) Section 2 of the Agreement is hereby amended by deleting the definition of
“Adjusted Tangible Net Worth” in its entirety and replacing it with the following: 
 “Adjusted Tangible Net
Worth” shall mean, with respect to any Person, as of any date of determination, the excess of such Person’s total assets (including mortgage servicing rights in an amount less than or equal to the MSR Value Cap), net of goodwill and
intangible assets, over its total liabilities, calculated in accordance with GAAP as reflected on such Person’s financial statements. 
 (b) Section 2 of the Agreement is hereby amended by adding the new definition of “MSR Value Cap” as follows: 
 “MSR Value Cap” shall mean the value assigned to a Person’s aggregate portfolio of mortgage servicing rights; provided, however, in any case such value shall not exceed the product
of (i) 4.0, multiplied by (ii) the weighted average servicing fee for all mortgage 







 
loans underlying the mortgage servicing rights, multiplied by (iii) the unpaid principal balance of the mortgage loans underlying the mortgage servicing rights. 

(c) Section 2 of the Agreement is hereby amended by adding the new definition of “Valuation Agent” as follows: 

“Valuation Agent” shall mean a qualified, unaffiliated third party (acceptable to Buyer in its sole discretion including
but not limited to any independent third party appointed by the Buyer in its sole discretion pursuant to Section 43(e)) that specializes in establishing a fair market value of servicing portfolios with respect to mortgage loans substantially
similar to the Loans originated or acquired by a Seller Party, as applicable. 
 (d) Section 12 of the Agreement is hereby
amended by deleting clause “(p)(i)” contained therein in its entirety and replacing it with the following: 
 (i)
(A) the ratio of PennyMac’s Total Indebtedness to its Adjusted Tangible Net Worth is not greater than 10:1; (B) the combined Liquidity of PennyMac and PMIT Holdings is not less than $7,500,000; (C) PennyMac’s consolidated
net income has been equal to or greater than $1.00 for at least one (1) of the previous two (2) consecutive fiscal quarters, as of the end of the last fiscal quarter; and (D) PennyMac’s Adjusted Tangible Net Worth is greater than
or equal to $140,000,000. 
 (e) Section 12 of the Agreement is hereby amended by deleting clause “(p)(iii)”
contained therein in its entirety and replacing it with the following: 
 (iii) (A) Servicer’s Adjusted Tangible Net
Worth is greater than or equal to $90,000,000; (B) Servicer’s unrestricted cash and Cash Equivalents are greater than or equal to $6,375,000; (C) Servicer’s residential mortgage servicing portfolio is in excess of $5,000,000,000
in un-amortized principal balance of loans; (D) the ratio of Servicer’s Total Indebtedness to Adjusted Tangible Net Worth is less than 10:1; and (E) Servicer’s consolidated Net Income was equal to or greater than $1.00 for the
previous calendar quarter. 
 (f) Section 13 of the Agreement is hereby amended by adding new clause “(a)(xiv)”
thereto as follows: 
 (xiv) Within (i) three (3) Business Days after receipt by a Seller Party (to the extent such
Seller Party owns any servicing rights with respect to any mortgage loans) of a request from Buyer, the servicing valuation conducted by such Seller Party and used to support the calculation of the servicing multiple used in determining the book
value of such Seller Party’s servicing portfolio in accordance with GAAP; and (ii) if so requested by Buyer, within (3) Business Days of its completion, the servicing valuation conducted by a Valuation Agent with respect to the value
of such Seller Party’s servicing portfolio in accordance with GAAP; 
 (g) Section 13 of the Agreement is hereby
amended by deleting clause (p)(i) contained therein and replacing it with the following: 
 (i) Financial Covenants of
PennyMac. PennyMac shall comply with the following financial covenants: (A) the ratio of PennyMac’s Total Indebtedness to its Adjusted Tangible Net Worth shall not at any time be greater than 10:1; (B) PennyMac and PMIT








 
Holdings shall maintain combined Liquidity at all times in an amount of not less than $7,500,000; (C) the Adjusted Tangible Net Worth of PennyMac shall at all times be greater than
$140,000,000; and (D) PennyMac’s consolidated net income shall be equal to or greater than $1.00 for at least one (1) of the previous two (2) consecutive fiscal quarters, as of the end of each fiscal quarter. 

(h) Section 13 of the Agreement is hereby amended by deleting clause (p)(iii) contained therein and replacing it with the following:

 (iii) Financial Covenants of Servicer. (A) Servicer’s Adjusted Tangible Net Worth shall at all times be
greater than or equal to $90,000,000; (B) Servicer’s unrestricted cash and Cash Equivalents shall at all times be greater than or equal to $6,375,000; (C) Servicer’s residential mortgage servicing portfolio shall at all times be
in excess of $5,000,000,000 in un-amortized principal balance of loans; (D) the ratio of Servicer’s Total Indebtedness, to Adjusted Tangible Net Worth shall at all times be less than 10:1; and (E) Servicer’s consolidated Net
Income shall be equal to or greater than $1.00 for each calendar quarter. 
 (i) Exhibit A of the Agreement is hereby amended by
deleting the Exhibit in its entirety and replacing it with Exhibit A attached hereto. 
 (j) Schedule 1 of the Agreement is
hereby amended by adding new clause (nn) directly after clause (mm) therein as follows: 
 (nn) With respect to any Loan sold to
Buyer by PMIT Holdings in any Transaction hereunder, which was originated in the state of Mississippi, such Loan was acquired by PMIT Holdings from PennyMac prior to becoming subject to any Transaction hereunder. 

SECTION 2. Fees and Expenses. Sellers agree to pay to Buyer all reasonable out of pocket costs and expenses incurred by Buyer
in connection with this Amendment Number Eight (including all reasonable fees and out of pocket costs and expenses of the Buyer’s legal counsel) in accordance with Sections 23 and 25 of the Agreement. 

SECTION 3. Representations. Each Seller and Servicer hereby represents to Buyer that as of the date hereof, the Seller
Parties are in full compliance with all of the terms and conditions of the Agreement and each other Program Document and no Default or Event of Default has occurred and is continuing under the Agreement or any other Program Document. 

SECTION 4. Binding Effect; Governing Law. This Amendment Number Eight shall be binding and inure to the benefit of the
parties hereto and their respective successors and permitted assigns. THIS AMENDMENT NUMBER EIGHT SHALL BE CONSTRUED IN ACCORDANCE WITH, AND GOVERNED BY, THE LAWS OF THE STATE OF NEW YORK, WITHOUT GIVING EFFECT TO THE CONFLICT OF LAWS PRINCIPLES
THEREOF (EXCEPT FOR SECTION 5-1401 OF THE NEW YORK GENERAL OBLIGATIONS LAW WHICH SHALL GOVERN). 
 SECTION 5.
Counterparts. This Amendment Number Eight may be executed by each of the parties hereto on any number of separate counterparts, each of which shall be an original and all of which taken together shall constitute one and the same instrument.

 SECTION 6. Limited Effect. Except as amended hereby, the Agreement shall continue in full force and effect in
accordance with its terms. Reference to this Amendment Number 







 
Eight need not be made in the Agreement or any other instrument or document executed in connection therewith, or in any certificate, letter or communication issued or made pursuant to, or with
respect to, the Agreement, any reference in any of such items to the Agreement being sufficient to refer to the Agreement as amended hereby. 
 [Signature Page Follows] 







 IN WITNESS WHEREOF, Sellers, Servicer and Buyer have caused this Amendment Number Eight to
be executed and delivered by their duly authorized officers as of the Amendment Effective Date. 
  

			
	PENNYMAC CORP.
	(Seller)
		
	By:	 	 /s/ Anne McCallion

	Name:	 	Anne D. McCallion
	Title:	 	Chief Financial Officer
	
	PENNYMAC MORTGAGE INVESTMENT TRUST HOLDINGS I, LLC
	(Seller)
		
	By:	 	 /s/ Anne McCallion

	Name:	 	Anne D. McCallion
	Title:	 	Chief Financial Officer
	
	PENNYMAC LOAN SERVICES, LLC,
	(Servicer)
		
	By:	 	 /s/ Anne McCallion

	Name:	 	Anne D. McCallion
	Title:	 	Vice President, Finance
	
	CITIBANK, N.A.
	(Buyer and Agent, as applicable)
		
	By:	 	 /s/ Susan Mills

	Name:	 	Susan Mills
	Title:	 	Vice President, Citibank, N.A.


 Acknowledged: 
  

			
	PENNYMAC MORTGAGE INVESTMENT TRUST
		
	By:	 	 /s/ Anne McCallion

	Name:	 	Anne D. McCallion
	Title:	 	Chief Financial Officer


  
 A-1-2









 EXHIBIT A 
 CERTIFICATION 
 In connection with (i) the Master Repurchase Agreement
dated as of December 9, 2010, as amended (the “Agreement”), among PennyMac Corp. (“PennyMac” or a “Seller”) and PennyMac Mortgage Investment Trust Holdings I, LLC (“PMIT Holdings” or a
“Seller”), PennyMac Loan Services, LLC (the “Servicer”) and Citibank, N.A. (“Buyer”) and (ii) the Guaranty Agreement, dated as of December 9, 2010 by PennyMac Mortgage Investment Trust
(“Guarantor”) in favor of Buyer, I ,             ,             of [PennyMac] [PMIT Holdings] [Servicer] [Guarantor], do
hereby certify that: 
  

	 	(i)	[            ] is in compliance with all provisions and terms of the Program Documents;


  

	 	(ii)	no Default has occurred under any Program Document and no Default exists as of the date hereof; 


 

	 	(iii)	[(A) The ratio of [            ]s Total Indebtedness to Adjusted Tangible Net Worth has at all times been
less than [    ]:1, (B) [    ]’s Liquidity has at all times been equal to not less than $[            ] (C) the Adjusted Tangible Net
Worth of [            ] has at all times exceeded $[            ], (D) the ratio of (i) the book value assigned to
[            ]’s servicing portfolio to (ii) (1) [            ]’s Adjusted Tangible Net Worth has at all
times been less than [    ]:1 and (2) [            ]’s Adjusted Tangible Net Worth has at all times been greater than
[$            ] (E) [    ]’s consolidated net income has been equal to or greater than $1.00 for at least one (1) of the previous two (2) consecutive
fiscal quarters, as of the end of the last fiscal quarter; and (F) The servicing multiple used in determining the book value of [            ] servicing portfolio in accordance with
GAAP for the previous month is equal to [    ].] 

  

	 	(iv)	[Servicer has at all times during the term of the Agreement remained an approved servicer in good standing to service mortgage loans for Fannie Mae and Freddie Mac; ]


  

	 	(v)	As at the end of [INSERT APPLICABLE MONTH/QUARTER/YEAR]: 

 (a) The Adjusted Tangible Net Worth of [            ] is $            ; 

(b) The ratio of [            ]’s Total Indebtedness to
its Adjusted Tangible Net Worth is             ; 

(c) The Liquidity of [            ] is
$            ; 
 (d) Attached as Schedule I hereto
are the calculations demonstrating [            ]’s compliance with the financial covenants of [            ] each as set
forth in Section 13(p) of the Agreement; 
 (e) Attached as Schedule II hereto is a list of any repurchase
agreements, loan and security agreements or similar credit facilities or agreements for borrowed funds entered into by [            ] and any third party that have been terminated in the
last thirty (30)

  
 A-1-3









 
Business Days or with respect to which the amount available for borrowing has been reduced; 
 (f) Attached as Schedule III hereto is a list of any repurchase agreements, loan and security agreements or similar credit facilities or agreements for borrowed funds entered into by
[            ] and any third party and shall include the size of such facilities and the related termination date of such facilities; 

(g) [            ] has received
            repurchase and indemnity requests from its third party investors during the previous calendar month. The aggregate amount of all repurchase and indemnity requests delivered to
Seller by its third party investors during the previous calendar month is $            ; 
 (h) The aggregate amount of all repurchase and indemnity claims paid by [            ] to its third party investors during the previous calendar
month is $            ; 
 (i) As of the date hereof,
the aggregate outstanding amount of all repurchase and indemnity obligations of [            ] to its third party investors is
$            ; 
 (j) The amount of Loan Loss
Reserves of [            ] is equal to $            . 
 Capitalized terms used but not defined herein shall have the meanings assigned thereto in the Agreement. 
 IN WITNESS WHEREOF, I have signed this certificate. 

Date:                    , 2010 

 

			
	[SELLER][SERVICER] [GUARANTOR]
		
	By:	 	  

	Name:	 	
	Title:	 	



  
 A-1-4









 SCHEDULE I 

  
 A-I-1









 SCHEDULE II 
  


									
	 NAME OF

LENDER
	 	 TYPE
	 	 PREVIOUS SIZE

($)
	 	 CURRENT

SIZE ($)
	 	 TERMINATION

DATE

		 		 		 		 	
		 		 		 		 	
		 		 		 		 	


  
 A-II-1









 SCHEDULE III 

 

									
	 NAME OF

LENDER
	 	 TYPE
	 	 CURRENT SIZE

($)
	 	 MAXIMUM

SIZE ($)
	 	 TERMINATION

DATE

		 		 		 		 	
		 		 		 		 	
		 		 		 		 	


  
 A-II-2