In March 2000, Wesley Allen Myers and Sonja Diane Myers (Debtors) filed a Chapter 12 bankruptcy petition in the United States Bankruptcy Court. The Farm Service Agency (FSA), an agency within the United States Department of Agriculture, filed a motion for relief from the automatic stay to setoff government program payments owed to Debtors. The bankruptcy court denied the FSA’s motion, holding administrative regulations prohibited set-off. On appeal, the Bankruptcy Appellate Panel (BAP) affirmed on alternative grounds, focusing on § 553 of the Bankruptcy Code. In re Myers, 284 B.R. 478 (10th Cir. B.A.P. 2002). Section 553 provides in relevant part:
[T]his title does not affect any right of a creditor to offset a mutual debt owing by such creditor to the debtor that arose before the commencement of the case under this title against a claim of such creditor against the debtor that arose before the commencement of the ease[.]
11 U.S.C. § 553(a). The BAP held the FSA could not setoff payments owed to Debtors under § 553 because the FSA did not have a “claim” against Debtors. Myers, 284 B.R. at 480. On appeal, the FSA maintains both the bankruptcy court and the BAP erred in denying FSA’s right to setoff.
We have jurisdiction to review final bankruptcy decisions under 28 U.S.C. § 158(d). When reviewing BAP decisions, we independently review the bankruptcy court decision. In re Albrecht, 233 F.3d 1258, 1260 (10th Cir.2000). We review de novo the proper application of the Bankruptcy Code. In re Midkiff, 342 F.3d 1194, 1197 (10th Cir.2003). Applying this standard, we hold the FSA’s right to setoff fails under § 553 because the FSA did not owe a debt to Debtors “that arose before the commencement of’ the bankruptcy case. Accordingly, we affirm.
I.
Debtors are family farmers who borrowed money from the FSA between 1969 and 1980. Liens on Debtors’ real property secured the loans. Debtors defaulted on the loans in 1995. The next year, Debtors entered into a seven year executory “Production Flexibility Contract” (PFC) with the Commodity Credit Corporation (Commodity Corp.). Under the PFC, the Commodity Corp. contractually agreed to pay Debtors an annual PFC payment in exchange for compliance with various planting, conservation, and land-*671use restrictions.1 Debtors received their first PFC payment in 1996. The next year, however, the FSA setoff the 1997 PFC payment and applied it to Debtors’ defaulted loans.2
In January 1997, the FSA filed a foreclosure action against Debtors’ real property. Debtors thereafter filed a Chapter 12 bankruptcy petition, which they later converted to a Chapter 7 petition. The filing of the bankruptcy petition automatically stayed the FSA’s foreclosure action. See 11 U.S.C. § 362(a)(1). The filing of the petition also terminated the PFC. See 7 C.F.R. § 1412.201(b) (2002).3 Neither the Chapter 7 trustee, nor Debtors, assumed the PFC. See id.; see also 11 U.S.C. § 365. As a result of the termination, the Commodity Corp. did not make any PFC payments to Debtors in 1998 or 1999. At the close of the Chapter 7 proceedings, Debtors obtained a discharge of all personal liability. See 11 U.S.C. § 727. After the discharge, Debtors entered into a stipulated judgment with the FSA in the amount of $436,942.30, plus interest, secured solely by Debtors’ real property. The FSA proceeded with its foreclosure action.
In March 2000, two days before the FSA’s foreclosure sale, Debtors filed a second bankruptcy petition under Chapter 12. The Chapter 12 petition again stayed the FSA’s foreclosure proceedings. Debtors submitted a proposed Chapter 12 repayment plan. See 11 U.S.C. § 1221. The bankruptcy court confirmed the plan over FSA’s objections. The plan permitted Debtors to keep their property if they paid the appraised value of the property, $390,000, plus interest, to the FSA over a twenty-five year period.
In July 2000, Debtors filed a motion in the bankruptcy court seeking to “assume” or reaffirm the previously terminated PFC. See 7 C.F.R. § 1412.207(a)(3) (2002).4 The bankruptcy court entered a stipulated order granting Debtors’ motion. The stipulation provided, among other things: (1) *672Debtors could enroll in farm related payment programs, such as the PFC; (2) Debtors entered into the PFC dated July 28, 2000 as a “successor in interest” to the PFC approved June 18, 1996; (3) the 1996 date governed for purposes of setoff; and (4) Debtors did not admit the FSA had any right of setoff. The Commodity Corp. approved Debtor’s “successor in interest” PFC. At that point, Debtors were eligible for the remaining three years of PFC payments under the contract, i.e., 2000, 2001, and 2002. After Debtors entered into the “successor in interest” PFC, the FSA sought relief from the automatic stay to setoff the 2000, 2001, and 2002 PFC payments. The FSA’s motion was denied.
II.
Setoff is a right grounded in concepts of fairness and equity. G.S. Omni Corp. v. United States, 835 F.2d 1317, 1318 (10th Cir.1987). The right of setoff “allows entities that owe each other money to apply their mutual debts against each other, thereby avoiding the ‘absurdity of making A pay B when B owes A.’ ” Citizens Bank v. Strumpf, 516 U.S. 16, 18, 116 S.Ct. 286, 133 L.Ed.2d 258 (1995) (quoting Studley v. Boylston Nat’l. Bank, 229 U.S. 523, 528, 33 S.Ct. 806, 57 L.Ed. 1313 (1913)). By definition, setoff is a “common right, which belongs to every creditor, to apply the unappropriated moneys of his debtor, in his hands, in extinguishment of the debts due to him.” Gratiot v. United States, 40 U.S. 336, 370, 15 Pet. 336, 10 L.Ed. 759 (1841). In the bankruptcy context, setoff allows one creditor to be paid more than other creditors.5 See In re IML Freight, Inc., 65 B.R. 788, 792 (Bankr.D.Utah 1986). “In the absence of ... setoff, the creditor might be forced to pay in full the amount owed to the debtor, but be limited to no more than a pro rata recovery of his claim against the debtor.” Id. (internal quotation omitted).
The Bankruptcy Code does not create a federal right of setoff. Strumpf, 516 U.S. at 18, 116 S.Ct. 286. Setoff in bankruptcy is neither automatic nor mandatory; rather, its application rests within the sound discretion of the bankruptcy court. 5 Collier on Bankruptcy ¶ 553.02[3] (15th ed. rev.2003). Section 553 of the Code simply preserves setoff rights that might otherwise exist under federal or state law. Strumpf 516 U.S. at 18, 116 S.Ct. 286. Therefore, the threshold determination is whether an independent right of setoff exists outside of bankruptcy. See id. If such a right exists, only then do we look to § 553 to establish whether the conditions of setoff are satisfied. 5 Collier on Bankruptcy ¶ 553.01[2].
Under § 553, a creditor with an independent right of setoff may setoff a debtor’s obligations only if the creditor satisfies three elements. First, the creditor must owe a debt to the debtor that “arose before the commencement of’ the bankruptcy proceedings. Second, the creditor must have a claim against the debtor that “arose before the commencement of’ the bankruptcy proceedings. Third, the creditor’s and debtor’s obligations must be mutual. 11 U.S.C. § 553(a); Davidovich v. Welton, 901 F.2d 1533, 1537 (10th Cir.1990). In other words, a right to setoff under § 553 arises only when the mutual debt and claim both arose pre-petition. See United States v. Gerth, 991 F.2d 1428, 1431 (8th Cir.1993).
In determining whether a debt is pre-petition or post-petition, executory *673contracts, such as the PFC in question, present special problems. See Gerth, 991 F.2d at 1432-33; In re Buckner, 218 B.R. 137, 145 (10th Cir. B.A.P. 1998). An exec-utory contract is “a contract that has not as yet been fully completed or performed” and in which future obligations remain. Black’s Law Dictionary 395 (6th ed.1991).6 Agricultural contracts, such as the PFC, are executory in nature because material performance remains due on both sides. See Gerth, 991 F.2d at 1431; Buckner, 218 B.R. at 145; In re Ratliff, 79 B.R. 930, 933 (Bankr.D.Colo.1987). Given the nature of executory contracts, the determination of whether a debt under a contract arises pre-petition or post-petition can be problematic because the debtor generally enters into the executory contract pre-petition while performance remains due post-petition. Buckner, 218 B.R. at 145.
The Bankruptcy Code defines “debt” as “liability on a claim” and the term “claim” as the “right to payment, whether or not such right is reduced to judgment, liquidated, unliquidated, disputed, undisputed, legal, equitable, secured or unsecured.” 11 U.S.C. §§ 101(12), (5)(A). In Johnson v. Home State Bank, 501 U.S. 78, 83, 111 S.Ct. 2150, 115 L.Ed.2d 66 (1991), the Supreme Court stated a “right to payment” means “nothing more nor less than an enforceable obligation.” (internal quotation omitted). Accordingly, a debt arises pre-petition for set-off purposes when some “right to payment” exists prepetition; that is, when an enforceable obligation exists at the time the debtor files his bankruptcy petition. See Buckner, 218 B.R. at 147.
Applying this standard to an executory agricultural contract, the Eighth Circuit held a debt under an executory contract arises pre-petition when the debt is “absolutely owed” at the time the debtor files his bankruptcy petition. Gerth, 991 F.2d at 1433; see also United States v. Brunner, 282 F.2d 535, 538 (10th Cir.1960). The phrase “absolutely owed” is somewhat of a misnomer because, as the Eighth Circuit explained, “a debt can be absolutely owing prepetition even though that debt would never have come into existence except for postpetition events.” Gerth, 991 F.2d at 1434. A debt is simply “absolutely owed” pre-petition when “all transactions necessary for liability occur, regardless of whether the claim was contingent, unliqui-dated, or unmatured when the petition was filed.” Id. at 1433.
Similarly, in Buckner, the Tenth Circuit BAP explained a debt arises prepetition when the debt is “valid and enforceable” at the time the debtor files his bankruptcy petition. 218 B.R. at 147 (citing Peterson Distrib., Inc. v. Styler, 82 F.3d 956, 964 (10th Cir.1996)). The court explained that a debt is “valid and enforceable” pre-petition when liability has attached to the debt as of the petition date. Id. Further, the court noted “a debt for which liability attaches, although the amount remains unascertained, is nonetheless subject to setoff.” Id. Although the BAP differentiated between the “absolutely owed” standard and the “valid and enforceable” standard, we perceive no such difference. A debt arises pre-petition under the first element of § 553 when liability has attached to the debt (i.e., when an *674enforceable right to payment exists) at the time the debtor files for bankruptcy regardless of whether the debt is unmatured, contingent, or unliquidated. Id.; see also 11 U.S.C. §§ 101(12), (5)(A).
III.
In this case, the bankruptcy court held the FSA did not have an independent right of setoff outside bankruptcy and never reached the question of setoff under § 553. The court held Commodity Corp. regulations prohibited the FSA from setting off any debt owed to Debtors because of Debtors’ initial Chapter 7 discharge. We disagree. Commodity Corp. regulations provide federal agencies may use administrative setoff to collect debts owed to other agencies. See 7 C.F.R. § 1403.7(j)). Further, “[t]he existence of the federal government’s general common law setoff right has been well established for over a century.” 5 Collier on Bankruptcy ¶ 553.04[3]. Lastly, the terms of the PFC between Debtors and the Commodity Corp. provide “[o]ffsets for debts owed to agencies of the U.S. Government shall be made prior to making any [PFC] payments to producers or their assignees.” Thus, the FSA had an independent right of setoff outside of bankruptcy.
To effectuate a setoff in bankruptcy, however, the conditions of § 553 must be satisfied. Proceeding with an analysis of § 553, the BAP held the FSA did not have a pre-petition “claim” against Debtors, and thus could not setoff under the second element of § 553. Myers, 284 B.R. at 480. We do not reach the second element of § 553, however, because we con-elude the FSA (or the Commodity Corp.) did not owe a pre-petition debt to Debtors under the first element of § 553.7
The facts of this case are unique. The distinguishing factor from other § 553 cases is that Debtors filed two bankruptcy petitions. When Debtors filed their initial Chapter 12 bankruptcy petition (later converted to a Chapter 7), the PFC became a part of the bankruptcy estate and automatically terminated pursuant to Commodity Corp. regulations and the terms of the PFC. See 7 C.F.R. § 1412.201(b) (2002). Thereafter, neither the trustee nor Debtors assumed the PFC. See id.; see also 11 U.S.C. § 365(d)(1). At that juncture, the Commodity Corp. no longer owed Debtors any PFC payments, and thus, did not owe Debtors any debt. That Commodity Corp. made no PFC payments to Debtors in 1998 or 1999 confirms our conclusion.8
As a result of the PFC’s termination and Debtors’ failure to assume the PFC after filing their first bankruptcy petition, no debt or liability existed under the PFC at the time Debtors filed their second bankruptcy petition in March 2000. In other words, a “right to payment” did not exist nor was a debt “absolutely owed” under the PFC at the time Debtors filed their second Chapter 12 bankruptcy petition. See 11 U.S.C. §§ 101(12), (5)(A); Johnson, 501 U.S. at 83, 111 S.Ct. 2150; Gerth, 991 F.2d at 1433. Instead, the Commodity Corp.’s debt under the PFC only arose when the bankruptcy court entered a stipulated order, approved by the Commodity Corp., authorizing Debtors to assume the PFC in July 2000. At that point, the Commodity Corp. again owed a debt to *675Debtors. The stipulated order, however, did not take effect until after Debtors commenced their second Chapter 12 bankruptcy case. Thus, because Commodity Corp.’s debt under the PFC did not “arise before the commencement of’ Debtors’ second bankruptcy case, the debt is post-petition and not subject to setoff under the first element of § 553.
Other setoff cases in which courts considered a debt pre-petition are distinguishable from this case because those cases involved only one bankruptcy petition. See e.g., Gerth, 991 F.2d at 1435; Buckner, 218 B.R. at 148; Ratliff, 79 B.R. at 930-31. As such, the post-petition debt in those cases related back to the pre-petition exec-utory contracts because the contracts were in existence and a right to payment existed at the time the debtors filed their bankruptcy petitions. Here, the facts are materially different: Debtors’ first bankruptcy petition resulted in the termination of the PFC and Debtors failed to assume the contract. Thus, the PFC was not in effect and a right to payment did not exist at the time Debtors filed their second bankruptcy petition under Chapter 12. Consequently, the Commodity Corp.’s debt was not “absolutely owed” to Debtors pre-petition.
We acknowledge that the bankruptcy court’s July 2000 stipulated order allowing Debtors to assume the “successor in interest” PFC provides “the June 18, 1996 date of the Production Flexibility Contract shall be applicable and govern as to the right of offset for debts owed to agencies of the U.S. Government.” Any attempt, however, to relate the debt arising from the July 2000 successor-in-interest PFC back to 1996 is ineffectual under the facts presented. First, the parties specifically stipulated the order should not be “construed as an admission by Debtors that there are any rights of setoff or recoupment.” Second, the clause fails to recognize Debtors filed two bankruptcy petitions. Again, because of the PFC’s termination resulting from Debtors first bankruptcy petition and Debtors’ failure to assume the PFC prior to filing their second bankruptcy petition, the Commodity Corp. did not owe any debt, and no liability existed, at the time Debtors filed their second bankruptcy petition. In Federal Deposit Ins. Corp. v. Liberty Nat’l Bank & Trust, 806 F.2d 961, 967 (10th Cir.1986), we explained the right of setoff is governed by the “state of things existing” at the moment the debtor files for bankruptcy, “not by conditions thereafter arising.” Thus, the 1996 date included in the July 2000 order cannot change the fact that a debt was not “absolutely owed” when Debtors filed their second Chapter 12 bankruptcy petition in March 2000. Third, we will not read the clause in a manner that would displace the Bankruptcy Code and case law which require, at a minimum, a debt to exist at the time a bankruptcy petition is filed. See Forbes Fed. Credit Union v. National Credit Union Admin., 477 F.2d 777, 784 (10th Cir.1973). The FSA thus fails to satisfy the first element of § 553 and is precluded from setting off the Commodity Corp.’s post-petition debt.
Based on the foregoing, the BAP’s denial of FSA’s motion to lift the automatic stay is AFFIRMED. The case is REMANDED to the Bankruptcy Court for further proceedings not inconsistent with this opinion.