Browse the extensions reference

portfolioBlock

returns PortfolioBlock

Portfolio-centric molecule: portfolio + active positions + securities + entities.

Arguments

NameTypeDescription
portfolioIdString!The portfolio to assemble the molecule for.

Returns PortfolioBlock

Molecular response shape for portfolio-block operations. Bundles the portfolio core, its embedded positions, and pre-computed totals into a single payload — the contract for create-portfolio-block, update-portfolio-block, and the read-side get-portfolio-block. Cents-precision values aren't surfaced here; use PositionResponse / PortfolioResponse for those.

FieldTypeDescription
idID!Portfolio ID (port_* ULID).
nameString!Display name.
descriptionStringFree-text description.
strategyStringFree-text strategy classification.
inceptionDateDateDate the portfolio was established.
baseCurrencyString!ISO 4217 currency code for portfolio aggregates.
ownerEntityLiteEmbedded owning entity, when set. null for unattributed portfolios.
positions[PositionBlock!]!All positions in this portfolio, including disposed ones (filter by status for active-only display).
totalCostBasisDollarsFloat!Sum of cost_basis_dollars across every position.
totalCurrentValueDollarsFloatSum of current_value_dollars across every position. null when any active position lacks a mark.
activePositionCountInt!Count of positions with status='active'.
createdAtDateTime!Row creation timestamp (UTC).
updatedAtDateTime!Last-modified timestamp (UTC).

Example

query
{ portfolioBlock(portfolioId: "...") { id name description strategy } }
curl
curl -X POST "https://api.robosystems.ai/extensions/$GRAPH_ID/graphql" \
  -H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ portfolioBlock(portfolioId: \"...\") { id name description strategy } }"}'