Withdraw

Withdraw Bitcoin

Guide

Withdrawing Bitcoin allows you to reclaim your collateral from the BitFire protocol. It reduces your borrowing capacity and ensures that you maintain control over your BTC — all while complying with the protocol’s risk parameters.

When you withdraw BTC:

  • Your Bitcoin collateral is released from the protocol.

  • The withdrawal reduces your borrowing power but keeps your account healthy.

  • You retain full ownership of your Bitcoin and can redeploy it or hold it in your wallet.

By withdrawing BTC, you regain access to your assets and maintain flexibility in managing your positions, while ensuring your account remains safe from liquidation risks.


Product Demo

1. Click “Withdraw”

Navigate to the BitFire dashboard and select the “Withdraw” option.

2. Select Asset and Amount

  • Choose Bitcoin (BTC) as the asset.

  • Enter the amount of BTC you want to withdraw from your collateral.

3. Confirm Transaction

  • Review the withdrawal details, including the amount and your remaining collateral.

  • Click “Confirm” to complete the withdrawal. Your BTC is now returned to your wallet, and your borrowing power is adjusted accordingly.


Contract Interface

/**
* @dev Emitted on withdraw()
* @param reserve The address of the underlying asset being withdrawn
* @param user The address initiating the withdrawal, owner of bTokens
* @param to The address that will receive the underlying
* @param amount The amount to be withdrawn
*/
event Withdraw(
   address indexed reserve,
   address indexed user,
   address indexed to,
   uint256 amount
);
/**
* @notice Withdraws an `amount` of underlying asset from the reserve, burning the equivalent bTokens owned
* E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC
* @param asset The address of the underlying asset to withdraw
* @param amount The underlying amount to be withdrawn
*   - Send the value type(uint256).max in order to withdraw the whole bToken balance
* @param to The address that will receive the underlying, same as msg.sender if the user
*   wants to receive it on his own wallet, or a different address if the beneficiary is a
*   different wallet
* @return The final amount withdrawn
*/
function withdraw(
   address asset,
   uint256 amount,
   address to
) external returns (uint256);

Last updated