Build a tax-aware rebalancing trade list that brings holdings back to the target model or custom allocation, optionally investing new cash. Sells come from tax-advantaged accounts first, then taxable lots with losses, then the smallest gains; proceeds stay in the account that raised them. Returns each trade (account, symbol, dollars, estimated shares, estimated realized gain and tax), totals, the allocation after the trades, wash-sale and concentration warnings, and notes. Takes the same holdings, prices and target inputs as portfolio_review; missing prices are fetched from live quotes. Trades are estimates for advisor review, not orders.
View input schema
{
"type": "object",
"properties": {
"holdingsCsv": {
"type": "string",
"maxLength": 131072,
"description": "Holdings as CSV text in the LunaTerminal import format: a header row with at least symbol and shares; the full header is account,account_type,symbol,shares,cost_basis,asset_class,acquired. cost_basis is the row's total dollars, acquired is YYYY-MM-DD. Example:\naccount,account_type,symbol,shares,cost_basis,asset_class,acquired\nJoint brokerage,taxable,VTI,120,24000,,2021-03-15\nJoint brokerage,taxable,AAPL,150,18000,,2019-06-01\nJoint brokerage,taxable,CASH,8000,8000,,\nUp to 300 rows and 128 KB. Send this or holdings, not both."
},
"holdings": {
"type": "array",
"maxItems": 300,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"symbol",
"shares"
],
"properties": {
"account": {
"type": "string",
"maxLength": 60,
"description": "Account name, e.g. \"Joint brokerage\". Default \"Brokerage\"."
},
"accountType": {
"type": "string",
"maxLength": 30,
"description": "taxable, brokerage, individual, joint, trust, ira, traditional ira, rollover ira, sep ira, 401k, 403b, 457, roth, roth ira, roth 401k, hsa or other. Default taxable."
},
"symbol": {
"type": "string",
"maxLength": 18,
"description": "Ticker, e.g. VTI. Use CASH for cash balances."
},
"shares": {
"type": "number",
"exclusiveMinimum": 0,
"description": "Number of shares; for CASH, the dollar amount."
},
"costBasis": {
"type": "number",
"minimum": 0,
"description": "Total cost basis of this row in dollars (not per share). Omit when unknown."
},
"assetClass": {
"type": "string",
"maxLength": 120,
"description": "Optional override: us_equity, intl_equity, bonds, cash or alternatives, or a split such as \"us_equity:60;bonds:40\". Common ETFs and index funds are classified automatically; unknown tickers count as US stocks."
},
"acquired": {
"type": "string",
"maxLength": 10,
"description": "Date acquired, YYYY-MM-DD; decides short- or long-term gains."
}
}
},
"description": "Holdings as objects, instead of holdingsCsv. Up to 300 rows; one row per lot gives the best tax estimates."
},
"prices": {
"type": "object",
"maxProperties": 1000,
"additionalProperties": {
"type": "number",
"exclusiveMinimum": 0
},
"description": "Latest price per share by symbol, e.g. {\"VTI\": 301.25}. CASH and money-market funds are priced at $1. Symbols without a price here are fetched from live quotes."
},
"model": {
"type": "string",
"enum": [
"conservative",
"moderately_conservative",
"moderate",
"growth",
"aggressive"
],
"description": "Target model portfolio: conservative (20% stocks), moderately_conservative (40% stocks), moderate (60% stocks), growth (75% stocks), aggressive (90% stocks). Default moderate. risk_profile_score maps a client to one."
},
"target": {
"type": "object",
"additionalProperties": false,
"properties": {
"us_equity": {
"type": "number",
"minimum": 0,
"maximum": 100,
"description": "US stocks target %"
},
"intl_equity": {
"type": "number",
"minimum": 0,
"maximum": 100,
"description": "International stocks target %"
},
"bonds": {
"type": "number",
"minimum": 0,
"maximum": 100,
"description": "Bonds target %"
},
"cash": {
"type": "number",
"minimum": 0,
"maximum": 100,
"description": "Cash & equivalents target %"
},
"alternatives": {
"type": "number",
"minimum": 0,
"maximum": 100,
"description": "Real estate & alternatives target %"
}
},
"description": "Custom target allocation in percent, totalling 100. Use instead of model."
},
"band": {
"type": "number",
"minimum": 1,
"maximum": 25,
"description": "Rebalancing band in percentage points (default 5): an asset class further than this from target is out of band."
},
"newCash": {
"type": "number",
"minimum": 0,
"maximum": 1000000000000,
"description": "New money to invest, in dollars (default 0)."
},
"newCashAccount": {
"type": "string",
"maxLength": 60,
"description": "Account name that receives the new cash (default: the first taxable account)."
},
"minTrade": {
"type": "number",
"minimum": 0,
"maximum": 1000000,
"description": "Smallest trade in dollars (default 100)."
},
"taxRates": {
"type": "object",
"additionalProperties": false,
"description": "Capital-gains rates in percent used to estimate tax (default 24 short-term, 15 long-term).",
"properties": {
"shortTerm": {
"type": "number",
"minimum": 0,
"maximum": 60,
"description": "Short-term gains rate in percent."
},
"longTerm": {
"type": "number",
"minimum": 0,
"maximum": 60,
"description": "Long-term gains rate in percent."
}
}
},
"force": {
"type": "boolean",
"description": "Rebalance to target even when every class is within the band (default false)."
}
},
"additionalProperties": false
}