Skip to main content
CDP Wallets enables your end users to borrow against their crypto through a native DeFi Borrow API. An end user’s smart account opens a borrow position, by posting collateral and receiving a loan asset.

Post collateral

Users deposit crypto as collateral to secure a borrow position

Borrow assets

Receive a loan asset against posted collateral

Manage positions

Adjust collateral and debt over time
DeFi Borrow is available for user wallets and specifically smart accounts only. For EOAs, you can delegate your EOA to a smart account using EIP-7702.
Currently, Base Mainnet is the only supported network and Morpho Blue is the only supported protocol.

Overview

Collateralized borrowing

Protocols like Morpho Blue offer a variety of collateralized borrow products. Each product contains a collateral asset and loan pair (i.e. cbBTC / USDC). When an end user opens a borrow position, they deposit a fixed amount of collateral for a specific amount of a loan asset. For example, if an end user deposits 1 cbBTC and borrows 10,000 USDC, then they will lock 1 cbBTC as collateral and receive 10,000 USDC. The loan amount increases over time, according to the net borrow rate. If the net borrow rate is 5% APY, then a borrow position of 10,000 USDC will become 10,500 USDC after one year, if no repayments are made. The loan-to-value (LTV) is the collateral to debt ratio for the given borrow position. In this case, if 1 cbBTC is worth $80,000, then the LTV is 10,000 / 80,000 = 0.125 (i.e. 12.5%). LTV=Borrowed AmountCollateral Value (in Loan Token)=10,00080,000=0.125LTV = \frac{\text{Borrowed Amount}}{\text{Collateral Value (in Loan Token)}} = \frac{10{,}000}{80{,}000} = 0.125 If the price of Bitcoin falls to $11,000, the revised LTV is: LTV=10,00011,0000.909  (90.9%)LTV = \frac{10{,}000}{11{,}000} \approx 0.909 \; (90.9\%) The Liquidation Loan-to-Value (LLTV) is the maximum LTV threshold for a borrow position. If the LTV is greater than or equal to the LLTV, then the position is eligible for liquidation. This can result in the immediate loss of collateral assets supplied to the protocol. LTV=90.9%LLTV=86%    eligible for liquidationLTV = 90.9\% \geq LLTV = 86\% \implies \text{eligible for liquidation} To prevent liquidation, an end user can either repay debt to reduce their LTV, or they can add more collateral to bolster their position.

Capabilities

List borrow products

Browse available collateral/loan pairs and market parameters

Get a borrow product

Fetch details for a single product by its ID

Open a position

Post collateral and borrow a loan asset in a single atomic operation

Adjust a position

Add or withdraw collateral, repay debt or borrow more

Close a position

Fully repay debt and withdraw all collateral in one atomic operation

List positions

View collateral, debt, borrow APY, and health status
All borrow operations are executed through the end user’s smart account as user operations, so they support gas sponsorship and policy enforcement.

Origination fees

Origination fees are charged in the loan token (i.e. USDC).
Origination fees are configurable fees that are charged to an end user, every time they borrow a loan asset. When a user initially opens a borrow position, or when they borrow more of a loan asset, then they will be charged an origination fee. In the CDP Portal, you can configure the origination fee you wish to charge, as well as the fee recipient wallet address. For example, an origination fee of 100 bps will incur a 0.10 USDC fee when a user borrows 100 USDC. Additionally, CDP will charge a flat origination fee of 25 bps. In this case, if a user borrows 100 USDC, then they will be charged 0.025 USDC from CDP and 0.10 USDC from the fee recipient, for a total fee of 0.125 USDC.
1

Open CDP Portal

Navigate to your project’s Origination Fee settings in CDP Portal.
2

Set the fee rate

Enter the fee rate in basis points (e.g., 100 for 1%).
3

Set the recipient address

Enter the EVM wallet address that will receive your developer fee.
4

Save

The fee is applied automatically on every borrow action through your project.

Integration

List borrow products

Before opening a position, list the available borrow products to find a collateral/loan pair. Each product includes its assets, protocol details (LLTV, oracle, IRM address), and a snapshot of the onchain market state at observation time. useListEvmBorrowProducts automatically fetches when the user is signed in and both network and protocol are provided.

Get a borrow product

Fetch the full details of a specific borrow product by its ID, including venue, assets with capabilities, and Morpho Blue market parameters.

List borrow positions

View the borrow positions held by a smart account. Each position includes collateral balances, outstanding debt, borrow APY, and health status (healthy, undercollateralized, or no debt). useListBorrowPositions automatically fetches when the user is signed in and a smart account address is provided.

Open a borrow position

Create a borrow position by posting collateral and borrowing a loan asset against a borrow product in a single user operation. The smart account must hold enough of the collateral token to cover the deposit.
Amounts are specified in human-readable decimal units (for example, "1" for 1 cbBTC, "100" for 100 USDC), not atomic units. CDP converts them to atomic units internally using each token’s decimals.
useCreateBorrowPosition submits the user operation and automatically monitors it onchain. status stays "pending" until the operation is confirmed.
Only one borrow position can exist per smart account per borrow product. If a position already exists, the request returns a 409. Use the adjust endpoint to modify it instead.

Adjust a borrow position

Adjust an existing position to add collateral, withdraw collateral, repay debt, or borrow more. You can perform one operation at a time, or combine certain pairs in a single request:

Add collateral + Borrow more

Supply collateral and borrow against it in one operation

Repay loan + Remove collateral

Repay debt and withdraw collateral in one operation
All other combinations are rejected. At least one amount must be supplied.

Close a borrow position

Close a position by fully repaying the outstanding debt and withdrawing all remaining collateral in a single user operation. There is no partial close. To adjust without closing, use the adjust endpoint instead.
The smart account must hold enough of the loan token to repay the full debt amount.