Portfolio API
Read a customer's holdings across all approved wallets and chains with GET /me/holdings: the request, the fields, partial failure, and filtering to your offer.
GET /me/holdings returns the signed-in customer's holdings across every approved wallet and every chain,
with a price per position and a total in one quote currency. Your server calls it with the customer's
bearer token. The response is always the complete Assetera portfolio of the customer, also assets
bought outside your storefront. A per-position flag tells you which assets your tenant offers, so you decide
what to show.
| At a glance | |
|---|---|
| Method and path | GET /me/holdings |
| Caller | Your server or BFF, with the customer's access token |
| Parameters | quote only (optional, default EUR) |
| Scope | The caller's own approved wallets, all chains, all assets |
| Partial failure | Still 200. The degraded array names what could not be read. |
Request
GET /me/holdings?quote=EUR HTTP/1.1
Host: api.<base_domain>
Authorization: Bearer <customer_access_token>
Accept: application/json| Parameter | Required | Meaning |
|---|---|---|
quote | no | The currency for every price and total. An ISO code (EUR, USD) or an on-chain settlement symbol (USDC). Case does not matter. Default EUR. An unknown code gives price: null, not an error. |
There is no wallet, address, or customer parameter. The API finds the customer's approved wallets from the signed token. A client cannot ask for the wallets of a different customer.
Send the token of the customer. A service-account token (Client Credentials grant) has no portfolio and
receives an empty 200. See Authentication for the grants.
Example response
Trimmed to two positions. The first asset is offered in your tenant, the second was bought elsewhere on Assetera.
{
"asOf": "2026-11-10T09:30:02.114Z",
"positions": [
{
"chainId": "eip155:137",
"tokenAddress": "0x1111111111111111111111111111111111111111",
"holder": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"symbol": "EXA",
"name": "Example Fund A",
"decimals": 18,
"raw": "2500000000000000000",
"kind": "asset",
"logicalGroup": null,
"tradeable": true,
"offeredInTenant": true,
"asOf": "2026-11-10T09:29:41.000Z",
"asOfBlock": 64123456,
"unavailable": false,
"price": {
"value": "102.40",
"currencyCode": "EUR",
"valuation": "feed-mid",
"priceSource": "feed_mid",
"asOf": "2026-11-10T09:30:02.114Z",
"priceAsOf": "2026-11-10T09:25:00.000Z",
"fx": null,
"pairId": 42
},
"value": "256.00"
},
{
"chainId": "eip155:137",
"tokenAddress": "0x2222222222222222222222222222222222222222",
"holder": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"symbol": "EXB",
"name": "Example Bond B",
"decimals": 18,
"raw": "10000000000000000000",
"kind": "asset",
"logicalGroup": null,
"tradeable": true,
"offeredInTenant": false,
"asOf": "2026-11-10T09:29:41.000Z",
"asOfBlock": 64123456,
"unavailable": false,
"price": {
"value": "12.50",
"currencyCode": "EUR",
"valuation": "last-trade",
"priceSource": "last_fill",
"asOf": "2026-11-10T09:30:02.114Z",
"priceAsOf": "2026-11-07T14:12:09.000Z",
"fx": null,
"pairId": 57
},
"value": "125.00"
}
],
"degraded": [],
"totals": {
"quoteCode": "EUR",
"value": "381.00",
"unpricedPositions": 0,
"unavailableQuantities": 0,
"degradedChains": 0,
"oldestPriceAsOf": "2026-11-07T14:12:09.000Z",
"offeredInTenant": {
"value": "256.00",
"unpricedPositions": 0,
"unavailableQuantities": 0,
"oldestPriceAsOf": "2026-11-10T09:25:00.000Z"
}
}
}2.5 EXA at 102.40 gives 256.00, and 10 EXB at 12.50 gives 125.00. The two value fields add up to
totals.value (381.00). Only EXA is offered in the tenant, so totals.offeredInTenant.value is 256.00.
Response fields
Envelope
| Field | Type | Meaning |
|---|---|---|
asOf | string (ISO 8601) | When the API built this response. |
positions | array | One entry per token, per wallet, per chain. The same token in two wallets is two positions. |
degraded | array | What could not be read. Always present, [] on full success. See Partial failure. |
totals | object | The headline value and the counts it does not include. |
Position
| Field | Type | Meaning |
|---|---|---|
chainId | string | CAIP-2 chain id, for example eip155:137. |
tokenAddress | string | The token contract. native for the gas coin of the chain. Branch on kind, not on this value. |
holder | string | The customer's wallet that holds the position. |
symbol, name | string, string or null | Display labels. |
decimals | integer | Base-unit decimals of the token. |
raw | string | The quantity in base units, as a decimal string of digits. Never a number. |
kind | asset | settlement | native | An instrument, a settlement currency (for example USDC), or the gas coin of the chain. |
logicalGroup | string or null | The logical instrument the token belongs to, when the catalog has one. |
tradeable | boolean | The instrument is still active on the Assetera platform. false is not an error: the customer still owns it. Always false for a gas coin. |
offeredInTenant | boolean | Your tenant offers this asset. See All assets or only the assets you offer. |
asOf | string | When this quantity was read from the chain. Can be older than the envelope asOf. |
asOfBlock | integer or null | The block of that read. |
unavailable | boolean | true: this quantity is not trustworthy. Show it as unknown, never as zero. |
price | object or null | The price of one whole token in the quote currency. null when there is no price. Never a zero. |
value | string or null | The value of this position in totals.quoteCode: quantity times price.value, rounded once, half up, to 2 decimal places. Decimal string. null when price is null or unavailable is true. Never a zero for an unknown value. |
Price
| Field | Meaning |
|---|---|
value | Price of one whole token, as a decimal string. |
currencyCode | The quote currency. |
priceSource | Where the price comes from: feed_mid, last_fill, reference, primary_sale, or settlement_currency. |
valuation | The same source, older names: feed-mid, last-trade, reference-price, primary-sale-price, settlement-currency. Both always agree. |
priceAsOf | When the price was observed. Use this for an "as of" label. null for an operator-set price, which has no time of its own. |
asOf | When the API resolved the price, which is always the request time. Do not use it as an "as of" label. |
fx | The exchange rate applied (rate, baseCode, asOf), or null if no conversion was necessary. |
pairId | The market the price comes from, when there is one. |
Totals
| Field | Meaning |
|---|---|
quoteCode | The quote currency of every value in totals. |
value | Sum of positions[].value over the positions where it is not null. Decimal string. The rows always add up to this total. |
unpricedPositions | Positions with a quantity but no price. Not in value. |
unavailableQuantities | Positions with unavailable: true. Not in value. |
degradedChains | Chains in degraded. Their holdings can be missing from value and from the counts. |
oldestPriceAsOf | The oldest priceAsOf inside value. A total is only as current as its oldest price. null when no price in it has a time. |
offeredInTenant | The same value, unpricedPositions, unavailableQuantities and oldestPriceAsOf, calculated only over positions with offeredInTenant: true. |
value, unpricedPositions and unavailableQuantities split the position list with no overlap. Show the
counts beside the value, for example "EUR 381.00, 2 holdings without a price".
All assets or only the assets you offer
The response always contains the complete portfolio. Your storefront decides which view to show.
| View | Positions | Headline total |
|---|---|---|
| All assets | every entry in positions | totals.value |
| Only the assets you offer | entries with offeredInTenant: true | totals.offeredInTenant.value |
offeredInTenant is true when:
kind | offeredInTenant is true when |
|---|---|
asset | At least one market of the instrument is offered to and visible in your tenant. |
settlement | The currency is the quote currency of at least one such market. |
native | Always. |
offeredInTenant and tradeable are different facts. An asset can be active on the platform
(tradeable: true) and still not be offered in your tenant.
import { formatUnits } from "viem";
import { getSession } from "@/lib/session";
export async function GET(req: Request) {
const session = await getSession();
// Refresh the access token here when it is about to expire. Customer tokens are short-lived.
if (!session.accessToken) return new Response("unauthenticated", { status: 401 });
const onlyOffered = new URL(req.url).searchParams.get("view") === "offered";
const res = await fetch(`${process.env.ASSETERA_API_BASE_URL}/me/holdings?quote=EUR`, {
headers: { authorization: `Bearer ${session.accessToken}`, accept: "application/json" },
cache: "no-store",
});
if (!res.ok) return new Response(null, { status: res.status }); // 503: retry, never "empty"
const body = await res.json();
const positions = onlyOffered
? body.positions.filter((p) => p.offeredInTenant === true)
: body.positions;
return Response.json({
positions: positions.map((p) => ({
...p,
quantity: p.unavailable ? null : formatUnits(BigInt(p.raw), p.decimals), // a decimal string
value: p.value, // from the API as is: a decimal string, or null when unknown
})),
total: onlyOffered ? body.totals.offeredInTenant : body.totals,
quoteCode: body.totals.quoteCode,
degraded: body.degraded,
});
}Rules for both views:
- Show
valueon each row and take the total fromtotals. Do not multiply quantity by price, and never add values in the browser. The API rounds each position once and sums the rounded values, so its total matches its rows. - Keep quantities and prices as decimal strings. Convert
rawwithdecimalsusing string or BigInt arithmetic. A JavaScript number loses precision at 18 decimals. - Show a position with
value: nullwithout a value, not as zero. This is the case whenpriceisnullorunavailableistrue. A gas coin never has a price today.
Partial failure
A chain that cannot be read gives a degraded entry and a 200. It never gives a missing position
that looks like zero, and an error never produces an empty positions array.
| Signal | What it means | What to show |
|---|---|---|
degraded entry for a chainId and holder | The API could not refresh that wallet on that chain. Its positions are the last known values, each with its own older asOf. If there are none, the wallet has no positions on that chain in the response. | The positions with "as of" their asOf, never as current, plus a notice that part of the portfolio could not refresh. |
degraded entry with chainId: "*" and holder: "*" | The list of approved wallets could not be read. The API used the last known list. | A notice for the whole portfolio. |
unavailable: true | This one quantity is not trustworthy. | "Unknown", never zero. It is counted in unavailableQuantities. |
price: null | No price in the quote currency. | The quantity without a value. It is counted in unpricedPositions. |
reason | Meaning |
|---|---|
rpc_unreachable | The chain did not answer, or answered for only part of the tokens. |
chain_unconfigured | The API cannot read this chain at the moment. |
multicall_unavailable | The batch read on this chain failed. |
wallet_registry_unavailable | The wallet list could not be read (always with "*"). |
timeout | The request ran out of time before this wallet and chain were read. |
unknown | Any other read failure. |
Quantities are cached and read again from the chain when the cache is too old. Prices are never cached. They are resolved on each request.
Status codes
| Status | Meaning | What to do |
|---|---|---|
200 | The portfolio. Also when part of it could not be read: check degraded. | Render it, with the markers above. |
400 | quote is not in the form of a currency code (2 to 12 letters and digits, starting with a letter). The API does not fall back to EUR. A well-formed code that no rate reaches is not a 400: the response is a 200 with price: null on the positions it cannot value. | Fix the request. Do not retry unchanged. |
401 | Token is missing, expired, or invalid. | Refresh the token on your server, then retry. |
503 | The API could not find the customer's wallets at all. Body: { "error": "..." }. | Retry with backoff. Never render it as an empty portfolio. |
Your data responsibility
Your server receives the complete Assetera portfolio of the customer, including assets that you do not offer. You are responsible for what you store, what you log, and what you show. Store only what your storefront needs. See Tenancy and responsibility for the split of duties.
Primary sale API
The three primary-sale rails, the quote lifecycle both on-chain rails share, and the refusal codes an integrator branches on.
Compliance API
The customer-scoped API for onboarding status, KYC SDK sessions, and wallet registration. Every route resolves the caller from the bearer token, never from a parameter.