Skip to Content
Dashboard
GuidesAccountsPortfolio and history

Portfolio and history

Balances in dollars, returns, a value chart, per-position history and every transaction in an account.

Open in ChatGPT

Notus tracks every account you register and keeps its balances and prices up to date, so an account statement screen needs no data feed of its own: one call for what the user holds, one for how its value changed, one for the transaction list.

Notus indexes every wallet you register, so a wallet screen needs no indexer or price feed of your own: one call for what the user holds, one for how its value changed, one for what happened.

What the user holds

const portfolio = await notus.wallets.getPortfolio({
  walletAddress,
  includePnL: true,
  includeLendingPositions: true,
})

Pass the user's account address as walletAddress. tokens lists every asset they hold with its balance (balanceFormatted), price and value in dollars (priceUsd, balanceUsd) and the network it lives on (money lives on a network, like a bank system). With includePnL, each asset and the whole account include their return (profit or loss) over timerange (1d, 7d, 1m, 1a or all). With includeLendingPositions, interest-earning deposits and loans against them come in lendingPositions.

The same call also accepts an account address on Bitcoin, Stellar or Solana.

tokens lists every token with its balance (balanceFormatted), price and value in dollars (priceUsd, balanceUsd) and chain. With includePnL, each token and the whole wallet carry their profit or loss over timerange (1d, 7d, 1m, 1a or all). With includeLendingPositions, Aave supplies and borrows come in lendingPositions.

The same call accepts a Bitcoin, Stellar or Solana address.

How the value changed

const history = await notus.wallets.getPortfolioHistory({
  walletAddress,
  timerange: '1m',
  currency: 'USD',
})

points is a chart-ready series of the account's value, daily (hourly for 1d and for accounts younger than about two days), each point with what came in and went out that day. summary adds it up: what the account started with, plus deposits, minus withdrawals, plus the return, equals what it ends with. So the chart separates money the user added from money they earned.

currency can be USD or BRL. Pass chainId (the network id) and token (the asset's id) to narrow the chart to one asset.

points is a chart-ready series of the wallet's value, daily (hourly for 1d and for wallets younger than about two days), each point with what came in and went out that day. summary adds it up: what the wallet started with, plus deposits, minus withdrawals, plus the result, equals what it ends with. So the chart separates money the user added from money they earned.

currency can be USD or BRL, and chainId + token narrow it to one token.

The first call for an account whose history has not been built yet starts preparing it and returns status: 'INDEXING' with a progress. Call again until it is INDEXED.

The first call for a wallet that was never indexed starts indexing and returns status: 'INDEXING' with a progress. Call again until it is INDEXED.

What happened

const { transactions, nextLastId } = await notus.wallets.getWalletHistory({
  walletAddress,
  take: 50,
})

Every transaction is here: transfers in and out, currency conversions, limit orders, pool activity, investment fund deposits, lending and borrowing, and Pix deposits and withdrawals. Each entry has its type, status, amounts, fees and network reference ids. Page with lastId: nextLastId, and filter by type, status, network (chains), dates, operation id (userOperationHash) or your own metadata (metadataKey + metadataValue).

Every operation is here: transfers in and out, swaps, limit orders, pool operations, fund deposits, lending, Pix deposits and withdrawals. Each has its type, status, amounts, fees and transaction hashes. Page with lastId: nextLastId, and filter by type, status, chains, dates, userOperationHash or your own metadata (metadataKey + metadataValue).

Tag a transaction with your own data (an order id, a note) with Update Transaction Metadata, then find it again with the metadata filter.

One pool position over time

const position = await notus.liquidityPools.getLiquidityPositionHistory({
  walletAddress,
  chainId: 137,
  tokenId: '<position-nft-id>',
})

Use this for a pool position (where the user lends money to a currency market to earn a share of exchange fees). Pass the user's account address (walletAddress), the network id (chainId, here 137 for Polygon) and the position's id (tokenId).

Returns the position's daily value and result (value plus fees collected, minus deposits, plus withdrawals). A position rebalanced into a new one keeps a single history across both.

Types, statuses and calculation details

  • Transaction types: SWAP, CROSS_SWAP, LIMIT_SWAP, CRYPTO_DEPOSIT, CRYPTO_WITHDRAW, CUSTOM_TRANSACTION, ON_RAMP, OFF_RAMP, LIQUIDITY_POOL_ADD, LIQUIDITY_POOL_WITHDRAW, LIQUIDITY_POOL_COLLECT_FEE, LIQUIDITY_POOL_STAKE, LIQUIDITY_POOL_UNSTAKE, SWAP_LIQUIDITY_POOL_ADD, SWAP_LIQUIDITY_POOL_WITHDRAW, SWAP_LIQUIDITY_POOL_REBALANCE, SWAP_LIQUIDITY_POOL_REINVEST, LENDING_SUPPLY, LENDING_SUPPLY_BORROW, LENDING_BORROW, LENDING_REPAY, LENDING_WITHDRAW, LENDING_REPAY_WITHDRAW, LENDING_LIQUIDATION, FUND_DEPOSIT, FUND_REDEEM.
  • Statuses: PENDING, PROCESSING, AWAITING_ORDER, AWAITING_MANAGER, ON_BRIDGE, COMPLETED, PARTIALLY_COMPLETED, DELAYED, IN_COMPLIANCE_REVIEW, REFUNDED, CANCELED, EXPIRED, FAILED.
  • Pagination: take is 1 to 100 (default 100). The cursor is the last transaction id, not a page number.
  • Days close at midnight São Paulo time (UTC−3).
  • Portfolio tokens also carry spendable and reserved amounts, next to the full balance.
  • NFTs come with includeNFTs=true.

On this page