Exhibit 10.4

EXECUTION

AMENDED AND RESTATED GUARANTY

AMENDED AND RESTATED GUARANTY, dated as of April 28, 2017 (as amended,
supplemented, or otherwise modified from time to time, this “Guaranty”), made by
PennyMac Mortgage Investment Trust, a Maryland real estate investment trust (the
“Guarantor”), in favor of Credit Suisse First Boston Mortgage Capital, LLC (the
“Administrative Agent”) (for the benefit of Buyers).

RECITALS

WHEREAS, the Administrative Agent, Credit Suisse AG, a company incorporated in
Switzerland, acting through its Cayman Islands Branch (“CS Cayman” and a
“Buyer”), Alpine Securitization LTD (“Alpine” and a “Buyer”), PennyMac Operating
Partnership, L.P. (the “Seller”) and the Guarantor are entering into that
certain Second Amended and Restated Master Repurchase Agreement, dated as of
April 28, 2017, among PennyMac Operating Partnership, L.P. (the “Seller”), the
Guarantor and the Administrative Agent (as amended, restated, supplemented or
otherwise modified from time to time, the “Repurchase Agreement”), which amends
and restates that certain Amended and Restated Master Repurchase Agreement,
dated as of March 31, 2016;

WHEREAS, Guarantor previously entered into a Guaranty in favor of Administrative
Agent, as a buyer, dated September 28, 2012 (the “Existing Guaranty”);

WHEREAS, the parties hereto have requested that the Existing Guaranty be amended
and restated, in its entirety, on the terms and subject to the conditions set
forth herein;

WHEREAS, pursuant to that certain Assignment, Assumption and Appointment
Agreement, dated as of June 16, 2016 by and among Administrative Agent, CS
Cayman, as a buyer, and certain Buyers identified therein (as amended, restated,
supplemented, or otherwise modified from time to time, the “Assignment,
Assumption and Appointment Agreement”), Administrative Agent sold and assigned
its right, title and interest in the Transactions and the related Purchased
Mortgage Loans and Repurchase Assets hereunder to such Buyers and was retained
as Administrative Agent under the Repurchase Agreement;

WHEREAS, it is a condition precedent to the obligation of the Administrative
Agent on behalf of Buyers to continue the Transactions under the Repurchase
Agreement that Guarantor shall have executed and delivered this Guaranty to the
Administrative Agent for the benefit of Buyers;

 

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

 

NOW, THEREFORE, in consideration of the foregoing premises, to induce the
Administrative Agent and Buyers to enter into the Repurchase Agreement and to
enter into Transactions thereunder, the Guarantor hereby agrees with the
Administrative Agent and Buyers, as follows:

1.Defined Terms.

(a)Unless otherwise defined herein, capitalized terms which are defined in the
Repurchase Agreement and used herein shall have the respective meanings therein.

(b)For purposes of this Guaranty, “Obligations” shall mean all obligations and
liabilities of the Seller to the Administrative Agent and Buyers, whether direct
or indirect, absolute or contingent, due or to become due, or now existing or
hereafter incurred, which may arise under, or out of or in connection with the
Repurchase Agreement and any other Program Agreements and any other document
made, delivered or given in connection therewith or herewith, whether on account
of principal, interest, reimbursement obligations, fees, indemnities, costs,
expenses (including, without limitation, all fees and disbursements of counsel
to the Administrative Agent and Buyers that are required to be paid by Seller
pursuant to the terms of the Program Agreements and costs of enforcement of this
Guaranty) or otherwise.

2.Guaranty.

(a)The Guarantor hereby unconditionally and irrevocably guarantees to the
Administrative Agent and each Buyer the prompt and complete payment and
performance by the Seller when due (whether at the stated maturity, by
acceleration or otherwise) of the Obligations.

(b)The Guarantor shall pay additional amounts to, and indemnify, the
Administrative Agent and Buyers (including for purposes of this Section 2, any
assignee, successor or participant) with respect to Taxes (as defined in the
Repurchase Agreement) imposed on payments pursuant to this Guaranty to the same
extent as the Seller would have paid additional amounts and indemnified the
Administrative Agent and Buyers with respect to Taxes under Section 11(e) of the
Repurchase Agreement if the Guarantor were the Seller under the Repurchase
Agreement.  For the avoidance of doubt, any such payments are in addition to the
Guarantor's obligation to pay any amounts required to be paid by the Seller to
the Administrative Agent and Buyers.

(c)The Guarantor further agrees to pay any and all expenses (including, without
limitation, all fees and disbursements of counsel) which may be paid or incurred
by the Administrative Agent or a Buyer in enforcing, or obtaining advice of
counsel in respect of, any rights with respect to, or collecting, any or all of
the Obligations and/or enforcing any rights with respect to, or collecting
against, the Guarantor under this Guaranty.  This Guaranty shall remain in full
force and effect until the later of (i) the termination of the Repurchase
Agreement or (ii) the Obligations are paid in full, notwithstanding that from
time to time prior thereto the Seller may be free from any Obligations.

(d)No payment or payments made by the Seller or any other Person or received or
collected by the Administrative Agent or a Buyer from the Seller or any other
Person

- 2 -

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

 

by virtue of any action or proceeding or any set-off or appropriation or
application, at any time or from time to time, in reduction of or in payment of
the Obligations shall be deemed to modify, reduce, release or otherwise affect
the liability of Guarantor hereunder which shall, notwithstanding any such
payment or payments, remain liable for the amount of the Obligations until the
Obligations are paid in full.

(e)Guarantor agrees that whenever, at any time, or from time to time, the
Guarantor shall make any payment to the Administrative Agent or a Buyer on
account of the Guarantor’s liability hereunder, the Guarantor will notify the
Administrative Agent or such Buyer in writing that such payment is made under
this Guaranty for such purpose.

3.Right of Set-off.  The Administrative Agent is hereby irrevocably authorized
at any time and from time to time without notice to the Guarantor, any such
notice being hereby waived by the Guarantor, to set off and appropriate and
apply any and all monies and other property of the Guarantor, deposits (general
or special, time or demand, provisional or final), in any currency, and any
other credits, indebtedness or claims, in any currency, in each case whether
direct or indirect, absolute or contingent, matured or unmatured, at any time
held or owing by the Administrative Agent or any affiliate thereof to or for the
credit or the account of any the Guarantor, or any part thereof in such amounts
as the Administrative Agent may elect, on account of the Obligations and
liabilities of the Guarantor hereunder and claims of every nature and
description of the Administrative Agent against the Guarantor, in any currency,
whether arising hereunder, under the Repurchase Agreement or otherwise, as the
Administrative Agent may elect, whether or not the Administrative Agent has made
any demand for payment and although such Obligations and liabilities and claims
may be contingent or unmatured.  The Administrative Agent shall notify the
Guarantor promptly of any such set-off and the application made by the
Administrative Agent, provided that the failure to give such notice shall not
affect the validity of such set-off and application.  The rights of the
Administrative Agent under this paragraph are in addition to other rights and
remedies (including, without limitation, other rights of set-off) which the
Administrative Agent may have.

4.Subrogation.  Notwithstanding any payment or payments made by the Guarantor
hereunder or any set-off or application of funds of the Guarantor by the
Administrative Agent, the Guarantor shall not be entitled to be subrogated to
any of the rights of the Administrative Agent or Buyers against the Seller or
any other guarantor or any collateral security or guarantee or right of offset
held by the Administrative Agent or Buyers for the payment of the Obligations,
nor shall the Guarantor seek or be entitled to seek any contribution or
reimbursement from the Seller or any other guarantor in respect of payments made
by the Guarantor hereunder, until all amounts owing to the Administrative Agent
or Buyers by the Seller on account of the Obligations are paid in full and the
Repurchase Agreement is terminated.  If any amount shall be paid to the
Guarantor on account of such subrogation rights at any time when all of the
Obligations shall not have been paid in full, such amounts shall be held by the
Guarantor for the benefit of Administrative Agent, segregated from other funds
of the Guarantor, and shall, forthwith upon receipt by Guarantor, be turned over
to the Administrative Agent in the exact form received by the Guarantor (duly
indorsed by the Guarantor to the Administrative Agent, if required), to be
applied against the Obligations, whether matured or unmatured, in such order as
the Administrative Agent may determine.

- 3 -

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

 

5.Amendments, etc. with Respect to the Obligations.  The Guarantor shall remain
obligated hereunder notwithstanding that, without any reservation of rights
against the Guarantor, and without notice to or further assent by the Guarantor,
any demand for payment of any of the Obligations made by the Administrative
Agent may be rescinded by the Administrative Agent, and any of the Obligations
continued, and the Obligations, or the liability of any other party upon or for
any part thereof, or any collateral security or guarantee therefor or right of
offset with respect thereto, may, from time to time, in whole or in part, be
renewed, extended, amended, modified, accelerated, compromised, waived,
surrendered or released by the Administrative Agent or Buyers, and the
Repurchase Agreement, and the other Program Agreements and any other document in
connection therewith may be amended, modified, supplemented or terminated, in
whole or in part, pursuant to its terms and as the Administrative Agent may deem
advisable from time to time, and any collateral security, guarantee or right of
offset at any time held by the Administrative Agent for the payment of the
Obligations may be sold, exchanged, waived, surrendered or released.  The
Administrative Agent shall have no obligation to protect, secure, perfect or
insure any Lien at any time held by it as security for the Obligations or for
this Guaranty or any property subject thereto.  When making any demand hereunder
against the Guarantor, the Administrative Agent may, but shall be under no
obligation to, make a similar demand on the Seller or any other guarantor, and
any failure by the Administrative Agent to make any such demand or to collect
any payments from the Seller or any such other Guarantor or any release of the
Seller or such other guarantor shall not relieve the Guarantor of its
obligations or liabilities hereunder, and shall not impair or affect the rights
and remedies, express or implied, or as a matter of law, of the Administrative
Agent or Buyers against the Guarantor.  For the purposes hereof “demand” shall
include the commencement and continuance of any legal proceedings.

6.Guaranty Absolute and Unconditional.

(a)Guarantor waives any and all notice of the creation, renewal, extension or
accrual of any of the Obligations and notice of or proof of reliance by the
Administrative Agent upon this Guaranty or acceptance of this Guaranty; the
Obligations, and any of them, shall conclusively be deemed to have been created,
contracted or incurred, or renewed, extended, amended or waived in reliance upon
this Guaranty; and all dealings between the Seller or the Guarantor, on the one
hand, and the Administrative Agent on behalf of Buyers, on the other, shall
likewise be conclusively presumed to have been had or consummated in reliance
upon this Guaranty.  Guarantor waives diligence, presentment, protest, demand
for payment and notice of default or nonpayment to or upon the Seller or the
Guarantor with respect to the Obligations.  This Guaranty shall be construed as
a continuing, absolute and unconditional guarantee of payment without regard to
(i) the validity or enforceability of the Repurchase Agreement, the other
Program Agreements, any of the Obligations or any collateral security therefor
or guarantee or right of offset with respect thereto at any time or from time to
time held by the Administrative Agent, (ii) any defense, set-off or counterclaim
(other than a defense of payment or performance) which may at any time be
available to or be asserted by the Seller against the Administrative Agent or
Buyers, or (iii) any other circumstance whatsoever (with or without notice to or
knowledge of the Seller or the Guarantor) which constitutes, or might be
construed to constitute, an equitable or legal discharge of the Seller for the
Obligations, or of the Guarantor under this Guaranty, in bankruptcy or in any
other instance.  When pursuing its rights and

- 4 -

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

 

remedies hereunder against the Guarantor, the Administrative Agent may, but
shall be under no obligation, to pursue such rights and remedies that they may
have against the Seller or any other Person or against any collateral security
or guarantee for the Obligations or any right of offset with respect thereto,
and any failure by the Administrative Agent to pursue such other rights or
remedies or to collect any payments from the Seller or any such other Person or
to realize upon any such collateral security or guarantee or to exercise any
such right of offset, or any release of the Seller or any such other Person or
any such collateral security, guarantee or right of offset, shall not relieve
the Guarantor of any liability hereunder, and shall not impair or affect the
rights and remedies, whether express, implied or available as a matter of law,
of the Administrative Agent on behalf of Buyers against the Guarantor.  This
Guaranty shall remain in full force and effect and be binding in accordance with
and to the extent of its terms upon the Guarantor and their successors and
assigns thereof, and shall inure to the benefit of the Administrative Agent, the
Buyers and their respective successors, indorsees, transferees and assigns,
until all the Obligations and the obligations of the Guarantor under this
Guaranty shall have been satisfied by payment in full, notwithstanding that from
time to time during the term of the Repurchase Agreement the Seller may be free
from any Obligations.

(b)Without limiting the generality of the foregoing, Guarantor hereby agrees,
acknowledges, and represents and warrants to the Administrative Agent and Buyers
as follows:

(i)Guarantor hereby waives any defense arising by reason of, and any and all
right to assert against the Administrative Agent and Buyers any claim or defense
based upon, an election of remedies by the Administrative Agent and Buyers which
in any manner impairs, affects, reduces, releases, destroys and/or extinguishes
Guarantor’s subrogation rights, rights to proceed against the Seller or any
other guarantor for reimbursement or contribution, and/or any other rights of
Guarantor to proceed against the Seller, against any other guarantor, or against
any other person or security.

(ii)Guarantor is presently informed of the financial condition of the Seller and
of all other circumstances which diligent inquiry would reveal and which bear
upon the risk of nonpayment of the Obligations.  Guarantor hereby covenants that
it will make its own investigation and will continue to keep itself informed of
the Seller’s financial condition, the status of other guarantors, if any, of all
other circumstances which bear upon the risk of nonpayment and that it will
continue to rely upon sources other than the Administrative Agent for such
information and will not rely upon the Administrative Agent for any such
information.  Absent a written request for such information by the Guarantor to
the Administrative Agent, Guarantor hereby waives its right, if any, to require
the Administrative Agent to disclose to Guarantor any information which the
Administrative Agent may now or hereafter acquire concerning such condition or
circumstances including, but not limited to, the release of or revocation by any
other guarantor.

(iii)Guarantor has independently reviewed the Repurchase Agreement and related
agreements and has made an independent determination as to the validity and
enforceability thereof, and in executing and delivering this Guaranty to the
Administrative Agent, Guarantor is not in any manner relying upon the validity,
and/or

- 5 -

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

 

enforceability, and/or attachment, and/or perfection of any Liens or security
interests of any kind or nature granted by the Seller or any other guarantor to
the Administrative Agent, now or at any time and from time to time in the
future.

7.Reinstatement.  This Guaranty shall continue to be effective, or be
reinstated, as the case may be, if at any time payment, or any part thereof, of
any of the Obligations is rescinded or must otherwise be restored or returned by
the Administrative Agent upon the insolvency, bankruptcy, dissolution,
liquidation or reorganization of the Seller or upon or as a result of the
appointment of a receiver, intervenor or conservator of, or trustee or similar
officer for, the Seller or any substantial part of its property, or otherwise,
all as though such payments had not been made.

8.Payments.  Guarantor hereby agrees that the Obligations will be paid to the
Administrative Agent without set-off or counterclaim in U.S. Dollars.

9.Event of Default.  If an Event of Default under the Repurchase Agreement shall
have occurred and be continuing, the Guarantor agrees that, as between the
Guarantor and Administrative Agent, the Obligations may be declared to be due in
accordance with the terms of the Repurchase Agreement for purposes of this
Guaranty notwithstanding any stay, injunction or other prohibition which may
prevent, delay or vitiate any such declaration as against a Seller and that, in
the event of any such declaration (or attempted declaration), such Obligations
shall forthwith become due by the Guarantor for purposes of this Guaranty.

10.Severability.  Any provision of this Guaranty which is prohibited or
unenforceable in any jurisdiction shall, as to such jurisdiction, be ineffective
to the extent of such prohibition or unenforceability without invalidating the
remaining provisions hereof, and any such prohibition or unenforceability in any
jurisdiction shall not invalidate or render unenforceable such provision in any
other jurisdiction.

11.Headings.  The paragraph headings used in this Guaranty are for convenience
of reference only and are not to affect the construction hereof or be taken into
consideration in the interpretation hereof.

12.No Waiver; Cumulative Remedies.  The Administrative Agent shall not by any
act (except by a written instrument pursuant to paragraph 13 hereof), delay,
indulgence, omission or otherwise be deemed to have waived any right or remedy
hereunder or to have acquiesced in any Default or Event of Default or in any
breach of any of the terms and conditions hereof.  No failure to exercise, nor
any delay in exercising, on the part of the Administrative Agent, any right,
power or privilege hereunder shall operate as a waiver thereof.  No single or
partial exercise of any right, power or privilege hereunder shall preclude any
other or further exercise thereof or the exercise of any other right, power or
privilege.  A waiver by the Administrative Agent of any right or remedy
hereunder on any one occasion shall not be construed as a bar to any right or
remedy which the Administrative Agent would otherwise have on any future
occasion.  The rights and remedies herein provided are cumulative, may be
exercised singly or concurrently and are not exclusive of any rights or remedies
provided by law.

- 6 -

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

 

13.Waivers and Amendments; Successors and Assigns; Governing Law.  None of the
terms or provisions of this Guaranty may be waived, amended, supplemented or
otherwise modified except by a written instrument executed by the Guarantor and
the Administrative Agent, provided that any provision of this Guaranty may be
waived by the Administrative Agent in a letter or agreement executed by the
Administrative Agent or by facsimile or electronic transmission from the
Administrative Agent to Guarantor.  This Guaranty shall be binding upon the
personal representatives, successors and assigns of the Guarantor and shall
inure to the benefit of the Administrative Agent, Buyers and their respective
successors and assigns.  

14.Notices.  Notices delivered in connection with this Guaranty shall be given
in accordance with Section 20 of the Repurchase Agreement.

15.Jurisdiction.  

(a)THIS GUARANTY SHALL BE GOVERNED BY, AND CONSTRUED AND INTERPRETED IN
ACCORDANCE WITH, THE LAWS OF THE STATE OF NEW YORK.

(b)GUARANTOR HEREBY WAIVES TRIAL BY JURY.  GUARANTOR HEREBY IRREVOCABLY CONSENTS
TO THE EXCLUSIVE JURISDICTION OF ANY COURT OF THE STATE OF NEW YORK, OR IN THE
UNITED STATES DISTRICT COURT FOR THE SOUTHERN DISTRICT OF NEW YORK, ARISING OUT
OF OR RELATING TO THE PROGRAM AGREEMENTS IN ANY ACTION OR PROCEEDING.  GUARANTOR
HEREBY SUBMITS TO, AND WAIVES ANY OBJECTION IT MAY HAVE TO, EXCLUSIVE PERSONAL
JURISDICTION AND VENUE IN THE COURTS OF THE STATE OF NEW YORK AND THE UNITED
STATES DISTRICT COURT FOR THE SOUTHERN DISTRICT OF NEW YORK, WITH RESPECT TO ANY
DISPUTES ARISING OUT OF OR RELATING TO THE PROGRAM AGREEMENTS.

16.Integration.  This Guaranty represents the agreement of the Guarantor with
respect to the subject matter hereof and there are no promises or
representations by the Seller or Guarantor relative to the subject matter hereof
not reflected herein.

17.Acknowledgments.  Guarantor hereby acknowledges that:

(a)Guarantor has been advised by counsel in the negotiation, execution and
delivery of this Guaranty and the other Program Agreements;

(b)the Administrative Agent does not have any fiduciary relationship to the
Guarantor, the Guarantor does not have any fiduciary relationship to
Administrative Agent and the relationship between the Administrative Agent,
Buyers and the Guarantor is solely that of surety and creditor; and

(c)no joint venture exists between the Administrative Agent, Buyers and the
Guarantor or among the Administrative Agent, Buyers, the Seller and the
Guarantor.

- 7 -

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

 

18.Intent.  This Guaranty is intended to constitute a security agreement or
other arrangement or other credit enhancement related to the Repurchase
Agreement and Transactions thereunder as defined under Sections 101(47)(A)(v)
and 741(7)(A)(xi) of the Bankruptcy Code.

19.Amendment and Restatement.  The Guarantor entered into the Existing Guaranty
in favor of Administrative Agent, as a buyer. The Guarantor desires to enter
into this Guaranty in order to amend and restate the Existing Guaranty in its
entirety.  The amendment and restatement of the Existing Guaranty shall become
effective on the date hereof, and the Guarantor shall hereafter be bound by the
terms and conditions of this Guaranty and the other Program Agreements, as
applicable. This Guaranty amends and restates the terms and conditions of the
Existing Guaranty, and is not a novation of any of the agreements or obligations
incurred pursuant to the terms of the Existing Guaranty. Accordingly, all of the
agreements and obligations incurred pursuant to the terms of the Existing
Guaranty are hereby ratified and affirmed by the parties hereto and remain in
full force and effect.  All references to the Existing Guaranty in any Program
Agreement or other document or instrument delivered in connection therewith
shall be deemed to refer to this Guaranty and the provisions hereof.

20.Buyers as Intended Beneficiaries. The Administrative Agent and Guarantor
hereby agree that the Buyers are intended third party beneficiaries of all
provisions of this Guaranty.

 

[SIGNATURES COMMENCE ON THE FOLLOWING PAGE]

 

 

- 8 -

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

 

IN WITNESS WHEREOF, the undersigned has caused this Guaranty to be duly executed
and delivered as of the date first above written.

PENNYMAC MORTGAGE INVESTMENT TRUST, as the Guarantor

 

 

By:

/s/ Pamela Marsh

 

Name: Pamela Marsh

 

Title: Managing Director, Treasurer

 

Signature Page to the Amended and Restated Guaranty