QuantBrasil
Documentação

quantbrasil holdings list

Lista as carteiras do usuário autenticado

Sintaxe

quantbrasil holdings list

Esta é uma operação de leitura. Modos de saída: json, human.

Argumentos e opções

NomeTipoObrigatórioDescriçãoPadrão
--jsonOpçãoNãoExibe saída JSON

Exemplos

quantbrasil holdings list

Saída (--json)

Estrutura da resposta retornada com --json:

export interface PortfolioListResponse {
  ok: boolean;
  portfolios: PortfolioOut[];
  total: number;
}

export interface PortfolioOut {
  id: number;
  name: string;
  kind: "WATCHLIST" | "HOLDING" | "SYSTEM" | null;
  symbols: string[];
  weights: Record<string, number> | null;
  default_allocation_input: "TARGET_WEIGHT" | "POSITION" | null;
  has_target_weights: boolean;
  has_positions: boolean;
}

Exemplo de resposta

{
  "ok": true,
  "total": 1,
  "portfolios": [
    {
      "id": 182,
      "name": "Longo Prazo",
      "kind": "HOLDING",
      "symbols": ["PETR4", "VALE3"],
      "weights": {
        "PETR4": 0.6,
        "VALE3": 0.4
      },
      "default_allocation_input": "TARGET_WEIGHT",
      "has_target_weights": true,
      "has_positions": false
    }
  ]
}