Go to article content

Badgerdao: Closing eBTC CDPs to Release stETH

Last updated -

BadgerDAO's deprecated eBTC product lets owners close active collateralized debt positions (CDPs) by repaying their full eBTC debt, subject to protocol conditions. Successful closure releases each position's available stETH collateral on Ethereum. BadgerDAO has retired its eBTC web interface and documents direct contract access through Etherscan.

Assets and network
eBTC debt backed by Lido's stETH collateral on Ethereum.
Position scope
Each CDP has its own ID, debt, and collateral. One Ethereum account can own multiple CDPs.
Repayment check
The withdrawal manual asks for an eBTC wallet balance greater than the debt queried for the selected CDP. The documented implementation requires a balance at least equal to the debt after accounting synchronization, including pending redistributed debt.
Interface status
BadgerDAO's eBTC frontend is unavailable following its announced retirement after June 30, 2025. Direct contract access remains available.

Debt and collateral accounting

A CDP's debt and collateral are separate from the owner's transferable eBTC wallet balance. Holding eBTC alone does not establish ownership of a borrowing position. Moving borrowed tokens to another account does not settle the original CDP's debt.

The eBTC protocol README describes Ethereum contracts that hold the application logic and position data. The CDP manager handles debt accounting, while borrower operations coordinate owner actions and token movements. A debt reading measures eBTC owed; it cannot determine the amount of stETH that closure will release.


Contract reads and CDP closure

BadgerDAO's June 11, 2025 UI sunset announcement directed users toward contract interaction after June 30, 2025. Its withdrawal manual separates position and balance queries from the transaction that closes a CDP.

CDP closure depends on protocol conditions. The documented implementation rejects closure during Recovery Mode, when the system's total collateralization ratio is below 125%. It also rejects a closure that would lower this ratio below 125% or close the system's last active CDP. A funded wallet alone therefore does not establish that a particular closure can execute.

  1. Read the sorted-CDP contract for the IDs that belong to the owning Ethereum address. Select the CDP that you intend to close.
  2. Pass that ID to the CDP manager's debt query. Read the selected CDP's full debt, including pending redistributed debt. The documented getCdpDebt query returns cached debt without that pending amount.
  3. Query balanceOf in the eBTC token contract using the owner's address. Compare the balance and debt in the same token units. The manual asks for a balance above the queried debt; obtain additional eBTC if needed to cover the full synchronized debt at execution.
  4. Connect the owning wallet to borrower operations and submit the closure call with the selected CDP ID. The protocol README names this operation closeCdp ; use the function exposed by the verified deployed interface.

A wallet signature or transaction submission alone does not establish completion. Successful execution burns the eBTC tokens that repay the debt and releases the position's available stETH. Confirm the successful transaction and collateral transfer onchain.

Closing one CDP does not close every position owned by the same account. Repeat the position-specific debt, balance, and closure checks for each additional CDP that you intend to close.

Diagram: Badgerdao: Closing eBTC CDPs to Release stETH

Badgerdao: Closing eBTC CDPs to Release stETH

  • Debt and collateral accounting
  • Contract reads and CDP closure
  • A hypothetical balance shortfall

View full-size image


A hypothetical balance shortfall

A wallet below the selected CDP's debt cannot fund full repayment. All amounts here are hypothetical: selected CDP debt: 0.173 eBTC; owner's wallet balance: 0.128 eBTC. The funding gap is 0.173 - 0.128 = 0.045 eBTC .

With debt unchanged, adding exactly 0.045 eBTC would match it; the manual asks for a balance above that queried debt. A higher debt reading increases the gap, while additional eBTC reduces it. This calculation measures an eBTC funding gap, without estimating returned stETH or establishing that protocol conditions permit closure.