Data

Wallet Portfolio

GET
/api/v1/wallet/{address}/portfolio
The wallet's portfolio in USD (the same figure the site shows): spot holdings, pair-asset balances, vault stake net of its loan and open loans net of debt; listed apart, unvested tokens, prediction shares at the stored odds and open Up/Down stakes. Balances are read live in one multicall; everything else (prices from the latest synced trade, vault, loans, vesting, market positions, Up/Down bets) comes from the database.
Auth: API Key

Response

Response
{
  "address": "0x...",
  "deployed": true,
  "pairBalances": [
    { "main": "0x...", "mainKey": "usd", "pairAsset": "0x...", "pairSymbol": "USDG", "pairDecimals": 6, "balanceRaw": "250000000", "balance": "250", "valueUsdE18": "250000000000000000000" }
  ],
  "holdings": [
    {
      "address": "0x...",
      "symbol": "MYTOKEN",
      "main": "0x...",
      "isMain": false,
      "balanceWei": "1200000000000000000000",
      "balance": "1200",
      "decimals": 18,
      "pairAsset": "0x...",
      "pairDecimals": 6,
      "pricePairRaw": "1040000",
      "priceUsdE18": "1040000000000000000",
      "valueUsdE18": "1248000000000000000000",
      "price": 1.04,
      "value": 1248
    }
  ],
  "vaults": [
    { "main": "0x...", "vault": "0x...", "staked": "500000000000000000000", "pledged": "0", "hasActiveLoan": false, "debtRaw": "0", "pairAsset": "0x...", "pairDecimals": 6, "valueUsdE18": "520000000000000000000" }
  ],
  "loans": [
    { "id": "12", "source": "hub", "main": "0x...", "token": "0x...", "collateralWei": "800000000000000000000", "fullAmountRaw": "400000000", "pairAsset": "0x...", "pairDecimals": 6, "netUsdE18": "432000000000000000000" }
  ],
  "holdingsCount": 1,
  "totalUsdE18": "2460400000000000000000",
  "unpriced": 0,
  "usdb": 250,
  "tokenValueUSD": 1248,
  "totalUSD": 1498,
  "vesting": [
    { "vestingContract": "0x...", "vestingId": 3, "token": "0x...", "main": "0x...", "totalAmount": "1000000000000000000000", "claimedAmount": "250000000000000000000", "remaining": "750000000000000000000", "activeLoanId": 0, "valueUsdE18": "780000000000000000000", "usdSource": "fixed" }
  ],
  "predictions": [
    { "marketToken": "0x...", "host": "0x...", "hostKind": "public", "main": "0x...", "resolved": false, "shares": [{ "outcomeId": 0, "shares": "40000000000000000000", "probabilityE18": "620000000000000000" }], "valueTokens": "24800000000000000000", "valueUsdE18": "25100000000000000000", "usdSource": "fixed" }
  ],
  "updown": [
    { "contract": "0x...", "asset": 0, "tf": 1, "roundId": 88, "main": "0x...", "poolToken": "0x...", "settleAsset": "0x...", "settleDecimals": 6, "status": "open", "side": "bull", "stake": "5000000000000000000", "shares": "4900000000000000000", "endTime": 1767225600, "paidUsdE18": "5050000000000000000", "usdSource": "fixed" }
  ],
  "costBasis": { "tokens": [], "realizedPnlUsdE18": "0", "note": "..." },
  "note": "..."
}

Each holding is priced through its own main and that main's pair-asset USD source. Every *UsdE18 field is USD × 1e18 as a decimal string, null when unknown; a holding with no known USD price is left out of the totals and counted in unpriced. totalUsdE18 covers every line; vesting is in no total. Token amounts (balanceWei, a loan's collateralWei, vault, vesting and share amounts) are 18-decimal token units; balanceRaw, pricePairRaw, debtRaw and fullAmountRaw are raw pair-asset units. The vault stake is a position, not a token: the stored stake, without pending rewards. vesting is the stored total − claimed; predictions values each held share at its stored odds (a resolved market has no odds value); updown lists open stakes with their USD at bet time. None of the three is in a total.

Read on chain (not served): what can be claimed now. Vesting VESTING.getClaimableAmount(id); a resolved market's payout TRANCHE_READER.quoteRedeemUSDB(host, market, user); Up/Down payouts UPDOWN.quoteClaimPayout(asset, tf, roundId, user) (the rounds from GET /api/v1/wallet/{address}/updown); holder rewards FACTORYTOKEN(token).getClaimableRewards(user); vault rewards STAKING.earned(main, user).

Deprecated number fields, kept for one release: usdb, price, value, tokenValueUSD, totalUSD (spot only).

200 Portfolio returned400 Invalid address401 Missing or invalid API key502 Failed to read on-chain balances503 Trading not deployed on this network