Rebalance trades to target weights
portfolio-analytics_rebalance-tradesCompute buys and sells that restore target weights with tolerance bands, a cash buffer, minimum trade size and whole-share rounding. Price $0.03 USDC. POST /api/v1/portfolio-analytics/rebalance-trades. An unpaid call returns the x402 payment terms and does not run.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"holdings": "<holdings>",
"targets": "<targets>"
},
"name": "portfolio-analytics_rebalance-trades"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| band | No | band, object. Required. | |
| cash | No | cash, number, from 0 to any. Required. | |
| targets | Yes | targets, object. Required. | |
| holdings | Yes | holdings, array. Required. | |
| cashBuffer | No | cashBuffer, number, from 0 to 0.5. Required. | |
| fractional | No | fractional, boolean. Required. | |
| restricted | No | restricted, array. Required. | |
| minTradeValue | No | minTradeValue, number, from 0 to any. Required. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trades | No | trades. Array. | |
| sources | No | sources. Array. | |
| cashAfter | No | cashAfter. Number. | |
| untouched | No | untouched. Array. | |
| investable | No | investable. Number. | |
| totalValue | No | totalValue. Number. | |
| limitations | No | limitations. Array. | |
| weightsAfter | No | weightsAfter. Object. |