15trust / 100

Portfolio Positions

by vaults.fyi in Onchain & crypto

x402 APIFailing, checked 5 h ago

Provides all vault positions for the user, with optional filters.

GET
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

Run a free test callHow to call it

Reliability

All checks passedSome failedAll failedNot checked

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=1

Parameters

ParameterTypeRequiredDescription
allowCorruptedbooleanNoAllow inclusion of corrupted vaults. Default: false.
allowVaultsWithWarningsbooleanNoWhether to include vaults with warnings. Defaults to true.
allowedAssetsarray of stringNoAssets to be included by symbol(ticker).
allowedNetworksarray of stringNoNetworks to be included (name or CAIP). Default: ["base","mainnet","arbitrum","optimism"].
allowedProtocolsarray of stringNoProtocols to be included by protocol ID or name.
apyIntervalstringNoInterval for APY data. Possible values: 1day, 7day, 30day One of: 1day, 7day, 30day. Default: "7day".
curatorsarray of stringNoCurators to be included.
disallowedAssetsarray of stringNoAssets to be excluded by symbol(ticker). The parameter is ignored if "allowedAssets" is specified.
disallowedNetworksarray of stringNoNetworks to be excluded (name or CAIP). The parameter is ignored if "allowedNetworks" is specified.
disallowedProtocolsarray of stringNoProtocols to be excluded by protocol ID or name. The parameter is ignored if "allowedProtocols" is specified.
maxApynumberNoMaximum APY (in decimal) of the vaults to be included
maxTvlintegerNoMaximum TVL in USD of the vaults to be included
minApynumberNoMinimum APY (in decimal) of the vaults to be included
minTvlintegerNoMinimum TVL in USD of the vaults to be included Default: 100000.
minUsdAssetValueThresholdnumberNoMinimum USD value of the vault to be included Default: 1.
minVaultScorenumberNoMinimum vault score required for a vault to be included
onlyAppFeaturedbooleanNoInclude only vaults that are featured in app.vaults.fyi
onlyTransactionalbooleanNoInclude only vaults that are supported in the transactional interface.
sortBystringNoField to sort by. One of: balanceUsd, tvl, apy1Day, apy7Day, apy30Day.
sortOrderstringNoSort order, either asc or desc. Ascending is default. One of: asc, desc. Default: "asc".
tagsarray of stringNoTags 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 --decode
JavaScript: 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

WhenResultHTTPTimePrice
5 h agoExpected HTTP 402, got 400400169 ms-
10 h agoExpected HTTP 402, got 400400216 ms-
15 h agoExpected HTTP 402, got 400400220 ms-
19 h agoExpected HTTP 402, got 400400241 ms-
24 h agoExpected HTTP 402, got 400400383 ms-
Show 10 older checks
28 h agoExpected HTTP 402, got 400400386 ms-
33 h agoExpected HTTP 402, got 400400232 ms-
37 h agoExpected HTTP 402, got 400400275 ms-
42 h agoExpected HTTP 402, got 400400207 ms-
47 h agoExpected HTTP 402, got 400400211 ms-
2 days agoExpected HTTP 402, got 400400398 ms-
2 days agoExpected HTTP 402, got 400400245 ms-
3 days agoExpected HTTP 402, got 400400383 ms-
3 days agoExpected HTTP 402, got 400400184 ms-
3 days agoExpected HTTP 402, got 400400198 ms-