Skip to main content

Depositing More Collateral

depositMore() adds collateral to an existing loan. The new collateral is bridged from Bitcoin and deposited into the same position, lowering the loan’s LTV and improving its health factor. No new debt is taken.

Prerequisites

import { BorrowSDK } from '@satsterminal/sdk';

const sdk = new BorrowSDK({
  apiKey: process.env.SATS_API_KEY,
  walletProvider,
});
You need the originalBorrowId of an active loan.

Add collateral

const result = await sdk.depositMore(loanId, '0.01', {
  trackWorkflow: true,
  callbacks: {
    onStatusUpdate: (status) => console.log(status.label),
    onDepositReady: (info) =>
      console.log(`Send ${info.amountBTC} BTC to ${info.address}`),
    onComplete: () => console.log('Collateral added!'),
    onError: (error) => console.error(error),
  },
});

console.log('Deposit more transaction:', result.transactionId);
collateralAmount is denominated in BTC. Like the initial loan, the flow bridges BTC into the loan’s collateral asset before depositing, so the onDepositReady callback surfaces the Bitcoin deposit address and amount.

Workflow stages

StageDescription
AWAITING_DEPOSITWaiting for the BTC deposit
DEPOSIT_CONFIRMEDBridge deposit confirmed
COLLATERAL_DEPOSITEDCollateral added to the position
COMPLETEDWorkflow finished
Because no borrow occurs, deposit-more never runs a disbursement step.

Monitoring status

const status = await sdk.getDepositMoreStatus(result.transactionId);
console.log(status.status);

// All deposit-more transactions for a loan:
const history = await sdk.getDepositMoreTransactions(loanId);

Minimum amount

The Bitcoin bridge requires at least 0.0001 BTC (10,000 satoshis) per deposit.
Adding collateral increases your available borrow room. Afterwards you can draw more against the position with borrowMore().