Skip to main content
CDP Wallets lets your end users earn yield on their USDC through a native DeFi Lend API. You create a vault on top of an approved vault, and your end users deposit USDC into it from their non-custodial wallets. You earn a performance fee on the yield that their deposits generate.

Create a vault

Set up a vault and your fee in CDP Portal

Deposit and withdraw

Users deposit USDC and withdraw it with accrued yield

Earn fees

Earn a share of the yield generated by your users’ deposits
Currently, Base Mainnet is the only supported network, USDC is the only supported asset, and Morpho is the only supported protocol.
Lend supports both EOAs and smart accounts. Deposits and withdrawals from a smart account are sent as user operations, so they support gas sponsorship. Deposits and withdrawals from an EOA are sent as a single transaction, and the EOA pays the gas.

Overview

How vaults work

A CDP Vault is a vault that wraps an approved, curated vault, such as Steakhouse USDC on Base. Curators allocate the vault’s deposits across lending markets, and the vault earns interest from borrowers in those markets. When you create a CDP Vault in CDP Portal, CDP deploys a vault onchain that wraps the curator vault. Your end users deposit USDC into your vault and receive vault shares. The value of each share grows as the underlying curator vault earns yield. When an end user withdraws, their shares are redeemed for USDC at the current share price. For example, if an end user deposits 100 USDC into a vault earning 5% APY, their position is worth about 105 USDC after one year, before your fees.

Fees

The yield a vault earns is subject to three layers of fees: Your performance fee and the CDP fee are both taken from the yield, never from your end users’ principal. For example, if you set a performance fee of 20% (2000 bps) on a vault earning 4.4% APY:
  • The CDP fee is 10% of your fee, or 2% of the yield.
  • Your APY is 4.4% × 20% = 0.88%, and CDP’s is 4.4% × 2% = 0.088%.
  • Your users earn 4.4% − 0.88% − 0.088% = 3.432% APY.
User APY=Vault APY−Your APY−CDP APY\text{User APY} = \text{Vault APY} - \text{Your APY} - \text{CDP APY} User APY=4.4%−0.88%−0.088%=3.432%\text{User APY} = 4.4\% - 0.88\% - 0.088\% = 3.432\%

Fee distribution

CDP distributes accrued fees once a day. Your share is sent to your fee recipient as vault shares, which you redeem for USDC whenever you choose. Your fee recipient must be an EVM account or EVM Smart Account in the same CDP project as the vault. If it’s a smart account, then its owner must be a CDP EVM account. Addresses outside your project are rejected. To use a wallet you already have, such as one from MetaMask or Phantom, first import its EVM private key into your project. The imported account keeps the same address.
Use a dedicated account as your fee recipient. Redeeming fees redeems the account’s entire share balance, including any shares from the account’s own deposits.

Create a vault

Create your vault in CDP Portal.
1

Open CDP Portal

Navigate to the DeFi tab in your project’s Embedded Wallets settings, and find the Lend integration section.
2

Configure the integration

Click Configure, then choose a Vault provider from the dropdown.
3

Set the recipient address

Enter the address of the EVM account or EVM Smart Account in your project that will receive your fees.
4

Set your yield cut

Choose your performance fee, from 0% to 45%. Portal shows the vault APY, your estimated APY, and your users’ estimated APY as you adjust it.
5

Create the vault

Click Create vault. CDP deploys the vault on Base, which usually takes under a minute.
6

Copy your vault ID

Once the vault is active, copy its vault ID (for example, vault_019f5f10-096a-7a23-86df-f479650d813f). Use this ID when depositing or withdrawing. You can also pass it in vaultIds to list positions in a specific vault.
After the vault is deployed onchain, you can copy its vault ID and use it in your app for end users to deposit, withdraw, and view their positions. If a deployment fails, you can retry with the same or different settings.

Integration

In React apps, use the hooks from @coinbase/cdp-hooks to let your end users deposit, view their positions, and withdraw. In other JavaScript apps, use the matching actions from @coinbase/cdp-core. The hooks track each operation until it completes onchain. The actions return the transactionHash or userOpHash as soon as the operation is submitted, so your app tracks it from there. For smart accounts, call getUserOperation to check the status.
Amounts are specified in human-readable decimal units (for example, "25.50" for 25.50 USDC), not atomic units. CDP converts them to atomic units using the asset’s decimals.

Deposit into a vault

Deposit USDC from an end user’s account into your vault. The end user receives vault shares in return.
The token approval and deposit are batched into a single user operation. useDepositToVaultFromEvmSmartAccount submits the user operation and monitors it onchain. status stays "pending" until the operation completes.
By default, the vault shares go to the depositing account. To send them to a different address, pass receiver.

List lend positions

View an end user’s positions in your project’s vaults. Each position includes the account’s vault share balance and its current value in USDC. Only non-zero positions are returned. useListLendPositions automatically fetches when the user is signed in and an evmAddress is provided.
When you omit vaultIds, positions are found from the vaults the account has deposited into through CDP. If an account received vault shares another way, such as a direct onchain deposit or a share transfer, pass the vault ID in vaultIds to include that position.

Withdraw from a vault

Withdraw USDC from an end user’s position. Pass amount to withdraw part of the position, or withdrawAll: true to redeem every share the account holds, including all accrued yield. Pass exactly one of the two.
By default, the USDC goes to the withdrawing account. To send it to a different address, pass receiver.

One operation at a time

An account can run one Lend operation at a time. If you start a deposit or withdrawal while another is still in progress for the same account, the request returns a 409. Wait for the first operation to complete before starting another. The account stays locked for 30 seconds after the request starts. If you still get a 409, wait a few seconds and try again.

Redeem your fees

CDP sends your share of the fees to your fee recipient as vault shares once a day. To convert them to USDC, call redeemVaultFees on your fee recipient account with the CDP SDK, or run lend redeem-fees with the CDP CLI. This redeems the account’s full share balance in the vault. If the account has no shares to redeem, the request returns a 400.
The approval and redemption are batched into a single user operation, so you can sponsor the gas with useCdpPaymaster or paymasterUrl.
The CLI uses the same API key and wallet secret as the SDK, and needs the wallet secret to sign the redemption. If you haven’t added it yet, run cdp env live --wallet-secret-file ./cdp_wallet_secret.txt. See the Server Wallet quickstart for CLI setup.

What to read next

  • Smart accounts: Sponsor gas for your end users’ deposits and withdrawals.
  • Borrow: Let your end users borrow against their crypto.
  • EVM policies: Control which transactions your project’s accounts can send.