curl "https://api.metastreams.io/v1/portfolio?wallets=7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5&chains=solana" \
-H "Authorization: Bearer $API_KEY"
curl "https://api.metastreams.io/v1/portfolio?wallets=7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5&include=stats" \
-H "Authorization: Bearer $API_KEY"
const url = new URL("https://api.metastreams.io/v1/portfolio");
url.searchParams.set("wallets", "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5");
url.searchParams.set("chains", "solana");
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const portfolio = await response.json();
use serde_json::Value;
let portfolio: Value = reqwest::Client::new()
.get("https://api.metastreams.io/v1/portfolio")
.query(&[("wallets", "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"), ("chains", "solana")])
.bearer_auth(std::env::var("API_KEY")?)
.send()
.await?
.error_for_status()?
.json()
.await?;
{
"asOf": 1789632015120,
"totalValueUsd": "11962.40",
"spot": {
"valueUsd": "11962.40",
"balancesValueUsd": "7518.40",
"positionsValueUsd": "4444.00",
"chains": [
{
"chain": "solana",
"nativeBalance": { "native": "41.208113", "usd": "7418.40" },
"stableBalanceUsd": "100.00",
"positionsValue": { "native": "24.688888", "usd": "4444.00" },
"valueUsd": "11962.40"
}
]
},
"wallets": [
{
"addresses": { "evm": null, "solana": "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5" },
"spot": {
"valueUsd": "11962.40",
"balancesValueUsd": "7518.40",
"positionsValueUsd": "4444.00",
"chains": [
{
"chain": "solana",
"nativeBalance": { "native": "41.208113", "usd": "7418.40" },
"stableBalanceUsd": "100.00",
"positionsValue": { "native": "24.688888", "usd": "4444.00" },
"valueUsd": "11962.40"
}
]
}
}
]
}
REST
Portfolio
Returns the summed spot holdings of up to 100 wallets, per chain, with each wallet’s share and optional PnL stats.
GET
/
v1
/
portfolio
curl "https://api.metastreams.io/v1/portfolio?wallets=7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5&chains=solana" \
-H "Authorization: Bearer $API_KEY"
curl "https://api.metastreams.io/v1/portfolio?wallets=7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5&include=stats" \
-H "Authorization: Bearer $API_KEY"
const url = new URL("https://api.metastreams.io/v1/portfolio");
url.searchParams.set("wallets", "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5");
url.searchParams.set("chains", "solana");
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const portfolio = await response.json();
use serde_json::Value;
let portfolio: Value = reqwest::Client::new()
.get("https://api.metastreams.io/v1/portfolio")
.query(&[("wallets", "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"), ("chains", "solana")])
.bearer_auth(std::env::var("API_KEY")?)
.send()
.await?
.error_for_status()?
.json()
.await?;
{
"asOf": 1789632015120,
"totalValueUsd": "11962.40",
"spot": {
"valueUsd": "11962.40",
"balancesValueUsd": "7518.40",
"positionsValueUsd": "4444.00",
"chains": [
{
"chain": "solana",
"nativeBalance": { "native": "41.208113", "usd": "7418.40" },
"stableBalanceUsd": "100.00",
"positionsValue": { "native": "24.688888", "usd": "4444.00" },
"valueUsd": "11962.40"
}
]
},
"wallets": [
{
"addresses": { "evm": null, "solana": "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5" },
"spot": {
"valueUsd": "11962.40",
"balancesValueUsd": "7518.40",
"positionsValueUsd": "4444.00",
"chains": [
{
"chain": "solana",
"nativeBalance": { "native": "41.208113", "usd": "7418.40" },
"stableBalanceUsd": "100.00",
"positionsValue": { "native": "24.688888", "usd": "4444.00" },
"valueUsd": "11962.40"
}
]
}
}
]
}
Returns the spot holdings of the wallets in
wallets, a comma-separated list of 1 to 100 addresses, as one value summed across them. chains limits the read to a comma-separated list of chain slugs; omit it to read every chain. An EVM address counts on every EVM chain in scope, and a Solana address on Solana.
Value
A value is the sum of three parts:- The balance of the chain’s gas asset, at its latest price.
- The stablecoin balances, at $1 each.
- The open positions, at each token’s latest price.
- Its token has no price.
- It is worth more than its token’s market cap.
- Its token has no known market cap and under $1,000 of liquidity.
hideLowLiquidity=true drops every open position in a token with under $1,000 of liquidity, or with no known liquidity, from the values and the stats. A stablecoin is never dropped. The default is false.
Response
totalValueUsdis the value of every product. It equalsspot.valueUsd, because spot is the only product.spotsplits the value into balances and positions, with one item inspot.chainsper chain in scope. A chain with no holdings has zero values.walletslists each requested wallet’s share, in the order of the request. The shares add up to the totals.addressesholds the wallet under its format,evmorsolana, and the other isnull.asOfis the time the response was calculated.
Stats
include=stats adds stats to the portfolio and to each wallet. stats reports performance over four timeframes: oneDay, sevenDays and thirtyDays cover positions whose first purchase falls in that window, and max covers every position.
Each timeframe contains the realized and unrealized PnL per chain, the number of open positions, the trade counts, and buckets. buckets counts positions by realized return: rekt loses more than 50%, loss loses up to 50%, win returns 1x to 2x, pump from 2x to 5x, and moonshot at 5x or better.
Errors
| Code | When |
|---|---|
UNSUPPORTED_CHAIN | A slug in chains is not supported |
VALIDATION_ERROR | No wallet or more than 100, a malformed address, an unknown include value, or an unknown parameter |
curl "https://api.metastreams.io/v1/portfolio?wallets=7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5&chains=solana" \
-H "Authorization: Bearer $API_KEY"
curl "https://api.metastreams.io/v1/portfolio?wallets=7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5&include=stats" \
-H "Authorization: Bearer $API_KEY"
const url = new URL("https://api.metastreams.io/v1/portfolio");
url.searchParams.set("wallets", "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5");
url.searchParams.set("chains", "solana");
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const portfolio = await response.json();
use serde_json::Value;
let portfolio: Value = reqwest::Client::new()
.get("https://api.metastreams.io/v1/portfolio")
.query(&[("wallets", "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"), ("chains", "solana")])
.bearer_auth(std::env::var("API_KEY")?)
.send()
.await?
.error_for_status()?
.json()
.await?;
{
"asOf": 1789632015120,
"totalValueUsd": "11962.40",
"spot": {
"valueUsd": "11962.40",
"balancesValueUsd": "7518.40",
"positionsValueUsd": "4444.00",
"chains": [
{
"chain": "solana",
"nativeBalance": { "native": "41.208113", "usd": "7418.40" },
"stableBalanceUsd": "100.00",
"positionsValue": { "native": "24.688888", "usd": "4444.00" },
"valueUsd": "11962.40"
}
]
},
"wallets": [
{
"addresses": { "evm": null, "solana": "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5" },
"spot": {
"valueUsd": "11962.40",
"balancesValueUsd": "7518.40",
"positionsValueUsd": "4444.00",
"chains": [
{
"chain": "solana",
"nativeBalance": { "native": "41.208113", "usd": "7418.40" },
"stableBalanceUsd": "100.00",
"positionsValue": { "native": "24.688888", "usd": "4444.00" },
"valueUsd": "11962.40"
}
]
}
}
]
}
Authorizations
Query Parameters
Response
The named wallets' spot holdings. A gas balance without a price has a null USD value, which no total counts.
The summed spot holdings of the named wallets.