Skip to content
Fourohtwo

www.brainiac.software/api/v1/portfolio-analytics/stress-test

Apply caller-defined asset-class, factor and rate shocks to holdings and report P/L by holding and in total. Docs: https://www.brainiac.software/api/portfolio-analytics/stress-test

BaseAnswering
POSThttps://www.brainiac.software/api/v1/portfolio-analytics/stress-test

Uptime100% of 1 check in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

// npm install fourohtwo
import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://www.brainiac.software/api/v1/portfolio-analytics/stress-test", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"holdings":[{"betas":{"equity":1},"id":"VTI","mapping":{"assetClass":"us_equity"},"value":50000},{"duration":6.2,"id":"BND","mapping":{"assetClass":"bonds"},"value":21600}],"scenarios":[{"assetClassShocks":{"us_equity":-0.2},"factorShocks":{},"name":"equity -20%, rates +100bp","rateShockBp":100}]}),
});
console.log(await res.json());

Example input

{
  "holdings": [
    {
      "betas": {
        "equity": 1
      },
      "id": "VTI",
      "mapping": {
        "assetClass": "us_equity"
      },
      "value": 50000
    },
    {
      "duration": 6.2,
      "id": "BND",
      "mapping": {
        "assetClass": "bonds"
      },
      "value": 21600
    }
  ],
  "scenarios": [
    {
      "assetClassShocks": {
        "us_equity": -0.2
      },
      "factorShocks": {},
      "name": "equity -20%, rates +100bp",
      "rateShockBp": 100
    }
  ]
}