
89 B.R. 613 (1988)
In re BUTTES RESOURCES COMPANY, Debtor.
SECURITY PACIFIC NATIONAL BANK, et al., Plaintiffs,
v.
ENSTAR PETROLEUM COMPANY, Defendant.
Civ. A. No. 87-293.
United States District Court, S.D. Texas, Houston Division.
August 25, 1988.
*614 Alan S. Gover, Houston, Tex., for plaintiffs.
Roxanne Armstrong, Houston, Tex., for defendant.

MEMORANDUM ON APPEAL
HUGHES, District Judge.
The Security Pacific National Bank, Federal Deposit Insurance Corporation, Bank of California, and Barclay's Bank have appealed the bankruptcy court's order to lift the automatic stay, allowing Enstar Petroleum Company to recoup money owed it by Buttes Resources Company. The bankruptcy court's order will be affirmed.
Background.
Buttes and Enstar are joint owners of working interests in an oil field in Rosebud County, Montana. Buttes and Enstar agreed that Enstar would be the operator of the property. The operator conducts the routine services that keep the wells producing oil. After Buttes filed for protection under Chapter 11, Enstar moved to lift the automatic stay so that it could apply production proceeds to pay production costs. The banks intervened in opposition, claiming that, as creditors with security interests in the production, they had priority to the expense payments Enstar had retained for itself out of the sales proceeds due Buttes.
Facts.
The facts are undisputed, and the banks contest only the bankruptcy court's conclusion that Enstar's right as operator prevails over the banks' security interests.
In December 1974, Buttes and Enstar signed an operating agreement that grants Enstar as the operator,
a first lien on ... each party's interest in oil and gas produced and the proceeds thereof ... to secure the payment of all sums due from each party to operator.
This single contract governs a recurring transaction; it binds Buttes to pay its share of the field's production costs. Buttes's failure to pay allows Enstar to withhold the proceeds of the oil to cover Buttes's delinquent expense allocations. Essentially the contract is for the payment by Enstar of the net proceeds to Buttes.
Enstar sought to recoup pre-petition and post-petition proceeds payments owed to Buttes against the production costs attributable to Buttes's working interest that were advanced by Enstar before the petition. The banks suggest that Enstar's right to production costs is a setoff which, in the bankruptcy context, would allow only a limited recovery of mutual debts. Setoff elevates a creditor's unsecured claim to a secured status by using the debtor's pre-petition claim against the creditor as collateral. In re Braniff Airways, Inc., 42 B.R. 443, 448 (Bankr.N.D.Tex.1984).
Setoff is limited, however, by 11 U.S.C. § 553. Among those limitations is that pre-petition claims against the debtor cannot be set off against post-petition debts to the debtor. Recoupment, on the other hand, allows the creditor to extinguish the mutual claims irrespective of their bankruptcy status. Lee v. Schweiker, 739 F.2d 870, 875 (3rd Cir.1984).
Buttes, to secure loans to its parent company, granted the banks security interests in its 34.6% interest in the Montana leases. The banks perfected their security interests in the leases in 1976, 1982, and 1984, by filing deeds of trust, security agreements, and assignments in the real property records of Rosebud County. The banks admit that, before they loaned money to Buttes, they had actual knowledge of the operating agreement between Buttes and Enstar.
As its share of the operating expenses, Buttes owes Enstar $9,244.84 for pre-petition costs and $367.66 for post-petition costs. As Buttes's share of the proceeds, Enstar owes Buttes $3,598.28 out of pre-petition production and $1,647.24 out of post-petition production.
Setoff vs. Recoupment
The trial court's characterization of Enstar's claim against the estate as a recoupment rather than a setoff is a critical distinction *615 in the context of bankruptcy; under the revised Bankruptcy Act, section 553, the right to set off a counterclaim has been circumscribed. The debate whether the contractually analogous right of recoupment should be treated like a setoff to effectuate the Act's policy of equal treatment to secured creditors predates the 1986 revision of the Act. See Stanolind Oil & Gas Co. v. Logan, 92 F.2d 28, 29 (5th Cir.1937), Walther v. Williams Mercantile Co., 169 F. 270 (6th Cir.1909), "Recoupment is not covered by Section 68." 2 Cowens, Bankruptcy Law and Practice, 121-22 (2d ed. 1978). The drafters who revised the former section 68 of the Chandler Act could have foreclosed the recoupment avenue of recovery for creditors.
In 1984, Congress narrowed the application of setoffs in section 553 to restrict preferences of certain creditors by differentiating between pre-petition and post-petition claims. 4 Collier on Bankruptcy § 553.02. As under the Act of 1898, the right to setoff under section 553 is permissive and rests with the discretion of the court. Cumberland Glass Mfg. Co. v. DeWitt, 237 U.S. 447, 35 S.Ct. 636, 59 L.Ed. 1042 (1914). Collier urges that courts not belabor what was encompassed by the act but focus on the equities of the given case when one transaction gives rise to two related claims, but he says, "With due regard to the purposes of former section 68, however, and the essential distinction between the two doctrines, it seems that this concept is hardly necessary. Certainly in any suit or action between the estate and another, the defendant should be entitled to show that because of matters arising out of the transaction sued on, he is not liable in full for the plaintiff's claim. There is no element of preference here or of an independent claim to be set off, but merely an arrival at a proper liability on the main issue." Collier § 553.03.
When an operator deducts from the proceeds of current production the expenses owed by a working interest owner for earlier production from the same wells, the transaction is characterized as either a recoupment or a setoff based on the terms of the operating agreement and any superseding contracts. The same analysis applies to processors seeking to recover expenses.
Both setoffs and recoupment are counterclaims, but they differ in that the setoff is a claim that arises out of a transaction different from the one sued on. It is asserted to diminish a plaintiff's demand. Frederick v. U.S., 386 F.2d 481 (5th Cir. 1967) citing 3 Moore, Federal Practice, § 13.02 at 8-9 (2d ed. 1966). Recoupment, which is a defense as well as a counterclaim, on the other hand, is a counter demand arising from the same transaction as the plaintiff's claim. Lee v. Schweiker, 739 F.2d 870, 875 (3d Cir.1984).
Examples of creditors prevailing on contractual recoupment rights include: (1) a company paying advance royalties to a musician was allowed to recoup the advances from post-bankruptcy record sales. Waldschmidt v. CBS, Inc., 14 B.R. 309, 314 (M.D.Tenn.1981); (2) a company recouped progress payments on a construction and repair contract which were made in excess of the value of the work performed before bankruptcy and performance continued after bankruptcy. In re Midwest Service and Supply Co., 44 B.R. 262, 265 (D.Utah 1983); and (3) the doctrine was applied to allow the government to recover medicare overpayments from post-bankruptcy reimbursements to a hospital that continued to operate after filing a Chapter 11 petition. In re Yonkers Hamilton Sanitarium, Inc., 22 B.R. 427, 433 (Bankr.S.D.N.Y.1982), aff'd 34 B.R. 385 (S.D.N.Y.1983).
The doctrine of recoupment is recognized under Montana law which governs this case. An agent sued for non-delivery of funds could recoup his unpaid commission. See Francisco v. Francisco, 120 Mont. 468, 191 P.2d 317 (1948).
For a case in which a recoupment was disallowed because the transaction giving rise to a counterclaim was part of a series of separate agreements the essential terms of which could be altered monthly. See In re California Canners and Growers, 62 B.R. 18, 20 (9th Cir. BAP 1986). This result was reached in spite of the existence *616 of a general agreement governing the parties' relationship. Permitting recoupment on a similar set of facts has been criticized as subverting the equality of distribution principles of bankruptcy. Ashland Petroleum v. Appel (In re B & L Oil), 782 F.2d 155 (10th Cir.1986); "Bankruptcy  The Recoupment Doctrine," 17 New Mex.L.R. 421 (1987). The Ashland court did not explicitly determine whether a division order for the purchase of oil and gas was a single executory contract; in fact, one finding that "the obligations were easily separable and independently determinable" suggests that the court could have reached the result of In re California Canners. Slavish adherence to avoiding preferential treatment distracted one court from properly characterizing a counterclaim for overpayment by a refiner against a gas producer as either a recoupment or a setoff. See Republic Supply Co. of California v. Richfield Oil Co., 59 F.2d 35 (9th Cir.1931). The fact that the Buttes operating contract provided for monthly accountings does not negate that it was a continuous agreement, the material terms of which were fixed at the execution in 1974.
Texas courts have been careful to distinguish between defenses that are available from the inception of the contract and asserted to defeat part of the plaintiff's claim from those that do not become available until later during the performance of the agreement. In Morris-Buick v. Davis failure to deliver the premises on time was not a recoupment against the unpaid last month's rent, 127 Tex. 41, 91 S.W.2d 313 (1936). Texas courts have gone so far as to hold that damage to the goods is not a recoupment claim against the freight charges. Southern Pacific RR Co. v. Porter, 160 Tex. 329, 331 S.W.2d 42 (1960); for a less restrictive application of the Texas recoupment doctrine, see Pennsylvania R.R. Co. v. Miller, 124 F.2d 160 (5th Cir. 1941).
Although Montana law governs this case because the land is there, even under Texas law, Enstar's claim would be characterized as a recoupment because the claim of Buttes for the proceeds is subject ab initio to reduction for the very expenses that were required to produce the oil. Shaw & Estes v. Texas Consolidated Oils, 299 S.W. 2d 307 (Tex.Civ.App.  Galveston 1957); Freston v. Gulf Oil Co.-U.S., 565 P.2d 787 (Utah, 1977).
The banks rely on Sterling National Bank v. Southwire Co., 713 F.2d 684 (11th Cir.1983). That case did not allow a processor to cancel a debt incurred for its refining charges by keeping a quantity of a customer's finished product. In Sterling, the processor never sold the product for the owner, as Enstar always did for Buttes; the processor did not apparently even deliver the product to the owner's customers. Also, Sterling's security agreement expressly excepted sales made in the regular course of business; Southwire's transaction was clearly not a sale made in the regular course of business.
Southwire could not argue that it had a processor's lien superior to the bank's interest because, under the Georgia code, a perfected security interest takes priority over other liens. Id. at 688.
Perhaps a more compelling equitable explanation for allowing recoupment under binding executory contracts is that unlike divisible agreements which are subject to renegotiation on regular bases, the creditor undertakes one risk farther back in time, presumably when the debtor was financially stable. Where key terms of a contract can be adjusted, for instance, monthly, the claimant is likely to be cognizant of the debtor's ailing financial health, perhaps by late or insufficient payments, and thus knowingly undertakes a new risk with each installment.
Quality of the Interest Buttes Assigned.
One problem with the banks' position is that their own deeds of trust state that the banks were to stand in the debtor's place. The banks can have no greater rights against Enstar than Buttes had, and they appear, from the assignments, to have first claim on the net proceeds from Buttes's interest in the Montana field. Massey-Ferguson Credit Corp. v. Brown, 173 Mont. 253, 567 P.2d 440 (1977). Vogt v. Jones, *617 396 S.W.2d 539 (Tex.Civ.App.  Ft. Worth, 1965).
The banks acquired their interests knowing that the property subject to their deeds was at the time in the possession of a third party. At common law, a third party in possession of a property is notice of a prior claim, and that law survives the adoption of the U.C.C. Long Falls Realty Co. v. Anchor Electric Co., 405 S.W.2d 170 (Tex.Civ. App.  Dallas 1966, reh'g denied).
The banks could have prevented the conflict with Enstar by conditioning their loans to Buttes on the agreement by Enstar not to claim production proceeds to cover costs, but the lenders did not get Enstar's consent. See Wells Fargo Business v. Ben Koloff, Inc., 695 F.2d 940 (5th Cir.1983). A security interest creates rights in the secured party only to the extent of the alienable property interest of the debtor. Enstar's recoupment from Buttes for the underpayments did not reduce the value of security to which the banks were entitled since the banks never had an expectation of receiving the gross proceeds from the sale of oil without the cost of production having first been satisfied.
A nonrestrictive application of the recoupment doctrine is further justified under an analysis of property rights. The rule of recoupment in bankruptcy derives from the rule that the trustee takes the bankrupt's property subject to others' equities in it. In re Monongahela Rye Liquors, 141 F.2d 864, 869 (3d Cir.1944). The nature and extent of the debtor's interest in property are determined by state law. 4 Collier on Bankruptcy § 541.02(1) (15 ed. 1985), Butner v. United States, 440 U.S. 48, 55, 99 S.Ct. 914, 918, 59 L.Ed.2d 136 (1979). Once that determination is made, however, federal bankruptcy law dictates to what extent that interest is the property of the estate. In Re N.S. Garrott Sons, 772 F.2d 462, 466 (8th Cir.1985); Estes v. Texas Consolidated Oils, 266 S.W.2d 272 (Tex.Civ.App.  Galveston, 1954); Estes & Shaw, supra.
Not all disparate treatment of seemingly similar situated creditors is offensive to the equitable distribution principles underlying the Act. The law has long recognized that the privilege of setoff is an exception to the policy of non-preferential treatment. Cumberland Glass Mfg. Co. v. DeWitt, 237 U.S. 447, 455, 35 S.Ct. 636, 639, 59 L.Ed. 1042 (1914) citing New York County Nat. Bank v. Massey, 192 U.S. 138, 24 S.Ct. 199, 48 L.Ed. 380 (1903). Moreover, equity also favors dissimilar treatment of dissimilar parties. Until Congress proscribes recoupment rights, creditors who properly invoke this doctrine will continue to enjoy the preferential treatment that was afforded under section 68.
The Operating Agreement.
The operating agreement provides:
Operator shall promptly pay all expenses incurred in the development and operation of the unit area and shall charge each of the parties their proportionate shares ... provided in the attached accounting procedures.
Operator has the right to receive advance payment for estimated amounts of costs ... Each party shall pay to operator its share of such estimate within 15 days after invoice.
Operator is given a first lien on the interest of each party covered by this contract, and in each party's interest in oil and gas produced and the proceeds thereof ... to secure the payment of all sums due from each party to operate.
Unlike In re California Canners, Buttes and Enstar's operating agreement establishes more than just a relationship; key terms such as costs, quantity, delivery, and price are not left open for future negotiation. A cotenant with exclusive possession of an oil property who extracts and sells the oil may charge against the proceeds the reasonable and necessary expense of its extraction and marketing. Marias River Syndicate v. Big West Oil Co., 98 Mont. 254, 38 P.2d 599 (1934).
Conclusion.
The bankruptcy court's lifting of the stay will be affirmed. Recoupment between post-petition and pre-petition claims arising from the same transaction is not precluded by Section 553 of the Bankruptcy Act. *618 Enstar's claim was properly characterized as a recoupment.
