portfolio-rebalance
ActiveTool of The Stall
Pure-math portfolio rebalancing calculator. Given current holdings (asset names and their current USD values) and target allocations (percentages summing to 100), returns the exact buy/sell dollar amounts needed to reach target weights. Handles partial rebalancing with a drift threshold. No external API — deterministic and instant. Useful for DeFi agents, robo-advisory flows, and automated rebalancing triggers.
Parameters schema
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"targets": {
"type": "array",
"items": {
"type": "string"
},
"description": "Target allocation percentages. Must sum to 100."
},
"holdings": {
"type": "array",
"items": {
"type": "string"
},
"description": "Current portfolio positions."
},
"cash_injection": {
"type": "number",
"description": "Optional additional cash (USD) to deploy during rebalancing (positive = buying, negative = withdrawing)."
},
"drift_threshold_pct": {
"type": "number",
"description": "Minimum drift percentage before an asset is flagged as needing rebalance (default 1.0). Positions within threshold are marked 'in_range'."
}
},
"additionalProperties": false
}No endpoints wrapped at confidence ≥ 0.70.
Parent server
The Stall
1/7 registries