Portfolio Positions
by vaults.fyi in Onchain & crypto
Provides all vault positions for the user, with optional filters.
https://api.vaults.fyi/v2/portfolio/positions/:userAddress- Price
- $0.01
- per call in USDC
- Uptime
- 0.0%
- last 30 days
- Response time
- -
- no timed checks yet
- Last check
- Failed
- 5 h ago, next any minute now
Reliability
Latest check failed 5 h ago: Expected HTTP 402, got 400
Status and outage history · Atom feed · Watch with other listings
How to call it
GET https://api.vaults.fyi/v2/portfolio/positions/:userAddress
Each call costs $0.01 in USDC on Base, paid with the request over x402.
Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.
Example request
From the listing.
GET https://api.vaults.fyi/v2/portfolio/positions/:userAddress?apyInterval=7day&minTvl=100000&minUsdAssetValueThreshold=1Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
allowCorrupted | boolean | No | Allow inclusion of corrupted vaults. Default: false. |
allowVaultsWithWarnings | boolean | No | Whether to include vaults with warnings. Defaults to true. |
allowedAssets | array of string | No | Assets to be included by symbol(ticker). |
allowedNetworks | array of string | No | Networks to be included (name or CAIP). Default: ["base","mainnet","arbitrum","optimism"]. |
allowedProtocols | array of string | No | Protocols to be included by protocol ID or name. |
apyInterval | string | No | Interval for APY data. Possible values: 1day, 7day, 30day One of: 1day, 7day, 30day. Default: "7day". |
curators | array of string | No | Curators to be included. |
disallowedAssets | array of string | No | Assets to be excluded by symbol(ticker). The parameter is ignored if "allowedAssets" is specified. |
disallowedNetworks | array of string | No | Networks to be excluded (name or CAIP). The parameter is ignored if "allowedNetworks" is specified. |
disallowedProtocols | array of string | No | Protocols to be excluded by protocol ID or name. The parameter is ignored if "allowedProtocols" is specified. |
maxApy | number | No | Maximum APY (in decimal) of the vaults to be included |
maxTvl | integer | No | Maximum TVL in USD of the vaults to be included |
minApy | number | No | Minimum APY (in decimal) of the vaults to be included |
minTvl | integer | No | Minimum TVL in USD of the vaults to be included Default: 100000. |
minUsdAssetValueThreshold | number | No | Minimum USD value of the vault to be included Default: 1. |
minVaultScore | number | No | Minimum vault score required for a vault to be included |
onlyAppFeatured | boolean | No | Include only vaults that are featured in app.vaults.fyi |
onlyTransactional | boolean | No | Include only vaults that are supported in the transactional interface. |
sortBy | string | No | Field to sort by. One of: balanceUsd, tvl, apy1Day, apy7Day, apy30Day. |
sortOrder | string | No | Sort order, either asc or desc. Ascending is default. One of: asc, desc. Default: "asc". |
tags | array of string | No | Tags to be included. |
Example response
The listing has no example response.
Call it from code
The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.01.
curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i 'https://api.vaults.fyi/v2/portfolio/positions/:userAddress?apyInterval=7day&minTvl=100000&minUsdAssetValueThreshold=1'
# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - 'https://api.vaults.fyi/v2/portfolio/positions/:userAddress?apyInterval=7day&minTvl=100000&minUsdAssetValueThreshold=1' \
| grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decodeJavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
// Pays at most $0.01 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.01" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.01 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.vaults.fyi%2Fv2%2Fportfolio%2Fpositions%2F%3AuserAddress
const res = await pay("https://api.vaults.fyi/v2/portfolio/positions/:userAddress?apyInterval=7day&minTvl=100000&minUsdAssetValueThreshold=1");
console.log(res.status, await res.text());Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
# Pays at most $0.01 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.01"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))
with x402_requests(client) as session:
res = session.get("https://api.vaults.fyi/v2/portfolio/positions/:userAddress?apyInterval=7day&minTvl=100000&minUsdAssetValueThreshold=1")
print(res.status_code, res.text)Security scan
No findings
We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 5 h ago | Expected HTTP 402, got 400 | 400 | 169 ms | - |
| 10 h ago | Expected HTTP 402, got 400 | 400 | 216 ms | - |
| 15 h ago | Expected HTTP 402, got 400 | 400 | 220 ms | - |
| 19 h ago | Expected HTTP 402, got 400 | 400 | 241 ms | - |
| 24 h ago | Expected HTTP 402, got 400 | 400 | 383 ms | - |
Show 10 older checks
| 28 h ago | Expected HTTP 402, got 400 | 400 | 386 ms | - |
| 33 h ago | Expected HTTP 402, got 400 | 400 | 232 ms | - |
| 37 h ago | Expected HTTP 402, got 400 | 400 | 275 ms | - |
| 42 h ago | Expected HTTP 402, got 400 | 400 | 207 ms | - |
| 47 h ago | Expected HTTP 402, got 400 | 400 | 211 ms | - |
| 2 days ago | Expected HTTP 402, got 400 | 400 | 398 ms | - |
| 2 days ago | Expected HTTP 402, got 400 | 400 | 245 ms | - |
| 3 days ago | Expected HTTP 402, got 400 | 400 | 383 ms | - |
| 3 days ago | Expected HTTP 402, got 400 | 400 | 184 ms | - |
| 3 days ago | Expected HTTP 402, got 400 | 400 | 198 ms | - |