Getting a Loan
This guide walks through the complete process of getting a Bitcoin-backed loan using the SDK.Overview
The loan process involves:- Quote - Get available loan quotes
- Borrow - Execute the loan; the SDK prepares wallet/session state automatically
- Deposit - Send Bitcoin collateral
- Complete - Receive borrowed stablecoins
Prerequisites
Recommended Flow
Use the explicit borrow flow so your UI can show quotes, fees, and a final review before creating the borrow workflow:Optional: Setup
setup() when you want to preload account state for a dashboard. You can skip it for a borrow-only path; executeBorrow() prepares the required platform wallet, loan wallet, and session automatically.
Step 2: Get Quotes
Step 3: Select Quote
Step 3a: Fetch Fees for the Selected Quote
CallgetQuoteFees() to get the bridge fees and the borrow-side breakdown (platform fee, applied disbursement bps, campaign waiver, net loan amount):
Step 4: Start New Loan
Step 5: Execute Borrow
Step 6: Track Workflow
Understanding Quotes
A quote contains:Quote Selection Strategies
Loan Parameters
Collateral Amount
The amount of BTC you’re willing to put up as collateral:Loan Amount
The USD value you want to borrow:Loan-to-Value (LTV)
The ratio of loan amount to collateral value. For example, borrowing$7,000 against $10,000 of BTC collateral is 70% LTV.
Handling the Deposit
WhenonDepositReady fires, you need to send BTC to the provided address:
Manual Deposit
Display the deposit info to the user:Programmatic Deposit
If your wallet supports sending:Monitoring Progress
Status Updates
Progress Stages
Failure and recovery stages include
FAILED, DISBURSEMENT_FAILED,
CANCELLED, REFUND_INITIATED, and REFUND_COMPLETED. See
Workflows for terminal-stage behavior.