Back to Contract Explorer

BorrowingFacet

core

Borrows assets from lending pools into the Smart Loan account. Requires sufficient collateral to maintain a health ratio above 1.0. Borrow transactions must include RedStone price data.

Functions (2)

Usage Example

typescript
import { WrapperBuilder } from "@redstone-finance/evm-connector";

const tokenId = keccak256(encodePacked(["string"], ["WETH"]));
const borrowAmount = parseEther("0.5"); // 0.5 WETH

// Wrap with RedStone price data (required for solvency check)
const wrappedContract = WrapperBuilder
  .wrap(contract)
  .usingDataService({
    dataServiceId: "redstone-arbitrum-prod",
    uniqueSignersCount: 3,
  });

await wrappedContract.borrow(tokenId, borrowAmount);