Skip to main content
Crypto-Backed Loans lets users post crypto as collateral and borrow against it, through Aave V3, Morpho Blue or Euler V2. One call supplies the collateral and borrows in a single transaction. Another repays and withdraws. The API tracks collateral, debt, rates and the health factor, so you can show users where they stand. Loans run on Ethereum, Base, Arbitrum, HyperEVM and BNB Smart Chain. Not every protocol is on every chain. See Supported Chains.

Before you start

1. Pick a market

Every request names the lending protocol with protocol. It defaults to AAVE. For example, list the Aave markets on Base:

2. Borrow

Supply 1,000 USDC as collateral and borrow 0.2 WETH on Aave, in one transaction:
The user signs transaction and sends it. To pay the loan out to the user’s wallet, call transfer with action: "WITHDRAW". This works while the loan is open. See Withdraw Funds.

3. Track the loan

The health factor is the distance to liquidation. Above 1 is safe. Below 1, anyone can liquidate the position on-chain. Show it in your UI and alert users when it gets close to 1.

4. Repay

Repay 0.2 WETH and withdraw the 1,000 USDC collateral in one transaction:
The Credit Account must hold the repay_token. Interest accrues on the debt every block, so read amount_borrowed from debt_positions right before you build the repayment. Leave out withdraw_token and withdraw_amount to repay without withdrawing. Set token_out to have the withdrawn collateral swapped into another token. Afterwards, send the collateral to the user’s wallet with transfer. See Withdraw Funds.

Good to know

  • Morpho and Euler. Send protocol: "MORPHO" with the market_id, or protocol: "EULER" with collateral_vault and borrow_vault, on borrow and repay alike. On Morpho, collateral_token and borrow_token must be the market’s own pair. An identifier that doesn’t match the protocol, such as a market_id on Aave, returns 422.
  • On HyperEVM, AAVE and MORPHO select the chain’s equivalent lending venues. Nothing else changes.
  • Several Euler loans in one account. Euler allows one borrow market per account, so give each extra loan its own sub_account_id (1 to 255) and pass the same id when you repay. Positions report the id they live in.
  • Supply collateral without borrowing. Use bundle with a CREDIT_SUPPLY action. Bundles also combine supply, borrow, repay, withdraw, swap and transfer actions into one transaction.
  • Leverage. To multiply a position by supplying, borrowing and swapping in a loop, see Leveraged Looping.
  • Errors. Credit endpoints return 400 Credit Account not deployed until the account exists on that chain. Calling a protocol on a chain that doesn’t have it returns 422 with the chains that do.

Endpoints

Next

Leveraged Looping

Open and unwind leveraged positions in one transaction.

Embedded Fees

Earn a fee on every loan.

Gas Sponsorship

Pay gas for your users so they never need ETH.