EX-10.17



 Exhibit 10.17 
 EXECUTION VERSION 
 AMENDMENT NUMBER FOUR 

to the 
 Master
Repurchase Agreement 
 Dated as of November 2, 2010 
 among 
 PENNYMAC CORP. 

PENNYMAC MORTGAGE INVESTMENT TRUST HOLDINGS I, LLC 
 and 
 WELLS FARGO BANK, NATIONAL ASSOCIATION 

This AMENDMENT NUMBER FOUR is made this 28th day of December, 2012, by and among PENNYMAC CORP., a Delaware corporation, PENNYMAC
MORTGAGE INVESTMENT TRUST HOLDINGS I, LLC, a Delaware limited liability company (each a “Seller” and collectively the “Sellers”) and WELLS FARGO BANK, NATIONAL ASSOCIATION (“Buyer”), to the Master
Repurchase Agreement, dated as of November 2, 2010, by and among Sellers and Buyer (as amended, restated, supplemented or otherwise modified from time to time, the “Agreement”). 

WHEREAS, Sellers have requested that Buyer amend the Agreement to modify the definitions of Maturity Date and Maximum Aggregate Purchase
Price and the distribution of Income thereunder; and 
 WHEREAS, Sellers and Buyer have agreed to amend the Agreement as set
forth herein. 
 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 28, 2012 (the “Amendment Effective Date”), the Agreement is hereby amended as follows: 
 (a) The definitions of “Maturity Date” and “Maximum Aggregate Purchase Price” in Article 2 of the Agreement are hereby amended and restated in their entirety to read as follows:

 “Maturity Date”: The earliest of (a) March 29, 2013; (b) any Accelerated Repurchase
Date and (c) any date on which the Maturity Date shall otherwise occur in accordance with the Repurchase Documents or Requirements of Law. 
 “Maximum Aggregate Purchase Price”: An amount equal to $50,000,000. 
 SECTION 2. Defined Terms. Any terms capitalized but not otherwise defined herein should have the respective meanings set forth in the Agreement. 

SECTION 3. Condition Precedent. It is a condition precedent to the effectiveness of this Amendment Number Four and that certain
Amendment Number Three to the Fee and Pricing Letter, dated as of November 2, 2010, by and among Buyer and Sellers, that Buyer shall have received payment of an extension fee in an amount equal to $31,250 in








 
immediately available funds. The extension fee is deemed to be due, earned and payable as of the Amendment Effective Date and shall be non-refundable when paid. 

SECTION 4. 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 Four 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. 

SECTION 5. Representations. In order to induce Buyer to execute and deliver this Amendment Number Four, Sellers hereby represent
to Buyer that as of the date hereof, Sellers are in full compliance with all of the terms and conditions of the Agreement, including without limitation, all of the representations and warranties and all of the affirmative and negative covenants, and
no Default or Event of Default has occurred and is continuing under the Agreement. 
 SECTION 6. Fees and Expenses.
Sellers agree to pay to Buyer all reasonable fees and out of pocket expenses incurred by Buyer in connection with this Amendment Number Four (including all reasonable fees and out of pocket costs and expenses of Buyer’s legal counsel incurred
in connection with this Amendment Number Four) pursuant to Section 13.02 of the Agreement. 
 SECTION 7. Governing
Law. This Amendment Number Four and any claim, controversy or dispute arising under or related to or in connection with this Amendment Number Four, the relationship of the parties, and/or the interpretation and enforcement of the rights and
duties of the parties will be governed by the laws of the State of New York without regard to any conflicts of law principles other than Sections 5-1401 and 5-1402 of the New York General Obligations Law, which shall govern. 

SECTION 8. Counterparts. This Amendment Number Four may be executed in two (2) or more counterparts, each of which shall be
deemed an original but all of which together shall constitute but one and the same agreement. This Amendment Number Four, to the extent signed and delivered by facsimile or other electronic means, shall be treated in all manner and respects as an
original agreement and shall be considered to have the same binding legal effect as if it were the original signed version thereof delivered in person. No signatory to this Amendment Number Four shall raise the use of a facsimile machine or other
electronic means to deliver a signature or the fact that any signature or agreement was transmitted or communicated through the use of a facsimile machine or other electronic means as a defense to the formation or enforceability of a contract and
each such Person forever waives any such defense. 
 [SIGNATURE PAGES FOLLOWS] 







 IN WITNESS WHEREOF, Sellers and Buyer have caused this Amendment Number Four to be executed
and delivered by their duly authorized officers as of the Amendment Effective Date. 
 WELLS FARGO BANK, NATIONAL 

ASSOCIATION, as Buyer 
 By: /s/ Allen Sampson

 Name: Allen Sampson 
 Title: Vice
President 
 [Additional Signature Page Follows] 







 PENNYMAC CORP., as a Seller 
 By: /s/ Pamela Marsh 
 Its: Pamela Marsh 
 Title: Managing Director, Treasurer 
 PENNYMAC MORTGAGE
INVESTMENT 
 TRUST HOLDINGS I, LLC, as a Seller 
 By: /s/ Pamela Marsh 
 Its: Pamela Marsh 
 Title: Managing Director, Treasurer