Skip to main content

Managing Collateral

This guide covers collateral management including checking balances, withdrawing collateral, and understanding health factors.

Understanding Collateral

When you take a loan, your Bitcoin is locked as collateral:
  • Total Collateral - All BTC locked for the loan
  • Available Collateral - Collateral not at risk of liquidation
  • Max Withdrawable - Maximum you can withdraw safely

Checking Collateral Info

LoanCollateralInfo Interface

Withdrawing Collateral

Prerequisites

Before withdrawing:
  1. Check maxWithdrawable amount
  2. Ensure withdrawal won’t trigger liquidation
  3. Have a valid BTC address ready

Basic Withdrawal

You do not need to call setup() before withdrawing collateral. withdrawCollateral() prepares the platform wallet address/signature automatically if needed.

Maximum Safe Withdrawal

Withdrawal with Repayment

Withdraw collateral while repaying part of the loan:

Withdrawal Workflow

The withdrawal process involves bridging BTC from the EVM chain:

Monitoring Withdrawal Status

Track Active Withdrawal

Check Status Later

Health Factor Considerations

What is Health Factor?

Health Factor = (Collateral Value × Liquidation Threshold) / Debt

Calculating Safe Withdrawal

Error Handling

Common Errors

Validation Before Withdrawal

Complete Example

Best Practices

1. Always Check Max Withdrawable First

2. Leave a Safety Buffer

3. Verify BTC Address

4. Handle Bridge Delays

5. Monitor After Withdrawal