EX-10 5 qh5exh104.htm EX 10.4

                                                                                EXECUTION COPY

DATE:                                          May 30, 2007
TO:                                            Deutsche Bank Trust Company Americas, not in its individual capacity
                                               but solely as Supplemental Interest Trust Trustee for the benefit of
                                               RALI Series 2007-QH5 Supplemental Interest Trust, acting on behalf of
                                               the Class A Certificateholders and Class M Certificateholders under the
                                               Pooling and Servicing Agreement identified below ("PARTY A")

ATTENTION:                                     RALI Series 2007-QH5

FROM:                                          Deutsche Bank Trust Company Americas, not in its individual capacity
                                               but solely as Supplemental Interest Trust Trustee for the benefit of
                                               RALI Series 2007-QH5 Supplemental Interest Trust, acting on behalf of
                                               the Class SB Certificateholders under the Pooling and Servicing
                                               Agreement identified below ("PARTY B")

SUBJECT:                                       Payment Swap Confirmation and Agreement
REFERENCE NUMBER
The  purpose  of  this  letter  agreement  (the  "Agreement")  is to  confirm  the  terms  and
conditions  of  the  Transaction   entered  into  on  the  Trade  Date  specified  below  (the
"Transaction")  between Party A and Party B. This  Agreement,  which  evidences a complete and
binding  agreement  between  you and us to enter into the  Transaction  on the terms set forth
below,  constitutes  a  "Confirmation"  as referred to in the ISDA Form Master  Agreement  (as
defined below), as well as a "Schedule" as referred to in the ISDA Form Master Agreement.

1.      This  Agreement  is  subject  to and  incorporates  the  2000  ISDA  Definitions  (the
"Definitions"),  as published by the  International  Swaps and Derivatives  Association,  Inc.
("ISDA").  You and we have  agreed  to enter  into this  Agreement  in lieu of  negotiating  a
Schedule to the 1992 ISDA Master Agreement  (Multicurrency-Cross  Border) form (the "ISDA Form
Master  Agreement")  but,  rather,  an ISDA Form Master Agreement shall be deemed to have been
executed  by you and us on the date we  entered  into  the  Transaction.  In the  event of any
inconsistency  between the provisions of this  Agreement and the  Definitions or the ISDA Form
Master  Agreement,  this Agreement shall prevail for purposes of the  Transaction.  Terms used
and not otherwise  defined herein,  in the ISDA Form Master Agreement or the Definitions shall
have the meanings assigned to them in the series supplement (the "Series  Supplement"),  dated
as of May 1, 2007, to the standard terms of pooling and servicing  agreement,  dated as of May
1, 2007 (the  "Standard  Terms",  and together  with the Series  Supplement,  the "Pooling and
Servicing  Agreement"),  among  Residential  Accredit Loans,  Inc., as depositor,  Residential
Funding  Company,  LLC, as master  servicer,  and Deutsche  Bank Trust  Company  Americas,  as
trustee and  supplemental  interest  trust  trustee.  Each  reference  to a "Section"  or to a
"Section" "of this  Agreement"  will be construed as a reference to a Section of the 1992 ISDA
Form Master  Agreement.  Each  capitalized  term used herein that is not defined  herein or in
the 1992 ISDA Form  Master  Agreement  shall  have the  meaning  defined  in the  Pooling  and
Servicing  Agreement.  Notwithstanding  anything herein to the contrary,  should any provision
of this  Agreement  conflict with any provision of the Pooling and  Servicing  Agreement,  the
provision of the Pooling and Servicing Agreement shall apply.

2.      The terms of the  particular  Transaction  to which this  Confirmation  relates are as
follows:

            Trade Date:
            Effective Date:
            Termination Date:                             June 25, 2037 subject to adjustment  in accordance  with the Business
                                                          Day Convention.
            Business Days:                                California, Minnesota, Texas, New York, Illinois.
            Business Day Convention:                      Following.
            PARTY A PAYMENTS:
            Party A Payment Dates:                        Each Distribution Date under the Pooling and Servicing Agreement.

            Party A Payment Amounts:                      On each  Party A  Payment  Date,  the  amount,  if any,  equal to the
                                                          aggregate amount of Net Swap Payments and Swap  Termination  Payments
                                                          owed to the Swap  Counterparty  remaining unpaid after application of
                                                          the sum of (A) from the REMIC I Available  Distribution  Amount (less
                                                          the  amount  distributable  on such  Distribution  Date in respect of
                                                          REMIC IV Regular  Interest IO) that would have remained had the REMIC
                                                          I Available  Distribution  Amount (less the amount  distributable  on
                                                          such  Distribution  Date in respect of REMIC IV Regular  Interest IO)
                                                          been applied on such  Distribution Date to make the distributions for
                                                          such  Distribution  Date under  Section 4.02(c)  clauses  (i) through
                                                          (ix) of the Pooling and Servicing  Agreement,  the sum of (I) Accrued
                                                          Certificate  Interest on the Class SB  Certificates,  (II) the amount
                                                          of any  Overcollateralization  Reduction  Amount  and  (III) for each
                                                          Distribution  Date after the  Certificate  Principal  Balance of each
                                                          Class of  Class A  Certificates  and  Class M  Certificates  has been
                                                          reduced  to  zero,  the   Overcollateralization   Amount,   (B)  from
                                                          prepayment  charges  on  deposit  in  the  Certificate   Amount,  any
                                                          prepayment  charges received on the Mortgage Loans during the related
                                                          Prepayment   Period  and  (C)  the  amount   distributable   on  such
                                                          Distribution Date in respect of the REMIC IV Regular Interest IO.
            PARTY B PAYMENTS:
            Party B Payment Dates:                        Each Distribution Date under the Pooling and Servicing Agreement

            Party B Payment Amounts:                      On each Party B Payment  Date,  an amount  equal to the lesser of (a)
                                                          the  Available  Distribution  Amount  remaining on such  Distribution
                                                          Date  after  the   distributions  on  such  Distribution  Date  under
                                                          Section 4.02(c)   clauses  (i)  through   (v)  of  the  Pooling  and
                                                          Servicing   Agreement  and  (b) the   aggregate   unpaid  Basis  Risk
                                                          Shortfalls  allocated  to  the  Class A  Certificateholders  and  the
                                                          Class M Certificateholders for such Distribution Date.

3.      Additional  Provisions:  Each party hereto is hereby advised and acknowledges that the
other  party  has  engaged  in  (or  refrained   from  engaging  in)   substantial   financial
transactions  and has taken (or  refrained  from taking)  other  material  actions in reliance
upon the  entry by the  parties  into the  Transaction  being  entered  into on the  terms and
conditions  set  forth  herein  and in  the  ISDA  Form  Master  Agreement  relating  to  such
Transaction, as applicable.

4.      Provisions Deemed Incorporated in a Schedule to the ISDA Form Master Agreement:

1)      Termination Provisions. For purposes of the ISDA Form Master Agreement:

(a)     "Specified Entity" is not applicable to Party A or Party B for any purpose.

(b)     "Specified  Transaction" is not applicable to Party A or Party B for any purpose, and,
               accordingly, Section 5(a)(v) shall not apply to Party A or Party B.

(c)     The  "Cross  Default"  provisions  of Section  5(a)(vi)  shall not apply to Party A or
               Party B.

(d)     The "Credit Event Upon Merger"  provisions of Section 5(b)(iv) will not apply to Party
               A or Party B.

(e)     With  respect  to  Party  A  and  Party  B,  the  "Bankruptcy"  provision  of  Section
               5(a)(vii)(2) of the ISDA Form Master Agreement will be deleted in its entirety.

(f)     The "Automatic Early Termination"  provision of Section 6(a) will not apply to Party A
               or to Party B.

(g)     Payments  on Early  Termination.  For the  purpose  of  Section  6(e) of the ISDA Form
               Master Agreement:

(i)     Market Quotation will apply.

(ii)    The Second Method will apply.

(h)     "Termination Currency" means United States Dollars.

(i)     The provisions of Sections  5(a)(ii),  5(a)(iii) and 5(a)(iv) shall not apply to Party
               A or Party B.

(j)     Tax Event.  The provisions of Section  2(d)(i)(4) and 2(d)(ii) of the ISDA Form Master
               Agreement  shall not apply to Party A and Party A shall not be  required to pay
               any additional amounts referred to therein.

2)      Tax Representations.

(a)     Payer  Representations.  For the  purpose  of  Section  3(e) of the ISDA  Form  Master
               Agreement, each of Party A and Party B will make the following representations:

                             It is not required by any  applicable  law, as modified by
                             the   practice  of  any  relevant   governmental   revenue
                             authority,  of  any  Relevant  Jurisdiction  to  make  any
                             deduction  or  withholding  for or on  account  of any Tax
                             from  any  payment  (other  than  interest  under  Section
                             2(e),   6(d)(ii)   or  6(e)  of  the  ISDA   Form   Master
                             Agreement)  to be  made  by it to the  other  party  under
                             this  Agreement.  In making  this  representation,  it may
                             rely on:

(i)     the accuracy of any  representations  made by the other party pursuant to Section 3(f)
                      of the ISDA Form Master Agreement;

(ii)    the  satisfaction of the agreement  contained in Sections  4(a)(i) or 4(a)(iii) of the
                      ISDA Form Master  Agreement  and the accuracy and  effectiveness  of any
                      document  provided  by the other party  pursuant to Sections  4(a)(i) or
                      4(a)(iii) of the ISDA Form Master Agreement; and

(iii)   the  satisfaction of the agreement of the other party contained in Section 4(d) of the
                      ISDA Form Master  Agreement,  provided  that it shall not be a breach of
                      this  representation  where  reliance  is placed on clause  (ii) and the
                      other party does not deliver a form or document under Section  4(a)(iii)
                      by reason of material prejudice to its legal or commercial position.

(b)     Payee  Representations.  For the  purpose  of  Section  3(f) of the ISDA  Form  Master
               Agreement, Party A and Party B make the following representations: None

3)      Documents to be Delivered.  For the purpose of Section 4(a) (i) and 4(a) (iii):

(1)     Tax forms, documents, or certificates to be delivered are:

PARTY REQUIRED TO DELIVER    FORM/DOCUMENT/                               DATE BY WHICH TO
DOCUMENT                     CERTIFICATE                                  BE DELIVERED
Party A and Party B          Any documents required or                    Promptly after the earlier of (i) reasonable demand
                             reasonably requested to allow                by either party or (ii) actual knowledge that such
                             the other party to make payments             form or document is required
                             under this Agreement without any
                             deduction or withholding for or
                             on the account of any Tax or
                             with such deduction or
                             withholding at a reduced rate

(2)     Other documents to be delivered are:

PARTY REQUIRED                   FORM/DOCUMENT/                           DATE BY WHICH TO BE        COVERED BY
TO DELIVER                       CERTIFICATE                              DELIVERED                  SECTION 3(D)
DOCUMENT                                                                                             REPRESENTATION
Party A and Party B              Any documents required by the            Upon execution and         Yes
                                 receiving party to evidence the          delivery of this
                                 authority of the delivering party for    Agreement and such
                                 it to execute and deliver this           Confirmation
                                 Agreement, any Confirmation to which
                                 it is a party, and to evidence the
                                 authority of the delivering party to
                                 perform its obligations under this
                                 Agreement and such Confirmation.
Party A and Party B              A certificate of an authorized officer   Upon the execution and     Yes
                                 of the party, as to the incumbency and   delivery of this
                                 authority of the respective officers     Agreement and such
                                 of the party signing this Agreement      Confirmation

4)      Miscellaneous.  Miscellaneous

(a)     Address for Notices: For the purposes of Section 12(a) of this Agreement:

                             Address for notices or communications to Party A:

        Address:                    RALI Series 2007-QH5 Trust,
                                    acting through Deutsche Bank Trust Company Americas
                                    not in its individual capacity
                                    but solely in its capacity as
                                    Supplemental Interest Trust
                                    Trustee for the benefit of the
                                    RALI Series 2007-QH5 Supplemental Interest Trust
                                    Attn:   RALI Series 2007-QH5 Trust
                                    Fax:    714-247-6285

        with a copy to:             Residential Funding Company, LLC
                                    8400 Normandale Lake Blvd., Suite 600
                                    Minneapolis, MN 55437
        Attention:                  Michael Scarseth
        Facsimile:                  952-921-9133

        (For all purposes)

        Address for notices or communications to Party B:
        Address:                    RALI Series 2007-QH5 Trust,
                                    acting through Deutsche Bank Trust Company Americas
                                    not in its individual capacity
                                    but solely in its capacity as
                                    Supplemental Interest Trust Trustee for the benefit of the
                                    RALI Series 2007-QH5 Supplemental Interest Trust
                                    Attn:   RALI Series 2007-QH5 Trust
                                    Fax:    714-247-6285

        with a copy to:             Residential Funding Company, LLC
                                    8400 Normandale Lake Blvd., Suite 600
                                    Minneapolis, MN 55437
        Attention:                  Michael Scarseth
        Facsimile No.:              952-921-9133

        (For all purposes)

(b)     Process Agent. For the purpose of Section 13(c):

               Party A:                                Not Applicable
               Party B:                                Not Applicable

(c)     Offices.  The  provisions of Section 10(a) will not apply to this  Agreement;  neither
               Party A nor Party B have any  Offices  other  than as set forth in the  Notices
               Section.

(d)     Multibranch  Party.  For  the  purpose  of  Section  10(c)  of the  ISDA  Form  Master
               Agreement, neither Party A nor Party B is a Multibranch. Party.

(e)     Calculation Agent. The Calculation Agent is Party B.

(f)     Credit Support Document.

                             Not Applicable

(g)     Credit Support Provider.

                             Not Applicable

(h)     Governing  Law.  The parties to this ISDA  Agreement  hereby agree that the law of the
               State of New York  shall  govern  their  rights  and  duties in whole,  without
               regard to the conflict of law  provision  thereof,  other than New York General
               Obligations Law Sections 5-1401 and 5-1402.

(i)     Non-Petition.  Party A and Party B each hereby irrevocably and unconditionally  agrees
               that it will not  institute  against,  or join any other person in  instituting
               against or cause any other  person to institute  against  RALI Series  2007-QH5
               Trust, Mortgage  Asset-Backed  Pass-Through  Certificates,  Series 2007-QH5, or
               the other party any bankruptcy,  reorganization,  arrangement,  insolvency,  or
               similar  proceeding  under  the  laws  of  the  United  States,  or  any  other
               jurisdiction  for the  non-payment  of any  amount due  hereunder  or any other
               reason until the payment in full of the  Certificates  and the  expiration of a
               period of one year plus ten days (or,  if  longer,  the  applicable  preference
               period) following such payment.

(j)     Severability.  If any term, provision,  covenant,  or condition of this Agreement,  or
               the  application  thereof  to any  party or  circumstance,  shall be held to be
               invalid or  unenforceable  (in whole or in part) for any reason,  the remaining
               terms,  provisions,  covenants,  and  conditions  hereof shall continue in full
               force and effect as if this  Agreement  had been  executed  with the invalid or
               unenforceable  portion  eliminated,  so long as this  Agreement  as so modified
               continues to express,  without material change, the original  intentions of the
               parties as to the subject  matter of this  Agreement  and the  deletion of such
               portion  of  this  Agreement  will  not  substantially  impair  the  respective
               benefits or expectations of the parties.

                      The  parties  shall  endeavor  to engage in good faith  negotiations  to
               replace any invalid or  unenforceable  term,  provision,  covenant or condition
               with a valid  or  enforceable  term,  provision,  covenant  or  condition,  the
               economic  effect of which  comes as close as possible to that of the invalid or
               unenforceable term, provision, covenant or condition.

(k)     Consent to Recording.  Each party hereto  consents to the monitoring or recording,  at
               any  time  and  from  time  to  time,  by  the  other  party  of  any  and  all
               communications  between  officers  or  employees  of the  parties,  waives  any
               further  notice of such  monitoring  or  recording,  and  agrees to notify  its
               officers and employees of such monitoring or recording.

(l)     Waiver of Jury Trial.  Each party to this Agreement  respectively  waives any right it
               may have to a trial by jury in  respect  of any  Proceedings  relating  to this
               Agreement or any Credit Support Document.

(m)     Set-Off  Notwithstanding  any  provision of this  Agreement  or any other  existing or
               future agreement,  each party irrevocably waives any and all rights it may have
               to set off, net, recoup or otherwise  withhold or suspend or condition  payment
               or  performance  of any  obligation  between it and the other  party  hereunder
               against  any  obligation  between  it and  the  other  party  under  any  other
               agreements.  The  provisions  for Set-off set forth in Section 6(e) of the ISDA
               Form Master Agreement shall not apply for purposes of this Transaction.

(n)     This Agreement may be executed in several counterparts,  each of which shall be deemed
               an  original  but all of  which  together  shall  constitute  one and the  same
               instrument.

(o)     Supplemental Interest Trust Trustee Liability Limitations.  It is expressly understood
               and agreed by the  parties  hereto  that (a) this  Agreement  is  executed  and
               delivered  by  Deutsche  Bank  Trust  Company  Americas,  not  individually  or
               personally  but solely as  Supplemental  Interest  Trust Trustee of Party A and
               Party B, in the exercise of the powers and  authority  conferred  and vested in
               it and that Deutsche Bank Trust Company  Americas  shall perform its duties and
               obligations  hereunder  in  accordance  with the  standard of care set forth in
               Article  VIII  of  the  Pooling  and  Servicing  Agreement,  (b)  each  of  the
               representations,  undertakings and agreements  herein made on the part of Party
               A  and  Party  B  is  made  and  intended  not  as  personal   representations,
               undertakings  and  agreements by Deutsche  Bank Trust  Company  Americas but is
               made and  intended  for the  purpose of  binding  only Party A and Party B, (c)
               nothing  herein  contained  shall be  construed  as creating  any  liability on
               Deutsche Bank Trust Company  Americas,  individually or personally,  to perform
               any covenant either expressed or implied contained herein,  all such liability,
               if  any,  being  expressly  waived  by the  parties  hereto  and by any  Person
               claiming  by,  through or under the parties  hereto;  provided  that nothing in
               this  paragraph  shall  relieve  Deutsche  Bank  Trust  Company  Americas  from
               performing  its duties and  obligations  hereunder  and under the  Pooling  and
               Servicing  Agreement in accordance with the standard of care set forth therein,
               and (d) under no  circumstances  shall Deutsche Bank Trust Company  Americas be
               personally  liable for the payment of any  indebtedness  or expenses of Party A
               or  Party  B or be  liable  for  the  breach  or  failure  of  any  obligation,
               representation,  warranty or covenant  made or undertaken by Party A or Party B
               under this Agreement or any other related documents;  provided, that nothing in
               this  paragraph  shall  relieve  Deutsche  Bank  Trust  Company  Americas  from
               performing  its duties and  obligations  hereunder  and under the  Pooling  and
               Servicing  Agreement in  accordance  with the standard of care set forth herein
               and therein.

5)      "Affiliate".  Party A and  Party B shall be  deemed  to not have  any  Affiliates  for
        purposes of this Agreement, including for purposes of Section 6(b)(ii).

6)      Section 3 of the ISDA Form  Master  Agreement  is hereby  amended by adding at the end
        thereof the following subsection (g):

                             "(g)   Relationship Between Parties.

        Each party  represents  to the other  party on each date when it enters  into a
        Transaction that:--

(1)     Nonreliance.  (i) It is not relying on any  statement or  representation  of the other
party  regarding the Transaction  (whether  written or oral),  other than the  representations
expressly made in this Agreement or the  Confirmation in respect of that  Transaction and (ii)
it has consulted with its own legal,  regulatory,  tax,  business,  investment,  financial and
accounting  advisors  to the  extent  it  has  deemed  necessary,  and it  has  made  its  own
investment,  hedging and trading  decisions  based upon its own  judgment  and upon any advice
from such  advisors as it has deemed  necessary  and not upon any view  expressed by the other
party.

(2)     Evaluation and Understanding.

(i)     It has the  capacity  to  evaluate  (internally  or through  independent  professional
advice) the  Transaction  and has made its own decision to enter into the  Transaction and has
been directed by the Pooling and Servicing Agreement to enter into this Transaction; and

(ii)    It understands  the terms,  conditions and risks of the Transaction and is willing and
able to accept  those  terms  and  conditions  and to  assume  those  risks,  financially  and
otherwise.

(3)     Purpose.  It is  entering  into the  Transaction  for the  purposes  of  managing  its
borrowings or  investments,  hedging its  underlying  assets or  liabilities  or in connection
with a line of business.

(4)     Status of Parties.  The other party is not acting as agent,  fiduciary  or advisor for
it in respect of the Transaction.

(5)     Eligible  Contract  Participant.  It is an "eligible swap participant" as such term is
defined in Section  35.1(b)(2) of the  regulations  (17 C.F.R 35)  promulgated  under,  and it
constitutes an "eligible  contract  participant"  as such term is defined in Section 1(a)12 of
the Commodity Exchange Act, as amended."

7)      Account Details and Settlement Information:

                      PAYMENTS TO PARTY A:
                      Deutsche Bank Trust Company Americas
                      ABA Number: 021-001-003
                      Account Number: 01419663
                      Account Name: NYLTD Funds Control - Stars West
                      Ref: RALI 2007-QH5 Swap
                      PAYMENTS TO PARTY B:
                      Deutsche Bank Trust Company Americas
                      ABA Number: 021-001-003
                      Account Number: 01419663
                      Account Name: NYLTD Funds Control - Stars West
                      Ref: RALI 2007-QH5 Swap
Please sign and return to us a copy of this Agreement.

                                            Very truly yours,
                                            DEUTSCHE BANK TRUST COMPANY AMERICAS, not in its
                                            individual capacity but solely as Supplemental
                                            Interest Trust Trustee for the benefit of RALI
                                            Series 2007-QH5 Supplemental Interest Trust,
                                            acting on behalf of the Class SB
                                            Certificateholders

                                            By:           /s/ Amy Stoddard
                                                   Name:  Amy Stoddard
                                                   Title: Authorized Signer

                                            AGREED AND ACCEPTED AS OF THE TRADE DATE
                                            DEUTSCHE BANK TRUST COMPANY AMERICAS, not in its
                                            individual capacity but solely as Supplemental
                                            Interest Trust Trustee for the benefit of RALI
                                            Series 2007-QH5 Supplemental Interest Trust,
                                            acting on behalf of the Class A
                                            Certificateholders and Class M Certificateholders

                                            By:           /s/ Amy Stoddard
                                                   Name:  Amy Stoddard
                                                   Title: Authorized Signer