Exhibit 10.168

EXECUTION

AMENDMENT NO. 2

TO MASTER REPURCHASE AGREEMENT

Amendment No. 2 to Master Repurchase Agreement, dated as of March 29, 2016 (this
“Amendment”), by and among Bank of America, N.A. (“Buyer”), PennyMac Operating
Partnership, L.P. (“Seller”) and PennyMac Mortgage Investment Trust
(“Guarantor”).

RECITALS

Buyer, Seller and Guarantor are parties to that certain Master Repurchase
Agreement, dated as of July 9, 2014 (as amended, restated, supplemented or
otherwise modified from time to time, the “Existing Master Repurchase
Agreement”; as amended by this Amendment, the “Master Repurchase Agreement”).
The Guarantor is a party to that certain Guaranty, dated as of July 9, 2014 (as
amended, restated, supplemented or otherwise modified from time to time, the
“Guaranty”), made by Guarantor in favor of Buyer.

Buyer, Seller and Guarantor have agreed, subject to the terms and conditions of
this Amendment, that the Existing Master Repurchase Agreement be amended to
reflect certain agreed upon revisions to the terms of the Existing Master
Repurchase Agreement. As a condition precedent to amending the Existing Master
Repurchase Agreement, Buyer has required Guarantor to ratify and affirm the
Guaranty on the date hereof.

Accordingly, Buyer, Seller and Guarantor hereby agree, in consideration of the
mutual promises and mutual obligations set forth herein, that the Existing
Master Repurchase Agreement is hereby amended as follows:

SECTION 1. Definitions. Section 2 of the Existing Master Repurchase Agreement is
hereby amended by:

1.1 deleting the definitions of “Mortgage File” and “Mortgage Loan” in their
entirety and replacing them with the following:

“Mortgage File” means, with respect to a Mortgage Loan, the documents and
instruments relating to such Mortgage Loan and set forth in Exhibit 12 to the
Custodial Agreement.

“Mortgage Loan” means any mortgage loan of a Type identified on any schedule
attached to the Transactions Terms Letter, which mortgage loan may be either a
Dry Loan or a Wet Mortgage Loan which is a fixed or floating rate, one to four
family residential mortgage loan evidenced by a promissory note and secured by a
mortgage, which satisfies the requirements set forth in (a) the Underwriting
Guidelines and (b) Section 13(b) hereof; provided, however, that, except as
expressly approved in writing by Buyer, Mortgage Loans shall not include any
High Cost Mortgage Loans.

--------------------------------------------------------------------------------

1.2 adding the following definition in its proper alphabetical order:

“TILA-RESPA Integrated Disclosure Rule” means the Truth-in-Lending Act and Real
Estate Settlement Procedures Act Integrated Disclosure Rule, adopted by the
Consumer Financial Protection Bureau, which is effective for residential
mortgage loan applications received on or after October 3, 2015.

SECTION 2. Events of Default. Section 15 of the Existing Master Repurchase
Agreement is hereby amended by:

2.1 deleting subsection (u)(iii) in its entirety and replacing it with the
following:

(iii) (A) Any Person shall engage in any “prohibited transaction” (as defined in
Section 406 of ERISA or Section 4975 of the Code) involving any Plan, (B) a
determination that a Plan is “at risk” (within the meaning of Section 303 of
ERISA) or any Lien in favor of the PBGC or a Plan shall arise on the assets of
Seller or any ERISA Affiliate, (C) a Reportable Event shall occur with respect
to, or proceedings shall commence to have a trustee appointed, or a trustee
shall be appointed, to administer or to terminate, any Plan, which Reportable
Event or commencement of proceedings or appointment of a trustee is, in the
reasonable opinion of Buyer, likely to result in the termination of such Plan
for purposes of Title IV of ERISA, (D) Seller, Underlying Repurchase
Counterparty, Guarantor or any ERISA Affiliate shall file an application for a
minimum funding waiver under section 302 of ERISA or section 412 of the Code
with respect to any Plan, (E) any obligation for post-retirement medical costs
(other than as required by COBRA) exists, or (F) any other event or condition
shall occur or exist with respect to a Plan; and in each case in clauses
(A) through (F) above, such event or condition, together with all other such
events or conditions, if any, could reasonably be expected to have a Material
Adverse Effect or (G) the assets of Seller, Underlying Repurchase Counterparty,
Guarantor, any Subsidiary of Seller, Underlying Repurchase Counterparty or
Guarantor, or any ERISA Affiliate become plan assets within the meaning of 29
CFR 2510.3-101 as modified by section 3(42) of ERISA.

2.2 adding the following new subsection:

(v) Settlements. Seller has, without the express written consent of Buyer,
entered into any settlement with, or consented to the issuance of a consent
order by, any Governmental Authority in which the fines, penalties, settlement
amounts or any other amounts owed by Seller thereunder exceeds $5,000,000 in the
aggregate.

SECTION 3. Reports. Section 17 of the Existing Master Repurchase Agreement is
hereby amended by deleting subsection (a)(3) in its entirety and replacing it
with the following:

(3) as soon as available and in any event within ninety (90) days after the end
of each fiscal year of Guarantor and Underlying Repurchase Counterparty, the
consolidated balance sheets of Guarantor and its consolidated Subsidiaries and
the balance sheet of the Underlying Repurchase Counterparty, each as at the end
of such fiscal year and the related consolidated statements of income and
retained earnings and of

 

2

--------------------------------------------------------------------------------

cash flows for Guarantor and its consolidated Subsidiaries and Underlying
Repurchase Counterparty for such year, setting forth in each case in comparative
form the figures for the previous year, accompanied by an unqualified opinion
thereon of independent certified public accountants of recognized national
standing, which opinion and the scope of audit shall be acceptable to Buyer in
its sole discretion, shall have no “going concern” qualification and shall state
that said consolidated financial statements or financial statements, as
applicable, fairly present the consolidated financial condition or financial
condition, as applicable, and results of operations of Guarantor and its
respective consolidated Subsidiaries or Underlying Repurchase Counterparty, as
applicable, as at the end of, and for, such fiscal year in accordance with GAAP;

SECTION 4. Notice Information. Section 20 of the Existing Master Repurchase
Agreement is hereby amended by deleting the notice information for Buyer, Seller
and Guarantor in its entirety and replacing it with the following:

If to Seller:

PennyMac Operating Partnership, L.P.

3043 Townsgate Road

Westlake Village, California 91361

Attention: Pamela Marsh/Kevin Chamberlain

Phone Number: (805) 330-6059/(818) 746-2877

E-mail: pamela.marsh@pnmac.com; kevin.chamberlain@pnmac.com

If to Guarantor:

PennyMac Mortgage Investment Trust

3043 Townsgate Road

Westlake Village, California 91361

Attention: Pamela Marsh/Kevin Chamberlain

Phone Number: (805) 330-6059/(818) 746-2877

E-mail: pamela.marsh@pnmac.com; kevin.chamberlain@pnmac.com

If to Buyer:

Bank of America, N.A.

31303 Agoura Road

Mail Code: CA6-917-02-63

Westlake Village, California 91361

Attention: Adam Gadsby, Managing Director

Telephone: (818) 225-6541

Facsimile: (213) 457-8707

Email: Adam.Gadsby@baml.com

With copies to:

Bank of America, N.A.

 

3

--------------------------------------------------------------------------------

One Bryant Park, 11th Floor

Mail Code: NY1-100-11-01

New York, New York 10036

Attention: Eileen Albus, Director, Mortgage Finance

Telephone: (646) 855-0946

Facsimile: (646) 855-5050

Email: Eileen.Albus@baml.com

Bank of America, N.A.

One Bryant Park

Mail Code: NY1-100-17-01

New York, New York 10036

Attention: Amie Davis, Assistant General Counsel

Telephone: (646) 855-0183

Fax: (704) 409-0337

E-mail: Amie.Davis@bankofamerica.com

SECTION 5. Periodic Due Diligence Review. Section 35 of the Existing Repurchase
Agreement is hereby amended by deleting such section in its entirety and
replacing it with the following:

 

  35. Periodic Due Diligence Review

Seller acknowledges that Buyer has the right to perform continuing due diligence
reviews with respect to Seller and the Mortgage Loans, for purposes of verifying
compliance with the representations, warranties and specifications made
hereunder, or otherwise, and Seller agrees that upon reasonable (but no less
than one (1) Business Day’s) prior notice unless an Event of Default shall have
occurred, in which case no notice is required, to Seller, Buyer or its
authorized representatives will be permitted during normal business hours to
examine, inspect, and make copies and extracts of, the Mortgage Files and any
and all documents, records, agreements, instruments or information relating to
such Mortgage Loans in the possession or under the control of Seller and/or
Custodian. Seller also shall make available to Buyer a knowledgeable financial
or accounting officer for the purpose of answering questions respecting the
Mortgage Files and the Mortgage Loans. Without limiting the generality of the
foregoing, Seller acknowledges that Buyer may purchase Mortgage Loans from
Seller based solely upon the information provided by Seller to Buyer in the
Asset Data Record and the representations, warranties and covenants contained
herein, and that Buyer, at its option, has the right at any time to conduct a
partial or complete due diligence review on some or all of the Mortgage Loans
purchased in a Transaction, including, without limitation, ordering Broker’s
price opinions, new credit reports and new appraisals on the related Mortgaged
Properties and otherwise re-generating the information used to originate such
Mortgage Loan. Buyer may underwrite such Mortgage Loans itself or engage a third
party underwriter, approved by Buyer in its sole discretion, to perform such
underwriting. Seller agrees to cooperate with Buyer and any third party
underwriter in connection with

 

4

--------------------------------------------------------------------------------

such underwriting, including, but not limited to, providing Buyer and any third
party underwriter with access to any and all documents, records, agreements,
instruments or information relating to such Mortgage Loans in the possession, or
under the control, of Seller. Seller further agrees that Seller shall pay all
out-of-pocket costs and expenses incurred by Buyer in connection with Buyer’s
activities pursuant to this Section 35 (“Due Diligence Costs”); provided that
such Due Diligence Costs shall be subject to the Due Diligence Cap per calendar
year. For the avoidance of doubt, the Due Diligence Cap shall apply solely to
costs incurred by Buyer in connection with its due diligence of Seller and
Guarantor in connection with the extension of the Effective Date and Buyer’s
review of the Mortgage Files, credit files and servicing files related to
Purchased Mortgage Loans prior to the Effective Date. Such Due Diligence Cap
shall not apply to the extent Buyer requests the review of additional Purchased
Mortgage Loans or if a Default or Event of Default shall have occurred, in which
case Buyer shall have the right to perform due diligence, at the sole expense of
Seller without regard to the Due Diligence Cap.

SECTION 6. Representations and Warranties. Schedule 1 to the Existing Master
Repurchase Agreement is hereby amended by:

6.1 adding the following paragraph at the beginning of such schedule:

Representations and Warranties Concerning Purchased Mortgage Loans. Seller
represents and warrants to and covenants with Buyer that the following are true
and correct with respect to each Purchased Mortgage Loan as of the related
Purchase Date through and until the date on which such Purchased Mortgage Loan
is repurchased by Seller. With respect to those representations and warranties
which are made to the best of Seller’s knowledge, if it is discovered by Seller
or Buyer that the substance of such representation and warranty is inaccurate,
notwithstanding Seller’s lack of knowledge with respect to the substance of such
representation and warranty, such inaccuracy shall be deemed a breach of the
applicable representation and warranty.

6.2 adding the following new clause:

(kkk) TRID Compliance. To the extent applicable, effective with respect to
applications taken on or after October 3, 2015, each Mortgage Loan was
originated in compliance with the Consumer Financial Protection Bureau’s
TILA-RESPA Integrated Disclosure Rule.

SECTION 7. Fees and Expenses. Seller hereby agrees to pay to Buyer, on demand,
any and all reasonable fees, costs and expenses (including reasonable fees and
expenses of counsel) incurred by Buyer in connection with the development,
preparation and execution of this Amendment, irrespective of whether any
transactions hereunder are executed.

SECTION 8. Conditions Precedent. This Amendment shall become effective as of the
date hereof, upon Buyer’s receipt of this Amendment, executed and delivered by a
duly authorized officer of Buyer, Seller and Guarantor.

 

5

--------------------------------------------------------------------------------

SECTION 9. Limited Effect. Except as expressly amended and modified by this
Amendment, the Existing Master Repurchase Agreement shall continue to be, and
shall remain, in full force and effect in accordance with its terms.

SECTION 10. Counterparts. This Amendment 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 11. 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 12. GOVERNING LAW. THIS AMENDMENT AND THE RIGHTS AND OBLIGATIONS OF THE
PARTIES HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE WITH, AND GOVERNED BY, THE
LAW OF THE STATE OF NEW YORK, WITHOUT GIVING EFFECT TO THE CONFLICT OF LAWS
PRINCIPLES THEREOF.

SECTION 13. Reaffirmation of Guaranty. The Guarantor hereby (i) agrees that the
liability of Guarantor or rights of Buyer under the Guaranty shall not be
affected as a result of this Amendment, (ii) ratifies and affirms all of the
terms, covenants, conditions and obligations of the Guaranty and
(iii) acknowledges and agrees that such Guaranty is and shall continue to be in
full force and effect.

[SIGNATURE PAGE FOLLOWS]

 

6

--------------------------------------------------------------------------------

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.

 

BANK OF AMERICA, N.A., as Buyer By:   /s/ Adam Robitshek   Name: Adam Robitshek
  Title: Vice President PENNYMAC OPERATING PARTNERSHIP, L.P., as Seller By:
PennyMac GP OP, Inc., its General Partner By:   /s/ Pamela Marsh   Name: Pamela
Marsh   Title: Managing Director, Treasurer PENNYMAC MORTGAGE INVESTMENT TRUST,
as Guarantor By:   /s/ Pamela Marsh   Name: Pamela Marsh   Title: Managing
Director, Treasurer

Signature Page to Amendment No. 2 to Master Repurchase Agreement