EX-10 5 qs4confirm104.htm EX 10.4

                                                                                                 Dated:  April 19, 2006

                                                 RATE CAP TRANSACTION

                                              RE: BNY REFERENCE NO. 37715

Ladies and Gentlemen:

         The purpose of this letter  agreement  ("AGREEMENT")  is to confirm the terms and  conditions  of the rate cap
Transaction  entered into on the Trade Date specified below (the  "Transaction")  between The Bank of New York ("BNY"),
a trust  company duly  organized  and existing  under the laws of the State of New York and Deutsche Bank Trust Company
Americas,  not  individually,  but solely as Trustee on behalf of RALI Series  2006-QS4  Trust,  Mortgage  Asset-Backed
Pass-Through  Certificates,  Series  2006-QS4 (the  "COUNTERPARTY").  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.       FORM OF AGREEMENT.  This Agreement is subject to 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").  An ISDA Form Master Agreement,  as modified by the Schedule terms in Section 4 of this
Confirmation  (the  "MASTER  AGREEMENT"),  shall be deemed to have been  executed  by you and us on the date we entered
into the  Transaction.  Each party hereto agrees that the Master  Agreement deemed to have been executed by the parties
hereto  shall be the same  Master  Agreement  referred  to in the  agreement  setting  forth the  terms of  transaction
reference  numbers  37716.  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.
Capitalized  terms not otherwise  defined herein or in the  Definitions or the Master  Agreement shall have the meaning
defined  for such term in the  Series  Supplement,  dated as of April 1, 2006,  to the  Standard  Terms of Pooling  and
Servicing Agreement, dated as of March 1, 2006 (together the "Pooling and Servicing Agreement").

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

         Type of Transaction:               Rate Cap

         Notional Amount:                   With respect to any Calculation Period the amount set forth for such
                                            period on Schedule I attached hereto.

         Trade Date:                        April 19, 2006

         Effective Date:                    April 27, 2006

         Termination Date:                  November 25, 2013, subject to adjustment in accordance with the
                                            Modified Following Business Day Convention.

     FIXED AMOUNTS:

         Fixed Amount Payer:                Counterparty

         Fixed Amount:                      USD 420,000.00

         Fixed Amount
         Payment Date:                      April 27, 2006 subject to adjustment in accordance with the Following
                                            Business Day Convention.

     FLOATING AMOUNTS:

         Floating Rate Payer:               BNY

         Cap Rate:                          5.25%

         Floating Rate Payer
                  Period End Dates:         The 25th calendar day of each month during the Term of this
                                            Transaction, commencing May 25, 2006 and ending on the Termination
                                            Date, subject to adjustment in accordance with the Modified Following
                                            Business Day Convention.

         Floating Rate Payer
                  Payment Dates:            Early Payment shall be applicable. The Floating Rate Payer Payment
                                            Date shall be two (2) Business Days preceding each Floating Rate Payer
                                            Period End Date.

         Floating Rate Option:              USD-LIBOR-BBA; provided, however, if the Floating Rate determined from
                                            such Floating Rate Option for a Calculation Period is greater than
                                            9.00% then the Floating Rate for such Calculation Period shall be
                                            deemed equal to 9.00%.

         Designated Maturity:               One month


         Floating Rate Day
         Count Fraction:                    30/360

         Reset Dates:                       The first day of each Calculation Period

         Compounding:                       Inapplicable

         Business Days:                     New York


         Calculation Agent:                 BNY

3.       ADDITIONAL PROVISIONS:

         RELIANCE.  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.

4.       PROVISIONS DEEMED INCORPORATED IN A SCHEDULE TO THE MASTER AGREEMENT:

1)       NO NETTING  BETWEEN  TRANSACTIONS.  The parties  agree that  subparagraph  (ii) of Section 2(c) of the ISDA
                  Form Master Agreement will apply to any Transaction.

         2)       TERMINATION  PROVISIONS.  Subject to the provisions of Paragraph  4(11) below,  for purposes of the
                  Master Agreement:

                  (a)      "SPECIFIED ENTITY" is not applicable to BNY or Counterparty for any purpose.

                  (b)      "BREACH OF AGREEMENT" provision of Section 5(a)(ii) will not apply to BNY or Counterparty.

                  (c)      "CREDIT  SUPPORT  DEFAULT"  provisions  of  Section  5(a)(iii)  will  not  apply to BNY or
                           Counterparty.

                  (d)      "MISREPRESENTATION" provisions of Section 5(a)(iv) will not apply to BNY or Counterparty.

                  (e)      "DEFAULT UNDER SPECIFIED  TRANSACTION"  is not applicable to BNY or  Counterparty  for any
                           purpose, and, accordingly, Section 5(a)(v) shall not apply to BNY or Counterparty.

                  (f)      The  "CROSS  DEFAULT"  provisions  of  Section  5(a)(vi)  will  not  apply  to  BNY  or to
                           Counterparty.

                  (g)      The "BANKRUPTCY" provisions of Section 5(a)(vii)(2) will not apply to Counterparty.

                  (h)      The "CREDIT  EVENT UPON MERGER"  provisions  of Section  5(b)(iv) will not apply to BNY or
                           Counterparty.

                  (i)      The "AUTOMATIC  EARLY  TERMINATION"  provision of Section 6(a) will not apply to BNY or to
                           Counterparty.

                  (j)      PAYMENTS ON EARLY TERMINATION.  For the purpose of Section 6(e) of this Agreement:

                           (i)      Market Quotation will apply.

                           (ii)     The Second Method will apply.

                  (k)      "TERMINATION CURRENCY" means United States Dollars.

         3)       TAX REPRESENTATIONS.

                  (a)      PAYER  REPRESENTATIONS.  For the  purpose  of  Section  3(e) of  this  Agreement,  BNY and
                           Counterparty 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 this  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 this Agreement;

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

                           (iii)    the  satisfaction  of the agreement of the other party  contained in Section 4(d)
                                    of this 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 of its
                                    legal or commercial position.

                  (b)      PAYEE REPRESENTATIONS. For the purpose of Section 3(f) of this Agreement, BNY and
                           Counterparty make the following representations.

                           (i)      The following representation will apply to BNY:

                                    (x) It is a "U.S. person" (as that term is used in section  1.1441-4(a)(3)(ii) of
                                    the United States  Treasury  Regulations)  for United States  federal  income tax
                                    purposes,  (y) it is a trust company duly  organized and existing  under the laws
                                    of the  State of New York,  and (y) its U.S.  taxpayer  identification  number is
                                    135160382.

                           (ii)     The following representation will apply to the Counterparty:

                                    The beneficial owner of payments made to it under this Agreement is a "U.S.
                                    person" (as that term is used in section 1.1441-4(a)(3)(ii) of United States
                                    Treasury Regulations) for United States federal income tax purposes.

         4)       DOCUMENTS TO BE DELIVERED.  FOR THE PURPOSE OF SECTION 4(A):

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

PARTY REQUIRED TO DELIVER                                                                          COVERED BY SECTION 3(D)
DOCUMENT                     FORM/DOCUMENT/ CERTIFICATE                      DATE BY WHICH TO BE   REPRESENTATION
                                                                             DELIVERED
BNY and Counterparty  Any document required or reasonably requested to         Upon the execution and         Yes
                      allow the other party to make payments under this        delivery of this Agreement
                      Agreement without any deduction or withholding for
                      or on the account of any tax.

                  (b)      Other documents to be delivered are:

PARTY REQUIRED TO DELIVER      FORM/DOCUMENT/ CERTIFICATE                  DATE BY WHICH TO BE     COVERED BY SECTION 3(D)
DOCUMENT                                                                   DELIVERED               REPRESENTATION
BNY                   A certificate of an authorized officer of the party,     Upon the execution and         Yes
                      as to the incumbency and authority of the respective     delivery of this Agreement
                      officers of the party signing this Agreement, any
                      relevant Credit Support Document, or any Confirmation,
                      as the case may be
Counterparty          (i) a copy of the executed Pooling and Servicing         Upon the execution and         Yes
                      Agreement, and (ii) an incumbency certificate            delivery of this Agreement.
                      verifying the true signatures and authority of the
                      person or persons signing this letter agreement on
                      behalf of the Counterparty
BNY                   A copy of the most recent publicly available             Promptly after request by      Yes
                      regulatory call report.                                  the other party
BNY                   Legal Opinion as to enforceability of this Agreement     Upon the execution and         Yes
                                                                               delivery of this Agreement.
Counterparty          Certified copy of the Board of Directors resolution      Upon the execution and         Yes
                      (or equivalent authorizing documentation) which sets     delivery of this Agreement.
                      forth the authority of each signatory to the
                      Confirmation signing on its behalf and the authority
                      of such party to enter into Transactions contemplated
                      and performance of its obligations hereunder.

         5)  MISCELLANEOUS.

                  (a)      ADDRESS FOR NOTICES:  For the purposes of Section 12(a) of this Agreement:

                           Address for notices or communications to BNY:

                                    The Bank of New York
                                    Swaps and Derivative Products Group
                                    Global Market Division
                                    32 Old Slip 15th Floor
                                    New York, New York 10286
                                    Attention: Steve Lawler

                                    with a copy to:

                                    The Bank of New York
                                    Swaps and Derivative Products Group
                                    32 Old Slip 16th Floor
                                    New York, New York 10286
                                    Attention: Andrew Schwartz
                                    Tele: 212-804-5103
                                    Fax: 212-804-5818/5837

                                    (For all purposes)

                           Address for notices or communications to the Counterparty:

                                    Deutsche Bank Trust Company Americas
                                    Attn: Trust Administration-
                                    RALI 2006-QS4
                                    1761 East St. Andrew Place
                                    Santa Ana, CA 92705

                                    With a copy to:
                                    Residential Funding Corporation
                                    8400 Normandale Lake Blvd,
                                    Suite 600
                                    Minneapolis, MN 55437
                                    Attn: Rory Bluhm

                                    (For all purposes)

                  (b)      PROCESS AGENT.  For the purpose of Section 13(c):

                           BNY appoints as its Process Agent: Not Applicable

                           The Counterparty appoints as its Process Agent:      Not Applicable

                  (c)      OFFICES.  The  provisions of Section 10(a) will not apply to this  Agreement;  neither BNY
                           nor the  Counterparty  have any Offices other than as set forth in the Notices Section and
                           BNY agrees that,  for purposes of Section 6(b) of this  Agreement,  it shall not in future
                           have any Office other than one in the United States.

                  (d)      MULTIBRANCH PARTY.  For the purpose of Section 10(c) of this Agreement:

                                    BNY is not a Multibranch Party.

                                    The Counterparty is not a Multibranch Party.

                  (e)      CALCULATION AGENT.  The Calculation Agent is BNY.

                  (f)      CREDIT SUPPORT DOCUMENT.           Not applicable for either BNY or the Counterparty.

                  (g)      CREDIT SUPPORT PROVIDER.

                                    BNY:                      Not Applicable

                                    The Counterparty:Not Applicable

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

                  (i)      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.

                  (j)      RECORDING  OF  CONVERSATIONS.  Each  party (i)  consents  to the  recording  of  telephone
                           conversations  between the trading,  marketing and other relevant personnel of the parties
                           in connection with this Agreement or any potential Transaction,  (ii) agrees to obtain any
                           necessary  consent of, and give any  necessary  notice of such  recording to, its relevant
                           personnel and (iii) agrees,  to the extent  permitted by applicable  law, that  recordings
                           may be submitted in evidence in any Proceedings.

                  (k)      WAIVER  OF JURY  TRIAL.  Each  party  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.

                  (l)      [RESERVED].

                  (m)      LIMITATION ON INSTITUTION OF BANKRUPTCY  PROCEEDINGS.  BNY shall not institute  against or
                           cause any other  person to  institute  against,  or join any other  person in  instituting
                           against the  Counterparty,  any  bankruptcy,  reorganization,  arrangement,  insolvency or
                           liquidation  proceedings,  under  any of  the  laws  of the  United  States  or any  other
                           jurisdiction,  for a  period  of one  year  and one day (or,  if  longer,  the  applicable
                           preference period) following indefeasible payment in full of the Certificates.

                  (n)      REMEDY OF FAILURE TO PAY OR DELIVER.  The ISDA Form Master  Agreement in hereby amended as
                           follows:

                           The word  "third"  shall be  replaced  by the word  "second"  in the third line of Section
                           5(a)(i) of the ISDA Form Master Agreement.

                  (o)      "AFFILIATE"  will  have the  meaning  specified  in  Section  14 of the ISDA  Form  Master
                           Agreement,  provided that the Counterparty  shall be deemed not to have any Affiliates for
                           purposes of this Agreement, including for purposes of Section 6(b)(ii).

         6)       ADDITIONAL  REPRESENTATIONS.  Section 3 of the ISDA Form  Master  Agreement  is hereby  amended  by
                  adding,  before the close parenthesis in the introductory  sentence  thereof,  the words ", and, in
                  the case of the  representations  in Section  3(i),  at all times",  and, at the end  thereof,  the
                  following Sections 3(g), 3(h) and 3(i):

                  (g)     RELATIONSHIP BETWEEN PARTIES.

                           (1)      NONRELIANCE.  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.

                           (2)      EVALUATION AND UNDERSTANDING.

                                    (i)     It is  acting  for its own  account  and 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, in the
                                            case of Deutsche  Bank Trust Company  Americas,  it has entered into this
                                            Agreement  pursuant  to  direction  received  by it under the Pooling and
                                            Servicing Agreement;  it is not relying on any communication  (written or
                                            oral) of the other party as investment  advice or as a recommendation  to
                                            enter into such  transaction;  it being  understood that  information and
                                            explanations  related  to the terms and  conditions  of such  transaction
                                            shall not be considered  investment  advice or a recommendation  to enter
                                            into  such  transaction.  No  communication  (written  or oral)  received
                                            from the other party shall be deemed to be an  assurance  or guarantee as
                                            to the expected results of the 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
                                            (and does, in fact assume) those risks, financially and otherwise.

                           (3)      PRINCIPAL.  The other party is not acting as a fiduciary  or an advisor for it in
                                    respect of this Transaction.

                  (h)      EXCLUSION  FROM  COMMODITIES  EXCHANGE ACT. (A) It is an "eligible  contract  participant"
                           within the meaning of Section 1a(12) of the Commodity  Exchange Act, as amended;  (B) this
                           Agreement and each  Transaction is subject to individual  negotiation  by such party;  and
                           (C) neither this  Agreement nor any  Transaction  will be executed or traded on a "trading
                           facility" within the meaning of Section 1a(33) of the Commodity Exchange Act, as amended.

                  (i)      ERISA.  (PENSION PLANS).  It is not a pension plan or employee benefits plan and it is not
                           using assets of any such plan or assets  deemed to be assets of such a plan in  connection
                           with this Transaction.

         7)       SET-OFF.  Notwithstanding  any  provision  of  this  Agreement  or any  other  existing  or  future
                  agreement  (but  without  limiting  the  provisions  of  Section  2(c) and  Section 6 of the Master
                  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 last  sentence  of the first  paragraph  of  Section  6(e) of the ISDA Form
                  Master Agreement shall not apply for purposes of this Transaction.

         8)       ADDITIONAL TERMINATION EVENTS.  The following Additional Termination Events will apply:
                  (i)      DOWNGRADE.  BNY fails to comply with the  Downgrade  Provisions  as set forth in Paragraph
                  4(9).  BNY shall be the sole Affected Party.


         9)       RATINGS DOWNGRADE.  For purposes of each Transaction:

                  (i)      CERTAIN DEFINITIONS.

                           (A)      "RATING AGENCY CONDITION"  means, with respect to any particular  proposed act or
                           omission  to  act   hereunder,   that  the  Trustee  shall  have  received  prior  written
                           confirmation from each of the applicable  Rating Agencies,  and shall have provided notice
                           thereof to BNY,  that the  proposed  action or  inaction  would not cause a  downgrade  or
                           withdrawal of their then-current ratings of the Certificates.

                           (B)      "QUALIFYING  RATINGS"  means,  with  respect  to  the  debt  of any  assignee  or
                           guarantor under Paragraph 4(9)(ii) below,

                                    (x)     a short-term  unsecured and  unsubordinated  debt rating of "P-1" (not on
                                    watch for downgrade),  and a long-term  unsecured and unsubordinated debt of "A1"
                                    (not  on  watch  for  downgrade)  (or,  if it has  no  short-term  unsecured  and
                                    unsubordinated  debt  rating,  a long  term  rating  of "Aa3"  (not on watch  for
                                    downgrade) by Moody's, and

                                    (y)     a short-term  unsecured and  unsubordinated  debt rating of "A-1" by S&P,
                                    and

                                    (z)     a short-term unsecured and unsubordinated debt rating of "F-1" by Fitch.

                           (C)      A  "COLLATERALIZATION  EVENT" shall occur with respect to BNY (or any  applicable
                           credit support provider) if:

                                    (x)     its  short-term  unsecured and  unsubordinated  debt rating is reduced to
                                    "P-1" (and is on watch for downgrade) or below,  and its long-term  unsecured and
                                    unsubordinated  debt is reduced to "A1" (and is on watch for  downgrade) or below
                                    (or, if it has no short-term  unsecured and unsubordinated  debt rating, its long
                                    term  rating is  reduced to "Aa3"  (and is on watch for  downgrade)  or below) by
                                    Moody's, or

                                    (y)     its  short-term  unsecured  and  unsubordinated  debt  rating is  reduced
                                    below "A-1" by S&P; or

                                    (z)     its  short-term  unsecured  and  unsubordinated  debt  rating is  reduced
                                    below "F-1" by Fitch.

                           (D)      A "RATINGS  EVENT"  shall  occur with  respect to BNY (or any  applicable  credit
                           support provider) if:

                                    (x)     its short-term  unsecured and unsubordinated  debt rating is withdrawn or
                                    reduced  to  "P-2"  or  below  by  Moody's  and  its   long-term   unsecured  and
                                    unsubordinated  debt is  reduced to "A3" or below  (or,  if it has no  short-term
                                    unsecured  and  unsubordinated  debt  rating,  its long term rating is reduced to
                                    "A2" or below) by Moody's, or

                                    (y)     its long-term  unsecured and  unsubordinated  debt rating is withdrawn or
                                    reduced below "BBB-" by S&P, or

                                    (y)     its long-term  unsecured and  unsubordinated  debt rating is withdrawn or
                                    reduced below "BBB-" by Fitch.

                           For purposes of (C) and (D) above,  such events include those occurring in connection with
                           a merger,  consolidation  or other similar  transaction  by BNY or any  applicable  credit
                           support  provider,  but they shall be deemed not to occur if,  within 30 days (or,  in the
                           case of a Ratings Event,  10 Business  Days)  thereafter,  each of the  applicable  Rating
                           Agencies has reconfirmed  the ratings of the  Certificates,  as applicable,  which were in
                           effect  immediately  prior thereto.  For the avoidance of doubt, a downgrade of the rating
                           on the Certificates could occur in the event that BNY does not post sufficient collateral.

                  (ii)     ACTIONS TO BE TAKEN UPON OCCURRENCE OF EVENT.  Subject,  in each case set forth in (A) and
                  (B) below, to satisfaction of the Rating Agency Condition:

                           (A)      COLLATERALIZATION  EVENT.  If a  Collateralization  Event  occurs with respect to
                           BNY (or any  applicable  credit  support  provider),  then BNY shall,  at its own expense,
                           within thirty (30) days of such Collateralization Ratings Event:

                                    (1)     post collateral  under agreements and other  instruments  approved by the
                                    Counterparty,  such  approval  not to be  unreasonably  withheld,  which  will be
                                    sufficient to restore the immediately prior ratings of the Certificates,

                                    (2)     assign  the  Transaction  to a third  party,  the  ratings of the debt of
                                    which (or of the guarantor of which) meet or exceed the  Qualifying  Ratings,  on
                                    terms substantially similar to this Confirmation,  which party is approved by the
                                    Counterparty, such approval not to be unreasonably withheld,

                                    (3)     obtain a guaranty of, or a contingent  agreement of, another person,  the
                                    ratings of the debt of which (or of the  guarantor  of which)  meet or exceed the
                                    Qualifying  Ratings,  to honor BNY's obligations  under this Agreement,  provided
                                    that such other person is approved by the  Counterparty,  such approval not to be
                                    unreasonably withheld, or

                                    (4)     establish  any  other  arrangement  approved  by the  Counterparty,  such
                                    approval not to be  unreasonably  withheld,  which will be  sufficient to restore
                                    the immediately prior ratings of their Certificates.

                           (B)      RATINGS  EVENT.  If a Ratings Event occurs with respect to BNY (or any applicable
                           credit support  provider),  then BNY shall,  at its own expense,  within ten (10) Business
                           Days of such Ratings Event:

                                    (1)     assign  the  Transaction  to a third  party,  the  ratings of the debt of
                                    which (or of the guarantor of which) meet or exceed the  Qualifying  Ratings,  on
                                    terms substantially similar to this Confirmation,  which party is approved by the
                                    Counterparty, such approval not to be unreasonably withheld,

                                    (2)     obtain a guaranty of, or a contingent  agreement of, another person,  the
                                    ratings of the debt of which (or of the  guarantor  of which)  meet or exceed the
                                    Qualifying  Ratings,  to honor BNY's obligations  under this Agreement,  provided
                                    that such other person is approved by the  Counterparty,  such approval not to be
                                    unreasonably withheld, or

                                    (3)     establish  any  other  arrangement  approved  by the  Counterparty,  such
                                    approval not to be  unreasonably  withheld,  which will be  sufficient to restore
                                    the immediately prior ratings of the Certificates.



         10)      COMPLIANCE  WITH  REGULATION AB. It shall be a disclosure  event  ("DISCLOSURE  EVENT") if, on any Business
                  Day after the date hereof,  Sponsor requests from BNY the financial  information  described in Item
                  1115(b)  of  Regulation  AB under  the  Securities  Act of 1933,  as  amended,  and the  Securities
                  Exchange Act of 1934,  as amended (the  "EXCHANGE  ACT")  ("REGULATION  AB"),  (such  request to be
                  based on the  reasonable  determination  by  Sponsor,  in good  faith,  that  such  information  is
                  required  under  Regulation  AB) (the "REG AB FINANCIAL  DISCLOSURE").  Within 10 Business  Days of
                  the  occurrence of a Reg AB  Disclosure  Event,  BNY, at its own expense,  shall (a) provide to the
                  Sponsor the Reg AB Financial  Disclosure,  or (b) secure  another entity to replace BNY as party to
                  this Agreement on terms  substantially  similar to this Agreement and subject to prior notification
                  to the applicable  Rating Agencies,  the debt rating of which entity (or guarantor  therefor) meets
                  or exceeds the  qualified  ratings  (or which  satisfies  the Rating  Agency  Condition)  and which
                  entity  is able to  comply  with  the  requirement  of Item  1115(b)  of Reg AB.  If  permitted  by
                  Regulation  AB, any  required  Reg AB  Financial  Disclosure  may be provided by  incorporation  by
                  reference from reports filed pursuant to the Exchange Act.

         11)      ADDITIONAL  PROVISIONS.  Notwithstanding  the terms of  Sections  5 and 6 of the ISDA  Form  Master
                  Agreement,  if  Counterparty  has satisfied its payment  obligations  under Section  2(a)(i) of the
                  ISDA  Form  Master  Agreement,  and  shall,  at the  time,  have  no  future  payment  or  delivery
                  obligation,  whether  absolute or contingent,  then unless BNY is required  pursuant to appropriate
                  proceedings  to  return to  Counterparty  or  otherwise  returns  to  Counterparty  upon  demand of
                  Counterparty  any portion of such  payment,  (a) the  occurrence  of an event  described in Section
                  5(a) of the ISDA Form Master  Agreement with respect to Counterparty  shall not constitute an Event
                  of Default or Potential Event of Default with respect to  Counterparty as the Defaulting  Party and
                  (b) BNY shall be entitled  to  designate  an Early  Termination  Date  pursuant to Section 6 of the
                  ISDA Form Master  Agreement  only as a result of a  Termination  Event set forth in either  Section
                  5(b)(i) or Section  5(b)(ii) of the ISDA Form Master  Agreement with respect to BNY as the Affected
                  Party or Section  5(b)(iii) of the ISDA Form Master  Agreement  with respect to BNY as the Burdened
                  Party.  For  purposes of the  Transaction  to which this  Agreement  relates,  Counterparty's  only
                  obligation  under Section  2(a)(i) of the ISDA Form Master  Agreement is to pay the Fixed Amount on
                  the Fixed Rate Payer Payment Date.

         12)      PAYMENTS.  BNY will, unless otherwise  directed by the Trustee,  make all payments hereunder to the
                  Trustee.  Payment  made to the  Trustee  at the  account  specified  herein or to  another  account
                  specified in writing by the Trustee shall satisfy the payment  obligations  of BNY hereunder to the
                  extent of such payment.

         13)      LIMITATION  OF  TRUSTEE  LIABILITY.   Notwithstanding  anything  herein  to  the  contrary,  it  is
                  expressly  understood and agreed by the parties  hereto that (a) this letter  agreement is executed
                  and delivered by Deutsche Bank Trust Company  Americas  ("DBTCA"),  not individually or personally,
                  but  solely as  Trustee  of the RALI  Series  2006-QS4  Trust,  in the  exercise  of the powers and
                  authority  conferred  and  vested  in  it,  (b)  each  of  the  representations,  undertakings  and
                  agreements  herein made on the part of the RALI Series  2006-QS4  Trust is made and intended not as
                  personal  representations,  undertakings  and  agreements by DBTCA but is made and intended for the
                  purpose of binding only the RALI Series  2006-QS4  Trust,  (c) nothing  herein  contained  shall be
                  construed as creating any liability on DBTCA  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  DBTCA from  performing  its duties and
                  obligations  under the Pooling and Servicing  Agreement in accordance with the standard of care set
                  forth therein,  and (d) under no circumstances  shall DBTCA be personally liable for the payment of
                  any  indebtedness  or  expenses of the RALI  Series  2006-QS4  Trust or be liable for the breach or
                  failure of any  obligation,  representation,  warranty or covenant  made or  undertaken by the RALI
                  Series 2006-QS4 Trust under this letter agreement or any other related documents.

5.       ACCOUNT DETAILS AND SETTLEMENT INFORMATION:

         Payments to BNY:

                  The Bank of New York
                  Derivative Products Support Department
                  32 Old Slip, 16th Floor
                  New York, New York 10286
                  Attention: Renee Etheart
                  ABA #021000018
                  Account #890-0068-175
                  Reference: Interest Rate Cap

         Payments to Counterparty:

                  Deutsche Bank Trust Company Americas
                  ABA 021-001-033
                  A/C # 01419663
                  A/C Name NYLTD Funds Control - Stars west
                  Ref:  RALI 2006-QS4 Cap Funds







6.  COUNTERPARTS.  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.

          Please  confirm that the  foregoing  correctly  sets forth the terms of our  agreement  by  executing  this
agreement  and  returning  it  via  facsimile  to  Derivative   Products  Support  Dept.,  Attn:  Kenny  Au-Yeung  at
212-804-5818/5837.  Once we receive this we will send you two original confirmations for execution.




We are very pleased to have executed this Transaction with you and we look forward to completing other transactions with you in the near future. Very truly yours, THE BANK OF NEW YORK By: /s/ Stephen M Lawler Name: Stephen M Lawler Title: Managing Director The Counterparty, acting through its duly authorized signatory, hereby agrees to, accepts and confirms the terms of the foregoing as of the Trade Date. DEUTSCHE BANK TRUST COMPANY AMERICAS SOLELY AS TRUSTEE FOR RALI SERIES 2006-QS4 TRUST, MORTGAGE ASSET-BACKED PASS-THROUGH CERTIFICATES, SERIES 2006-QS4 By: /s/ Ronaldo Reyes Name: Ronaldo Reyes Title: Vice President
SCHEDULE I All dates subject to adjustment in accordance with the Modified Following Business Day Convention. -------------------------------------------------------------- NOTIONAL AMOUNT (IN ACCRUAL START DATE ACCRUAL END DATE USD) -------------------------------------------------------------- 04/27/2006 05/25/2006 72,867,000.00 -------------------------------------------------------------- 05/25/2006 06/25/2006 71,324,959.87 -------------------------------------------------------------- 06/25/2006 07/25/2006 69,665,001.06 -------------------------------------------------------------- 07/25/2006 08/25/2006 67,889,311.20 -------------------------------------------------------------- 08/25/2006 09/25/2006 66,000,357.31 -------------------------------------------------------------- 09/25/2006 10/25/2006 64,000,928.24 -------------------------------------------------------------- 10/25/2006 11/25/2006 61,894,083.83 -------------------------------------------------------------- 11/25/2006 12/25/2006 59,683,164.74 -------------------------------------------------------------- 12/25/2006 01/25/2007 57,371,770.63 -------------------------------------------------------------- 01/25/2007 02/25/2007 54,963,798.47 -------------------------------------------------------------- 02/25/2007 03/25/2007 52,463,387.95 -------------------------------------------------------------- 03/25/2007 04/25/2007 49,874,912.46 -------------------------------------------------------------- 04/25/2007 05/25/2007 47,392,882.48 -------------------------------------------------------------- 05/25/2007 06/25/2007 45,016,325.67 -------------------------------------------------------------- 06/25/2007 07/25/2007 42,744,234.56 -------------------------------------------------------------- 07/25/2007 08/25/2007 40,575,566.86 -------------------------------------------------------------- 08/25/2007 09/25/2007 38,509,245.75 -------------------------------------------------------------- 09/25/2007 10/25/2007 36,544,160.33 -------------------------------------------------------------- 10/25/2007 11/25/2007 34,679,165.99 -------------------------------------------------------------- 11/25/2007 12/25/2007 32,913,084.92 -------------------------------------------------------------- 12/25/2007 01/25/2008 31,244,706.60 -------------------------------------------------------------- 01/25/2008 02/25/2008 29,672,788.39 -------------------------------------------------------------- 02/25/2008 03/25/2008 28,196,056.12 -------------------------------------------------------------- 03/25/2008 04/25/2008 26,813,204.72 -------------------------------------------------------------- 04/25/2008 05/25/2008 25,522,898.91 -------------------------------------------------------------- 05/25/2008 06/25/2008 24,323,773.95 -------------------------------------------------------------- 06/25/2008 07/25/2008 23,214,436.33 -------------------------------------------------------------- 07/25/2008 08/25/2008 22,193,464.68 -------------------------------------------------------------- 08/25/2008 09/25/2008 21,259,410.50 -------------------------------------------------------------- 09/25/2008 10/25/2008 20,410,799.09 -------------------------------------------------------------- 10/25/2008 11/25/2008 19,583,292.05 -------------------------------------------------------------- 11/25/2008 12/25/2008 18,776,569.05 -------------------------------------------------------------- 12/25/2008 01/25/2009 17,990,313.96 -------------------------------------------------------------- 01/25/2009 02/25/2009 17,224,214.85 -------------------------------------------------------------- 02/25/2009 03/25/2009 16,477,963.88 -------------------------------------------------------------- 03/25/2009 04/25/2009 15,751,257.32 -------------------------------------------------------------- 04/25/2009 05/25/2009 15,043,795.42 -------------------------------------------------------------- 05/25/2009 06/25/2009 14,355,282.43 -------------------------------------------------------------- 06/25/2009 07/25/2009 13,685,426.51 -------------------------------------------------------------- 07/25/2009 08/25/2009 13,033,939.68 -------------------------------------------------------------- 08/25/2009 09/25/2009 12,400,537.80 -------------------------------------------------------------- 09/25/2009 10/25/2009 11,784,940.51 -------------------------------------------------------------- 10/25/2009 11/25/2009 11,186,871.15 -------------------------------------------------------------- 11/25/2009 12/25/2009 10,606,056.77 -------------------------------------------------------------- 12/25/2009 01/25/2010 10,042,228.04 -------------------------------------------------------------- 01/25/2010 02/25/2010 9,495,119.22 -------------------------------------------------------------- 02/25/2010 03/25/2010 8,964,468.14 -------------------------------------------------------------- 03/25/2010 04/25/2010 8,450,016.10 -------------------------------------------------------------- 04/25/2010 05/25/2010 7,951,507.87 -------------------------------------------------------------- 05/25/2010 06/25/2010 7,468,691.63 -------------------------------------------------------------- 06/25/2010 07/25/2010 7,001,318.93 -------------------------------------------------------------- 07/25/2010 08/25/2010 6,549,144.66 -------------------------------------------------------------- 08/25/2010 09/25/2010 6,111,927.00 -------------------------------------------------------------- 09/25/2010 10/25/2010 5,689,427.35 -------------------------------------------------------------- 10/25/2010 11/25/2010 5,281,410.34 -------------------------------------------------------------- 11/25/2010 12/25/2010 4,887,643.75 -------------------------------------------------------------- 12/25/2010 01/25/2011 4,507,898.51 -------------------------------------------------------------- 01/25/2011 02/25/2011 4,141,948.61 -------------------------------------------------------------- 02/25/2011 03/25/2011 3,789,571.08 -------------------------------------------------------------- 03/25/2011 04/25/2011 3,450,546.00 -------------------------------------------------------------- 04/25/2011 05/25/2011 3,124,656.38 -------------------------------------------------------------- 05/25/2011 06/25/2011 2,896,723.50 -------------------------------------------------------------- 06/25/2011 07/25/2011 2,681,024.51 -------------------------------------------------------------- 07/25/2011 08/25/2011 2,477,353.15 -------------------------------------------------------------- 08/25/2011 09/25/2011 2,285,505.99 -------------------------------------------------------------- 09/25/2011 10/25/2011 2,105,282.35 -------------------------------------------------------------- 10/25/2011 11/25/2011 1,936,484.33 -------------------------------------------------------------- 11/25/2011 12/25/2011 1,778,916.73 -------------------------------------------------------------- 12/25/2011 01/25/2012 1,632,387.03 -------------------------------------------------------------- 01/25/2012 02/25/2012 1,496,705.36 -------------------------------------------------------------- 02/25/2012 03/25/2012 1,371,684.45 -------------------------------------------------------------- 03/25/2012 04/25/2012 1,257,139.62 -------------------------------------------------------------- 04/25/2012 05/25/2012 1,152,888.74 -------------------------------------------------------------- 05/25/2012 06/25/2012 1,083,901.49 -------------------------------------------------------------- 06/25/2012 07/25/2012 1,024,468.14 -------------------------------------------------------------- 07/25/2012 08/25/2012 974,416.50 -------------------------------------------------------------- 08/25/2012 09/25/2012 933,576.77 -------------------------------------------------------------- 09/25/2012 10/25/2012 901,781.54 -------------------------------------------------------------- 10/25/2012 11/25/2012 878,865.72 -------------------------------------------------------------- 11/25/2012 12/25/2012 864,666.55 -------------------------------------------------------------- 12/25/2012 01/25/2013 859,023.52 -------------------------------------------------------------- 01/25/2013 02/25/2013 859,023.52 -------------------------------------------------------------- 02/25/2013 03/25/2013 859,023.52 -------------------------------------------------------------- 03/25/2013 04/25/2013 847,142.33 -------------------------------------------------------------- 04/25/2013 05/25/2013 821,175.22 -------------------------------------------------------------- 05/25/2013 06/25/2013 727,705.00 -------------------------------------------------------------- 06/25/2013 07/25/2013 625,035.46 -------------------------------------------------------------- 07/25/2013 08/25/2013 513,506.61 -------------------------------------------------------------- 08/25/2013 09/25/2013 393,449.71 -------------------------------------------------------------- 09/25/2013 10/25/2013 265,187.51 -------------------------------------------------------------- 10/25/2013 11/25/2013 129,034.36 --------------------------------------------------------------