Skip to main content
POST
Deposit into a vault from a Smart Account

Authorizations

Authorization
string
header
required

A JWT signed using the developer's own JWT private key (in the case of JWT authentication), or an end user JWT signed by CDP, encoded in base64. This is used for End User Account APIs.

Headers

X-Wallet-Auth
string
required

A JWT signed using your Wallet Secret, encoded in base64. Refer to the Generate Wallet Token section of our Authentication docs for more details on how to generate your Wallet Token.

Path Parameters

userId
string
required

The ID of the end user.

Pattern: ^[a-zA-Z0-9-]{1,100}$
address
string
required

The 0x-prefixed address of the EVM Smart Account to deposit from. A blockchain address. Format varies by network (e.g., 0x-prefixed for EVM, base58 for Solana).

Required string length: 1 - 128
Pattern: ^0x[0-9a-fA-F]{40}$
Example:

"0x742d35Cc6634C0532925a3b844Bc454e4438f44e"

Query Parameters

projectID
string

The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).

Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
Example:

"8e03978e-40d5-43e8-bc93-6894a57f9324"

Body

application/json

A request to deposit the vault's underlying asset (e.g. USDC) into a vault from an end user's EVM Smart Account. The token approval and deposit are batched into a single user operation.

vaultId
string
required

The globally unique ID of the vault, which is a UUID prefixed with the string vault_.

Pattern: ^vault_[a-f0-9-]{36}$
Example:

"vault_019f5f10-096a-7a23-86df-f479650d813f"

amount
string
required

The amount of the vault's underlying asset to deposit, as a decimal string in standard unit denomination of the asset (i.e. "25.50" for 25.50 USDC).

Pattern: ^\+?(?:(?:0*[1-9]\d*)(?:\.\d*)?|0*\.\d*[1-9]\d*)$
Example:

"25.50"

receiver
string

The 0x-prefixed address that receives the minted vault shares. Defaults to the depositing account given in the path.

Required string length: 1 - 128
Pattern: ^0x[0-9a-fA-F]{40}$
Example:

"0x1234567890123456789012345678901234567890"

walletSecretId
string

The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.

Pattern: ^[a-zA-Z0-9-]{1,100}$
Example:

"e051beeb-7163-4527-a5b6-35e301529ff2"

useCdpPaymaster
boolean

Whether to use CDP Paymaster to sponsor gas fees. When true, the user operation gas will be paid by the Paymaster, allowing users to deposit without holding native gas tokens. Cannot be used together with paymasterUrl.

Example:

true

paymasterUrl
string<uri>

Optional custom Paymaster URL to use for gas sponsorship. This allows you to use your own Paymaster service instead of CDP's Paymaster. Cannot be used together with useCdpPaymaster.

Required string length: 11 - 2048
Pattern: ^https?://.*$
Example:

"https://api.developer.coinbase.com/rpc/v1/base/AbCdEf123456"

paymasterContext
object

The ERC-7677 context object forwarded to the paymaster service as part of the paymasterService capability. The fields in this object are defined by the paymaster service provider; CDP forwards them to the paymaster unchanged. This field is only valid when a paymaster is configured for the request. Providing paymasterContext without a paymaster configured results in an invalid_request error.

Example:

Response

Successfully broadcast the deposit user operation.

The result of a vault deposit from an EVM Smart Account after broadcast.

userOpHash
string
required

The hash of the user operation executing the deposit, as a 0x-prefixed hex string. Poll getUserOperationWithEndUserAccount for the operation's status.

Pattern: ^0x[0-9a-fA-F]{64}$
Example:

"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"