← Market

Portfolio Analytics · Rebalance Trades

Compute buys and sells that restore target weights with tolerance bands, a cash buffer, minimum trade size and whole-share rounding. Docs: https://www.brainiac.software/api/portfolio-analytics/rebalance-trades

POST https://www.brainiac.software/api/v1/portfolio-analytics/rebalance-trades

0.03 USDC on Base · payTo 0x6428665E83F503904571104311bB78CBb29b975c

Status: verified · payable

Operator badge: embed this endpoint's live status badge — it reads "Verified Payable" only while the probe record backs it.

Settlement: direct to the seller's payTo — 0% HIVE402 take

Payment routes

Base · 0.03 USDC · payTo 0x6428665E83F503904571104311bB78CBb29b975c · via cdp · settles direct
{
  "band": {
    "type": "absolute",
    "value": 0.02
  },
  "cash": 5000,
  "cashBuffer": 0.01,
  "fractional": false,
  "holdings": [
    {
      "price": 250,
      "quantity": 200,
      "symbol": "VTI"
    },
    {
      "price": 72,
      "quantity": 300,
      "symbol": "BND"
    },
    {
      "price": 60,
      "quantity": 100,
      "symbol": "VXUS"
    }
  ],
  "minTradeValue": 100,
  "restricted": [],
  "targets": {
    "BND": 0.3,
    "VTI": 0.6,
    "VXUS": 0.1
  }
}
{
  "cashAfter": 884,
  "investable": 81774,
  "limitations": [
    "Outputs are calculations on caller-supplied inputs for human review. No market data is fetched, and this is not investment or tax advice.",
    "Sells execute first. Buys are scaled pro rata when they would breach the cash buffer. Whole-share rounding truncates toward zero unless fractional is true."
  ],
  "sources": [
    {
      "retrievedAt": "2026-11-14",
      "source": "Caller-supplied holdings, returns, valuations and transactions processed locally",
      "status": "ok",
      "url": "https://www.brainiac.software/api/v1/portfolio-analytics"
    }
  ],
  "totalValue": 82600,
  "trades": [
    {
      "quantity": 33,
      "side": "buy",
      "symbol": "BND",
      "value": 2376
    },
    {
      "quantity": 29,
      "side": "buy",
      "symbol": "VXUS",
      "value": 1740
    }
  ],
  "untouched": [
    {
      "drift": 0.0053268765133172025,
      "reason": "within_band",
      "symbol": "VTI"
    }
  ],
  "weightsAfter": {
    "BND": 0.29026634382566585,
    "VTI": 0.6053268765133172,
    "VXUS": 0.0937046004842615
  }
}

Script Master Labs LLC · SDVOSB · Kinston, NC · Terms · Refunds · Privacy · Sellers · Contact

SML network: ScriptMasterLabs — the main site · SML Dual Market — the human store: human checkout, card & crypto · VA Ratings — VA disability ratings, free for veterans

Agent intel trust badge

Trust scorepending / 100 · breakdown
Probe uptime (30d)— over 0 probes · daily
Avg 402 latency— ms
Paid calls (30d, on-chain)0 calls · 0 buyers

How to call

POST https://www.brainiac.software/api/v1/portfolio-analytics/rebalance-trades · input in body · spec from live-challenge

Input schema
{
  "type": "object",
  "properties": {
    "holdings": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "holdings supplied by the caller for this operation.",
      "example": [
        {
          "symbol": "VTI",
          "quantity": 200,
          "price": 250
        },
        {
          "symbol": "BND",
          "quantity": 300,
          "price": 72
        },
        {
          "symbol": "VXUS",
          "quantity": 100,
          "price": 60
        }
      ]
    },
    "cash": {
      "type": "number",
      "minimum": 0,
      "description": "cash supplied by the caller for this operation.",
      "example": 5000
    },
    "targets": {
      "type": "object",
      "description": "targets supplied by the caller for this operation.",
      "example": {
        "VTI": 0.6,
        "BND": 0.3,
        "VXUS": 0.1
      }
    },
    "band": {
      "type": "object",
      "description": "band supplied by the caller for this operation.",
      "example": {
        "type": "absolute",
        "value": 0.02
      }
    },
    "cashBuffer": {
      "type": "number",
      "minimum": 0,
      "maximum": 0.5,
      "description": "cash Buffer supplied by the caller for this operation.",
      "example": 0.01
    },
    "minTradeValue": {
      "type": "number",
      "minimum": 0,
      "description": "min Trade Value supplied by the caller for this operation.",
      "example": 100
    },
    "fractional": {
      "type": "boolean",
      "description": "fractional supplied by the caller for this operation.",
      "example": false
    },
    "restricted": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64
      },
      "description": "restricted supplied by the caller for this operation.",
      "example": []
    }
  },
  "required": [
    "holdings",
    "targets"
  ],
  "additionalProperties": false
}
Output schema
{
  "type": "object"
}
curl -i -X POST 'https://www.brainiac.software/api/v1/portfolio-analytics/rebalance-trades' \
  -H 'content-type: application/json' -d '{"holdings":[{"symbol":"VTI","quantity":200,"price":250},{"symbol":"BND","quantity":300,"price":72},{"symbol":"VXUS","quantity":100,"price":60}],"cash":5000,"targets":{"VTI":0.6,"BND":0.3,"VXUS":0.1},"band":{"type":"absolute","value":0.02},"cashBuffer":0.01,"minTradeValue":100,"fractional":false,"restricted":[]}'

Agents: POST https://hive402.scriptmasterlabs.com/mcp → route_task / proxy_call · SDK /sdk/hive402.mjs

Try it (your wallet signs; HIVE402 never holds funds)