curl --request POST \
--url https://api.privy.io/v1/wallets/{wallet_id}/ethereum_yield_deposit \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '
{
"vault_id": "cm7oxq1el000e11o8iwp7d0d0",
"asset_amount": "1000000"
}
'HttpResponse<String> response = Unirest.post("https://api.privy.io/v1/wallets/{wallet_id}/ethereum_yield_deposit")
.header("privy-app-id", "<privy-app-id>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"vault_id\": \"cm7oxq1el000e11o8iwp7d0d0\",\n \"asset_amount\": \"1000000\"\n}")
.asString();const options = {
method: 'POST',
headers: {
'privy-app-id': '<privy-app-id>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({vault_id: 'cm7oxq1el000e11o8iwp7d0d0', asset_amount: '1000000'})
};
fetch('https://api.privy.io/v1/wallets/{wallet_id}/ethereum_yield_deposit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.privy.io/v1/wallets/{wallet_id}/ethereum_yield_deposit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'vault_id' => 'cm7oxq1el000e11o8iwp7d0d0',
'asset_amount' => '1000000'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"privy-app-id: <privy-app-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.privy.io/v1/wallets/{wallet_id}/ethereum_yield_deposit"
payload := strings.NewReader("{\n \"vault_id\": \"cm7oxq1el000e11o8iwp7d0d0\",\n \"asset_amount\": \"1000000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("privy-app-id", "<privy-app-id>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "cm7oxq1el000e11o8iwp7d0d0",
"wallet_id": "fmfdj6yqly31huorjqzq38zc",
"vault_id": "cm7oxq1el000e11o8iwp7d0d0",
"type": "deposit",
"status": "pending",
"asset_amount": "1000000",
"share_amount": "987654321",
"created_at": 1631573050000,
"updated_at": 1631573050000
}Deposit into vault
Deposit assets from a wallet into an ERC-4626 vault. This endpoint generates and broadcasts the necessary approval and deposit transactions.
curl --request POST \
--url https://api.privy.io/v1/wallets/{wallet_id}/ethereum_yield_deposit \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '
{
"vault_id": "cm7oxq1el000e11o8iwp7d0d0",
"asset_amount": "1000000"
}
'HttpResponse<String> response = Unirest.post("https://api.privy.io/v1/wallets/{wallet_id}/ethereum_yield_deposit")
.header("privy-app-id", "<privy-app-id>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"vault_id\": \"cm7oxq1el000e11o8iwp7d0d0\",\n \"asset_amount\": \"1000000\"\n}")
.asString();const options = {
method: 'POST',
headers: {
'privy-app-id': '<privy-app-id>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({vault_id: 'cm7oxq1el000e11o8iwp7d0d0', asset_amount: '1000000'})
};
fetch('https://api.privy.io/v1/wallets/{wallet_id}/ethereum_yield_deposit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.privy.io/v1/wallets/{wallet_id}/ethereum_yield_deposit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'vault_id' => 'cm7oxq1el000e11o8iwp7d0d0',
'asset_amount' => '1000000'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"privy-app-id: <privy-app-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.privy.io/v1/wallets/{wallet_id}/ethereum_yield_deposit"
payload := strings.NewReader("{\n \"vault_id\": \"cm7oxq1el000e11o8iwp7d0d0\",\n \"asset_amount\": \"1000000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("privy-app-id", "<privy-app-id>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "cm7oxq1el000e11o8iwp7d0d0",
"wallet_id": "fmfdj6yqly31huorjqzq38zc",
"vault_id": "cm7oxq1el000e11o8iwp7d0d0",
"type": "deposit",
"status": "pending",
"asset_amount": "1000000",
"share_amount": "987654321",
"created_at": 1631573050000,
"updated_at": 1631573050000
}Authorizations
Basic Auth header with your app ID as the username and your app secret as the password.
Headers
ID of your Privy app.
Request authorization signature. If multiple signatures are required, they should be comma separated.
Request expiry. Value is a Unix timestamp in milliseconds representing the deadline by which the request must be processed.
Idempotency keys ensure API requests are executed only once within a 24-hour window.
Path Parameters
ID of the wallet.
Body
Input for depositing assets into an ERC-4626 vault.
Response
Yield sweep created successfully.
A yield sweep record representing a deposit or withdrawal.
Unique identifier for the yield sweep.
The ID of the wallet involved in the sweep.
The ID of the vault involved in the sweep.
Type of yield sweep.
deposit, withdraw Status of a yield sweep.
pending, confirmed, failed The amount of underlying assets involved. Set after the sweep is confirmed on-chain.
The amount of vault shares involved. Set after the sweep is confirmed on-chain.
Unix timestamp of when the sweep was created, in milliseconds.
Unix timestamp of when the sweep was last updated, in milliseconds.
Was this page helpful?

