Agreement of Limited Partnership



 Exhibit 10.1 
 AMENDMENT NO. 2 
 TO 
 SECOND AMENDED AND RESTATED AGREEMENT OF LIMITED 
 PARTNERSHIP 

OF 
 ATLAS PIPELINE PARTNERS, L.P.

 THIS AMENDMENT NO. 2 TO SECOND AMENDED AND RESTATED AGREEMENT OF LIMITED PARTNERSHIP OF ATLAS PIPELINE PARTNERS, L.P. (this
“Amendment”), dated as of July 27, 2007, is entered into and effectuated by Atlas Pipeline Partners GP, LLC, a Delaware limited liability company (the “General Partner”) and the general partner of Atlas
Pipeline Partners, L.P., a Delaware limited partnership (the “Partnership”), pursuant to authority granted to it in Sections 5.6 and 13.1 of the Second Amended and Restated Agreement of Limited Partnership of the Partnership, dated
as of March 9, 2004, as amended (the “Limited Partnership Agreement”). Capitalized terms used but not defined herein are used as defined in the Limited Partnership Agreement. 
 WHEREAS, Section 13.1(d) of the Limited Partnership Agreement provides that the General Partner, without the approval of any Partner or Assignee,
may amend any provision of the Limited Partnership Agreement to reflect a change that, in the discretion of the General Partner, does not adversely affect the Limited Partners in any material respect, and the General Partner has determined that the
amendments contemplated hereby do not adversely affect the Limited Partners in any material respect; 
 WHEREAS, Section 13.1(j) of the
Limited Partnership Agreement provides that the General Partner, without the approval of any Partner or Assignee, may amend any provision of the Limited Partnership Agreement that, in the discretion of the General Partner, is necessary or advisable
to reflect, account for and deal with appropriately the formation by the Partnership of, or investment by the Partnership in, any corporation, partnership, joint venture, limited liability company or other entity, in connection with the conduct by
the Partnership of its business, and the General Partner has determined that the amendments contemplated hereby are necessary or advisable in connection therewith; and 
 WHEREAS, the General Partner deems it in the best interest of the Partnership to effect this Amendment. 
 NOW, THEREFORE, it is hereby agreed as follows: 
 A. Amendment. The Limited Partnership Agreement is hereby amended as
follows: 
 1. Section 1.1 of the Limited Partnership Agreement is hereby amended to add or amend or restate the following definitions in
appropriate alphabetical order: 
 “Available Cash” means, with respect to any Quarter ending prior to the
Liquidation Date, 







 (a) the sum of (i) all cash and cash equivalents of the Partnership Group on hand at
the end of such Quarter, and (ii) all additional cash and cash equivalents of the Partnership Group on hand on the date of determination of Available Cash with respect to such Quarter resulting from Working Capital Borrowings made subsequent to
the end of such Quarter, less 
 (b) the amount of any cash reserves that is necessary or appropriate in the reasonable
discretion of the General Partner to (i) provide for the proper conduct of the business of the Partnership Group (including reserves for future capital expenditures and for anticipated future credit needs of the Partnership Group) subsequent to
such Quarter, (ii) comply with applicable law or any loan agreement, security agreement, mortgage, debt instrument or other agreement or obligation to which any Group Member is a party or by which it is bound or its assets are subject or
(iii) provide funds for distributions under Section 6.4 or 6.5 in respect of any one or more of the next four Quarters; provided, however, that the General Partner may not establish cash reserves pursuant to (iii) above if the effect
of such reserves would be that the Partnership is unable to distribute the Minimum Quarterly Distribution on all Common Units, plus any Cumulative Common Unit Arrearage on all Common Units, with respect to such Quarter; and, provided further, that
disbursements made by a Group Member or cash reserves established, increased or reduced after the end of such Quarter but on or before the date of determination of Available Cash with respect to such Quarter shall be deemed to have been made,
established, increased or reduced, for purposes of determining Available Cash, within such Quarter if the General Partner so determines, plus 
 (c) the Permitted Western Gas Resources Distributions. 
 Notwithstanding the foregoing, “Available
Cash” with respect to the Quarter in which the Liquidation Date occurs and any subsequent Quarter shall equal zero. 
 “Permitted Western Gas Resources Distributions” means (a) those distributions and payments to the Class A Member of Atlas Pipeline Mid-Continent WestOk, LLC that are made pursuant to the Operating Agreement of Atlas
Pipeline Mid-Continent WestOk, LLC dated as of July 27, 2007, as it may be amended, supplemented or restated from time to time, and (b) those distributions and payments to the Class A Member of Atlas Pipeline Mid-Continent WestTex,
LLC that are made pursuant to the Operating Agreement of Atlas Pipeline Mid-Continent WestTex, LLC dated as of July 27, 2007, as it may be amended, supplemented or restated from time to time. 
 2. Section 6.3(a) of the Limited Partnership Agreement is hereby amended and restated as follows: 
  

 2 








 Within 45 days following the end of each Quarter commencing with the Quarter ending on March 31,
2000, an amount equal to 100% of Available Cash less the Permitted Western Gas Resources Distributions with respect to such Quarter shall, subject to Section 17-607 of the Delaware Act, be distributed in accordance with this Article VI by the
Partnership to the Partners as of the Record Date selected by the General Partner in its reasonable discretion. Available Cash constituting the Permitted Western Gas Resources Distributions shall be distributed as provided in the definition thereof.
All amounts of Available Cash distributed by the Partnership on any date from any source shall be deemed to be Operating Surplus until the sum of all amounts of Available Cash theretofore distributed by the Partnership pursuant to Section 6.4
equals the Operating Surplus from the Initial Closing Date through the close of the immediately preceding Quarter. Any remaining amounts of Available Cash distributed by the Partnership or pursuant to the Permitted Western Gas Resources
Distributions on such date shall, except as otherwise provided in Section 6.5, be deemed to be “Capital Surplus.” All distributions required to be made under this Agreement shall be made subject to Section 17-607 of the Delaware
Act. 
 3. Section 6.4(b) of the Limited Partnership Agreement is hereby amended and restated as follows: 
 (b) After Subordination Period. Available Cash (less the Permitted Western Gas Resources Distributions) with respect to any Quarter after the
Subordination Period that is deemed to be Operating Surplus pursuant to the provisions of Section 6.3 or 6.5, subject to Section 17-607 of the Delaware Act, shall be distributed as follows, except as otherwise required by
Section 5.6(b) in respect of additional Partnership Securities issued pursuant thereto: 
 (i) First, 98.9899% to the
Unitholders holding Common Units, Pro Rata, and 1.0101% to the General Partner until there has been distributed in respect of each Common Unit then Outstanding an amount equal to the Minimum Quarterly Distribution for such Quarter; 
 (ii) Second, 98.9899% to the Unitholders holding Common Units, Pro Rata, and 1.0101% to the General Partner until there has been
distributed in respect of each Common Unit then Outstanding an amount equal to the Cumulative Common Unit Arrearage existing with respect to such Quarter; 
 (iii) Third, 85% to all Unitholders, Pro Rata, 13.9899% to the holders of the Incentive Distribution Rights, Pro Rata, and 1.0101% to the General Partner until there has been distributed in respect of each Unit then
Outstanding an amount equal to the excess of the First Target Distribution over the Minimum Quarterly Distribution for such Quarter; 
 (iv) Fourth, 75% to all Unitholders, Pro Rata, 23.9899% to the holders of the Incentive Distribution Rights, Pro Rata, and 1.0101% to the General Partner until there has been distributed in respect of each Unit then Outstanding an amount
equal to the excess of the Second Target Distribution over the First Target Distribution for such Quarter; and 
  

 3 








 (v) Thereafter, 50% to all Unitholders, Pro Rata, 48.9899% to the holders of the
Incentive Distribution Rights, Pro Rata, and 1.0101% to the General Partner; 
 provided, however, if the Minimum Quarterly Distribution, the
First Target Distribution and the Second Target Distribution have been reduced to zero pursuant to the second sentence of Section 6.6(a), the distribution of Available Cash that is deemed to be Operating Surplus with respect to any Quarter will
be made solely in accordance with Section 6.4(b)(v) and the Permitted Western Gas Resources Distributions. 
 4. Article VI of the
Limited Partnership Agreement is hereby amended to add a new Section 6.4(c) as follows: 
 (c) Special Subordination after the Quarter
Ended June 30, 2007. Notwithstanding the provisions of Section 6.4(b), amounts distributable to the holders of Incentive Distribution Rights shall be subject to reduction as follows: 
  

	 	(i)	For each Quarter from the Quarter beginning July 1, 2007 until the Quarter ending December 31, 2007, after the holders of the Incentive Distribution Rights have received
an aggregate of $3.7 million with respect to such Incentive Distribution Rights, they shall not be entitled to further distributions with respect to such Incentive Distribution Rights until the amount distributable pursuant to Section 6.4(b),
but for the application of this subparagraph to the holders of the Incentive Distribution Rights, would have been $8.7 million. Any amounts not distributed to the holders of Incentive Distribution Rights because of the operation of this subparagraph
shall be distributed 1.0101% to the General Partner and 98.9899% to all Unitholders. 

  

	 	(ii)	For each Quarter from the Quarter beginning January 1, 2008 until the Quarter ending June 30, 2009, after the holders of the Incentive Distribution Rights have received an
aggregate of $7.0 million with respect to such Incentive Distribution Rights, they shall not be entitled to further distributions with respect to such Incentive Distribution Rights until the amount distributable pursuant to Section 6.4(b), but
for the application of this subparagraph to the holders of the Incentive Distribution Rights, would have been $12.0 million. Any amounts not distributed to the holders of Incentive Distribution Rights because of the operation of this subparagraph
shall be distributed 1.0101% to the General Partner and 98.9899% to all Unitholders. 

  

 4 









	 	(iii)	For each Quarter from and after the Quarter beginning July 1, 2009, after the holders of the Incentive Distribution Rights have received an aggregate of $7.0 million with
respect to such Incentive Distribution Rights, they shall not be entitled to further distributions with respect to such Incentive Distribution Rights until the amount distributable pursuant to Section 6.4(b), but for the application of this
subparagraph to the holders of the Incentive Distribution Rights, would have been $10.75 million. Any amounts not distributed to the holders of Incentive Distribution Rights because of the operation of this subparagraph shall be distributed 1.0101%
to the General Partner and 98.9899% to all Unitholders. 

 5. The beginning of the first paragraph of Section 6.5 of the
Limited Partnership Agreement (i.e., before clause (a) thereof) is hereby amended and restated as follows: 
 Available Cash (less the
Permitted Western Gas Resources Distributions) that is deemed to be Capital Surplus pursuant to the provisions of Section 6.3(a) shall, subject to Section 17-607 of the Delaware Act, be distributed, unless the provisions of
Section 6.3 require otherwise, as follows: 
 B. Agreement in Effect. Except as hereby amended, the Limited Partnership Agreement
shall remain in full force and effect. 
 C. Applicable Law. This Amendment shall be construed in accordance with and governed
by the laws of the state of Delaware, without regard to principles of conflicts of laws. 
 D. Invalidity of Provisions. If any
provision of this Amendment is or becomes invalid, illegal or unenforceable in any respect, the validity, legality and enforceability of the remaining provisions contained herein shall not be affected thereby. 
  

 5 








 IN WITNESS WHEREOF, this Amendment has been executed as of the date first written above. 
  

			
	ATLAS PIPELINE PARTNERS, L.P.
		
	By:	 	 Atlas Pipeline Partners GP, LLC, its
 general partner


		
	By:	 	  

	Name:	 	Matthew A. Jones
	Title:	 	Chief Financial Officer


  

 6