Skip to main content

Withdraw funds

Redeem vault shares and return assets — plus any accrued yield — to the wallet using the withdraw endpoint. The returned asset_amount reflects the original deposit plus yield earned.

Partial and full withdrawals

Your app can withdraw any amount up to the wallet’s current assets_in_vault balance. To withdraw everything, query the wallet’s position first and pass the full assets_in_vault value as the asset_amount. Because yield accrues continuously, the redeemable balance may be slightly higher at withdrawal time than when the position was last queried.
For a full withdrawal, your app can read the wallet’s assets_in_vault from the position endpoint and pass that value directly. Any additional yield accrued between the query and the withdrawal will remain in the vault as residual shares.

Liquidity considerations

Withdrawals depend on available liquidity in the underlying vault. If the vault’s lending markets are fully utilized, a withdrawal may partially fill or fail. Your app should check the vault’s available_liquidity_usd from the get vault details endpoint before initiating large withdrawals.

Usage

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

Parameters

vault_id
string
required
The unique identifier for the vault.
asset_amount
string
required
Amount to withdraw in the token’s smallest unit.
Wallets with owner_id present must provide an authorization signature as a request header for withdraw 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 receiving the withdrawn funds.
vault_id
string
The ID of the vault being withdrawn from.
type
string
The operation type. Always "withdraw" for this endpoint.
status
'pending' | 'confirmed' | 'failed'
The current status of the withdrawal operation.
asset_amount
string
Amount withdrawn in the token’s smallest unit, including accrued yield.
share_amount
string | null
Vault shares redeemed. null while the operation is pending.

Example

curl -X POST https://auth.privy.io/api/v1/wallets/{wallet_id}/ethereum_yield_withdraw \
  -H "privy-app-id: <your-app-id>" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -d '{
    "vault_id": "<your-vault-id>",
    "asset_amount": "1050000"
  }'
Example response
{
  "id": "<your-vault-id>",
  "wallet_id": "<your-wallet-id>",
  "vault_id": "<your-vault-id>",
  "type": "withdraw",
  "status": "pending",
  "asset_amount": "1050000",
  "share_amount": null,
  "created_at": 1631573050000,
  "updated_at": 1631573050000
}
Track the withdrawal by polling get sweep by ID or listening for the yield.withdraw.confirmed webhook.

Claim reward incentives

Some vaults distribute additional token incentives on top of base yield. Collect these with the claim endpoint. Claims operate at the chain level — pass a CAIP-2 identifier rather than a vault ID. For apps with multiple vaults on the same chain, a single claim collects rewards across all vaults.

Usage

To claim rewards via REST API, make a POST request to:
https://auth.privy.io/api/v1/wallets/{wallet_id}/ethereum_yield_claim

Parameters

caip2
string
required
Chain identifier in CAIP-2 format (e.g., eip155:8453 for Base). Claims collect rewards across all vaults on the specified chain.
Wallets with owner_id present must provide an authorization signature as a request header for claim operations.

Returns

id
string
The claim operation ID. Use this to poll status with get claim by ID.
caip2
string
The chain identifier for the claim.
status
'pending' | 'confirmed' | 'failed'
The current status of the claim operation.
rewards
array
List of rewards claimed, each with token_address, token_symbol, and amount.

Example

curl -X POST https://auth.privy.io/api/v1/wallets/{wallet_id}/ethereum_yield_claim \
  -H "privy-app-id: <your-app-id>" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -d '{
    "caip2": "eip155:8453"
  }'
Example response
{
  "id": "<your-claim-id>",
  "caip2": "eip155:8453",
  "status": "pending",
  "rewards": [
    {
      "token_address": "0x1234567890abcdef1234567890abcdef12345678",
      "token_symbol": "MORPHO",
      "amount": "115631364898103632676"
    }
  ],
  "created_at": 1631573050000,
  "updated_at": 1631573050000
}
Claiming rewards is separate from withdrawing yield. To realize deposit earnings, use the withdraw endpoint. Claiming does not affect withdrawals or ongoing earnings.

Next steps

Setup

Deploy a fee wrapper and configure a vault.

Deposit funds

Deposit assets from a wallet into a yield vault.

Manage positions

Query vault positions and track activity with webhooks.