Repay

Repay USDT/USDC/mUSD

Guide

Repaying a Bitcoin-backed loan in BitFire allows you to reduce or fully close your borrowing position, releasing your BTC collateral and maintaining control over your assets. Repayment is flexible and can be done at any time, helping you manage risk and optimize your account health.

When you repay:

  • You can choose partial or full repayment. Partial repayment reduces your debt and increases your available collateral, while full repayment closes the loan and unlocks all associated BTC.

  • Repayments include both principal and accrued interest, which is calculated dynamically based on utilization and your borrowing duration.

  • Timely repayment helps maintain a healthy health factor, minimizing liquidation risk and keeping your positions safe.

By repaying your loan, you regain flexibility and control, while ensuring your BTC remains productive and your account stays secure.

Product Demo

1. Click “Repay”

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

2. Select Asset and Amount

  • Choose the borrowed asset (e.g., USDT or USDC) you want to repay.

  • Enter the repayment amount, either partial or full.

3. Confirm Transaction

  • Review the repayment details, including principal, interest, and updated collateral.

  • Click “Confirm” to execute the repayment. Your BTC collateral is adjusted automatically based on the repaid amount.

Contract Interface

/**
* @dev Emitted on repay()
* @param reserve The address of the underlying asset of the reserve
* @param user The beneficiary of the repayment, getting his debt reduced
* @param repayer The address of the user initiating the repay(), providing the funds
* @param amount The amount repaid
* @param useBTokens True if the repayment is done using bTokens, `false` if done with underlying asset directly
*/
event Repay(
   address indexed reserve,
   address indexed user,
   address indexed repayer,
   uint256 amount,
   bool useBTokens
);
/**
* @notice Repays a borrowed `amount` on a specific reserve, burning the equivalent debt tokens owned
* - E.g. User repays 100 USDC, burning 100 variable/stable debt tokens of the `onBehalfOf` address
* @param asset The address of the borrowed underlying asset previously borrowed
* @param amount The amount to repay
* - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`
* @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
* @param onBehalfOf The address of the user who will get his debt reduced/removed. Should be the address of the
* user calling the function if he wants to reduce/remove his own debt, or the address of any other
* other borrower whose debt should be removed
* @return The final amount repaid
*/
function repay(
   address asset,
   uint256 amount,
   uint256 interestRateMode,
   address onBehalfOf
) external returns (uint256);

Last updated