**Exhibit 10.40****SIXTH AMENDMENT TO CREDIT AGREEMENT**     THIS SIXTH AMENDMENT TO CREDIT AGREEMENT (this “Amendment”) is entered into as of the5th day of December, 2007 by and among the lenders listed on the signature pages hereof (the“Lenders”), PENSON WORLDWIDE, INC., a Delaware corporation (“Borrower”), GUARANTYBANK, as Administrative Agent, Swing Line Lender, Arranger and Letter of Credit Issuer for theLenders (the “Administrative Agent”), and Wachovia Bank, National Association, asDocumentation Agent (the “Documentation Agent”), each to the extent and in the mannerprovided for in the Credit Agreement (defined below and herein so called).BACKGROUND     A. The Lenders, the Borrower, the Documentation Agent and the Administrative Agent are partiesto that certain Credit Agreement dated as of May 26, 2006 (as it may be amended, extended, renewed,or restated from time to time, the “Credit Agreement”). Capitalized terms defined in theCredit Agreement and not otherwise defined herein shall be used herein as defined in the CreditAgreement.     B. The Borrower has requested an amendment to the certain provisions of the Credit Agreementregarding permitted Investments so that the Borrower shall be entitled to repurchase certain of itsEquity Interests, and the Administrative Agent and the Required Lenders have agreed to suchamendment in order to provide clarification, subject to the terms and conditions contained herein.     NOW, THEREFORE, in consideration of the covenants, conditions and agreements hereafter setforth, and for other good and valuable consideration, the receipt and adequacy of which are allhereby acknowledged, the parties hereto covenant and agree as follows:     1. AMENDMENTS TO THE CREDIT AGREEMENT. The Credit Agreement is hereby amended asfollows:     (a) Section 1.01 of the Credit Agreement is hereby amended by adding thedefinition of “Equity Repurchase” in alphabetical order to read as follows:     “Equity Repurchase” means the Borrower’s repurchase of its Equity Interests.     (b) Section 7.02(i) and (j) of the Credit Agreement are hereby deleted in theirentirety and are replaced with the following:(i) making the JDI Loan;(j) Equity Repurchases on or after December 5, 2007 in an amount required topurchase shares of its capital stock valued (at the time of such purchase)of up to an aggregate amount of $12,500,000, as well as Equity Repurchasespreviously made as permitted under this Agreement; and(k) Investments otherwise permitted in thisAgreement.SIXTH AMENDMENT TO CREDIT AGREEMENT – Page 1
 

 
     2. CONDITIONS OF EFFECTIVENESS. This Amendment shall not be effective until each ofthe following conditions precedent shall have been met to the satisfaction of the AdministrativeAgent:     (a) Since the date of the most recent financial statements provided to the Lenders,there shall have been no event or circumstance, either individually or in the aggregate,that has had or would reasonably be expected to have a Material Adverse Effect;     (b) No Default shall exist after giving effect to this Amendment;     (c) The Administrative Agent shall have received confirmation that the Borrower haspaid all expenses and fees arising in connection with all matters undertaken or performed atthe request of the Administrative Agent; and     (d) The Administrative Agent shall have received, in form and substance satisfactory tothe Administrative Agent, a duly executed copy of this Amendment and the other applicableLoan Documents, together with such additional documents, instruments and certificates as theAdministrative Agent shall require in connection therewith, all in form and substancesatisfactory to the Administrative Agent.     3. REPRESENTATIONS AND WARRANTIES. The representations and warranties containedherein and in all other Loan Documents, as amended hereby, shall be true and correct as of the datehereof as if made on the date hereof.     4. REFERENCE TO CREDIT AGREEMENT. Upon the effectiveness of this Amendment, eachreference in the Credit Agreement to “this Agreement,” “hereunder,” or words of like import shallmean and be a reference to the Credit Agreement, as affected and amended by this Amendment.     5. COUNTERPARTS; EXECUTION VIA FACSIMILE OR ELECTRONIC TRANSMITTAL. This Amendmentmay be executed in one or more counterparts, each of which shall be deemed an original, but all ofwhich together shall constitute one and the same instrument. This Amendment may be validlyexecuted and delivered by facsimile or other electronic transmission.     6. GOVERNING LAW: BINDING EFFECT. This Amendment shall be governed by and construedin accordance with the laws of the State of Texas and shall be binding upon the Borrower, theAdministrative Agent, the Documentation Agent, each Lender and their respective successors andassigns.     7. HEADINGS. Section headings in this Amendment are included herein for convenienceof reference only and shall not constitute a part of this Amendment for any other purpose.SIXTH AMENDMENT TO CREDIT AGREEMENT – Page 2
 

 
     8. LOAN DOCUMENT. This Amendment is a Loan Document and is subject to all provisionsof the Credit Agreement applicable to Loan Documents, all of which are incorporated in thisAmendment by reference the same as if set forth in this Amendment verbatim.     9. SEVERABILITY. Any provisions of this Amendment held by a court of competentjurisdiction to be invalid or unenforceable shall not impair or invalidate the remainder of thisAmendment and the effect thereof shall be confined to the provisions so held to be invalid orunenforceable.     10. RATIFICATIONS. Except as expressly modified and superseded by this Amendment, theterms and provisions of the Credit Agreement and the other Loan Documents are ratified andconfirmed and shall continue in full force and effect. The representations and warrantiescontained herein and in all other Loan Documents, as amended hereby, shall be true and correct asof, and as if made on, the date hereof. The Credit Agreement as amended hereby shall continue tobe legal, valid, binding and enforceable in accordance with its respective terms.     11. NO ORAL AGREEMENTS. THIS WRITTEN AGREEMENT AND THE OTHER LOAN DOCUMENTS REPRESENTTHE FINAL AGREEMENT BETWEEN THE PARTIES AND MAY NOT BE CONTRADICTED BY EVIDENCE OF PRIOR,CONTEMPORANEOUS, OR SUBSEQUENT ORAL AGREEMENTS OF THE PARTIES. THERE ARE NO UNWRITTEN ORALAGREEMENTS BETWEEN THE PARTIES.**[Remainder of page left intentionally blank. Signature pages follow.]**SIXTH AMENDMENT TO CREDIT AGREEMENT – Page 3
 

 
     IN WITNESS WHEREOF, the Borrowers, the Required Lenders, the Documentation Agent and theAdministrative Agent have executed this Amendment as of the date first above written.      **BORROWER**: