Dollar-Cost Averaging
dollar-cost-averagingDollar-cost averaging: buying a fixed amount each period at the given prices. Returns units accumulated, total invested, average cost, and final value at the last price.
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": {
"prices": "<prices>",
"periodicInvestment": "<periodicInvestment>"
},
"name": "dollar-cost-averaging"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prices | Yes | Price at each purchase period. | |
| periodicInvestment | Yes | Fixed amount invested each period. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| units | No | Units accumulated. | |
| avgCost | No | Average cost per unit (null if none). | |
| invested | No | Total invested. | |
| finalValue | No | Value at the last price. |