Skip to main content
Deposit assets from a wallet into a vault using the deposit endpoint. Privy handles the ERC-20 approval and deposit in a single call. The wallet depositing funds and the admin wallet will receive shares corresponding to the fee share split.

Deposit flow

  1. Privy approves the vault to spend the specified amount of the wallet’s ERC-20 tokens.
  2. The vault converts the deposited assets into vault shares at the current share price.
  3. Shares are split between the depositing wallet and your app’s admin wallet based on the fee percentage configured during setup.
  4. The operation starts as pending and moves to confirmed once Privy verifies the transaction onchain.
The share_amount in the response is null while the operation is pending. Once confirmed, it reflects the number of shares minted to the depositing wallet. To see the admin wallet’s fee shares, query the admin wallet’s position.
The wallet must hold enough of the deposit token to cover the full asset_amount. If the balance is insufficient, the deposit fails. Your app should check the wallet’s token balance before initiating a deposit.

Usage

To deposit funds via REST API, make a POST request to:
https://auth.privy.io/api/v1/wallets/{wallet_id}/ethereum_yield_deposit

Parameters

vault_id
string
required
The unique identifier for the vault. Copy this from the Privy Dashboard after deploying a fee wrapper.
asset_amount
string
required
Amount to deposit in the token’s smallest unit. For USDC (6 decimals), "1000000" equals 1 USDC.
Wallets with owner_id present must provide an authorization signature as a request header for deposit operations.

Returns

id
string
The operation ID. Use this to poll status with get sweep by ID.
wallet_id
string
The ID of the wallet that deposited funds.
vault_id
string
The ID of the vault receiving the deposit.
type
string
The operation type. Always "deposit" for this endpoint.
status
'pending' | 'confirmed' | 'failed'
The current status of the deposit operation.
asset_amount
string
Amount deposited in the token’s smallest unit.
share_amount
string | null
Vault shares received. null while the operation is pending.

Example

curl -X POST https://auth.privy.io/api/v1/wallets/{wallet_id}/ethereum_yield_deposit \
  -H "privy-app-id: <your-app-id>" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -d '{
    "vault_id": "<your-vault-id>",
    "asset_amount": "1000000"
  }'
Example response
{
  "id": "<your-vault-id>",
  "wallet_id": "<your-wallet-id>",
  "vault_id": "<your-vault-id>",
  "type": "deposit",
  "status": "pending",
  "asset_amount": "1000000",
  "share_amount": null,
  "created_at": 1631573050000,
  "updated_at": 1631573050000
}
Poll the status with get sweep by ID, or listen for the yield.deposit.confirmed webhook to know when Privy confirms the deposit onchain.

Next steps

Setup

Deploy a fee wrapper and configure a vault.

Withdraw and claim

Withdraw deposited assets with accrued yield and claim reward incentives.

Manage positions

Query vault positions and track activity with webhooks.