QuantBrasil
Documentação

quantbrasil holdings exposure

Calcula a exposição setorial de uma carteira

Sintaxe

quantbrasil holdings exposure <holding-id>

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

Argumentos e opções

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

Exemplos

quantbrasil holdings exposure 123

Saída (--json)

Estrutura da resposta retornada com --json:

export interface PortfolioExposureResponse {
  source_type: "saved_holding";
  portfolio_id: number | null;
  portfolio_name: string | null;
  exposures: SectorExposureOut[];
  unclassified: UnclassifiedExposureOut;
  summary_markdown: string;
  assumptions: string[];
  warnings: string[];
}

export interface SectorExposureOut {
  sector: string;
  weight_pct: number;
  subsectors: SectorSubsectorExposureOut[];
  symbols: string[];
}

export interface UnclassifiedExposureOut {
  weight_pct: number;
  symbols: string[];
}

export interface SectorSubsectorExposureOut {
  subsector: string;
  weight_pct: number;
  symbols: string[];
}

Exemplo de resposta

{
  "source_type": "saved_holding",
  "portfolio_id": 182,
  "portfolio_name": "Longo Prazo",
  "exposures": [
    {
      "sector": "Petróleo, Gás e Biocombustíveis",
      "weight_pct": 60,
      "subsectors": [
        {
          "subsector": "Exploração e Refino",
          "weight_pct": 60,
          "symbols": ["PETR4"]
        }
      ],
      "symbols": ["PETR4"]
    },
    {
      "sector": "Materiais Básicos",
      "weight_pct": 40,
      "subsectors": [
        {
          "subsector": "Mineração",
          "weight_pct": 40,
          "symbols": ["VALE3"]
        }
      ],
      "symbols": ["VALE3"]
    }
  ],
  "unclassified": {
    "weight_pct": 0,
    "symbols": []
  },
  "summary_markdown": "A carteira concentra 60% em Petróleo e 40% em Materiais Básicos.",
  "assumptions": ["Classificação setorial conforme a B3."],
  "warnings": []
}