Skip to Content
Indexify
Trading

Portfolio, charts, and position visibility

POST
/api/portfolio_v2.php

Optimized portfolio read, plus the hidden-positions surface.

A position is one (user, stack) pair — an entry in stacks, valued as the sum over its tokens of amount × spot price. A position worth less than $1.00 that could be priced completely AND that the user never bought on the platform is hidden by default (wallets get dusted constantly). A position the user bought here is never hidden automatically, however far it has fallen. A user can hide any position, or pin any position the automatic rule would hide.

At this threshold most of a small portfolio can be hidden, so a client MUST surface hidden_positions (count, total_value) wherever it renders the list — an empty list shown without it reads as "your portfolio is gone".

Hidden positions (dust and manual) are excluded from grand_total_stack_value, grand_invested_value, grand_invested_capital and the live point of action=charts; pct_of_portfolio is a share of that shown-only total. hidden_positions.total_value reports what was left out.

See /docs/api/hidden_positions.md.

Authorization

headerX-API-KEY<token>

API key with the ix_ prefix. You can generate an API Key by navigating to Settings -> API Key in the web app. Pass it in the X-API-KEY header on every request.

Request Body

application/json
  1. body
action?"portfolio"

Default when omitted.

Value in"portfolio"
period?string

Comparison period. Omit for live.

Value in"4hour""1D""1W""1M"
include_hidden?boolean

Return hidden positions inline in stacks, each flagged, instead of omitting them.

Defaultfalse

Response Body

Successful response. Shape depends on action.

application/json
  1. response
action?string
grand_total_stack_value?number

Shown stacks plus cash. Excludes hidden positions.

hidden_positions?

Summary of what was withheld from stacks. Returned on the portfolio and hidden actions.

total_value_partial?boolean

True when any SHOWN position could not be fully priced, meaning grand_total_stack_value under-reports by an unknown amount and should be presented as a floor, not a total.

stacks?array<>

Positions. Each entry keeps its existing shape and gains the three visibility fields below.

[key: string]?any
Example Request
curl -X POST 'https://api.indexify.finance/api/portfolio_v2.php' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "action": "string",  "grand_total_stack_value": 0,  "hidden_positions": {    "count": 0,    "total_value": 0,    "dust_count": 0,    "manual_count": 0  },  "total_value_partial": true,  "stacks": [    {      "hidden": true,      "hidden_reason": "dust",      "price_status": "ok"    }  ]}