You deposit bitcoin, you get stablecoin (e.g. USDC/USDT) that you can off ramp to bank dollars. You pay the right amount of stable coin back at the end of the loan term (all encoded programmatically) and you get your bitcoin back.