sell
Record a sell transaction in the ledger to reduce a holding's units and credit cash. Use after executing a trade at your broker.
Instructions
Record a sell in the local ledger: reduces the position's units (average cost unchanged) and credits cash in the holding's cost currency. Bookkeeps a trade already executed at the user's broker — openInvest never places real orders.
Confirm symbol, units, and price with the user before calling; this moves ledger cash.
Args: symbol: yfinance ticker of an existing holding. units: Quantity sold; must be > 0. price: Execution price per unit, in the holding's cost currency.
Returns: Updated position summary, or {"status": "error", "error": ...}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| price | Yes | Execution price per unit, in the holding's cost currency. | |
| units | Yes | Quantity sold; must be > 0. | |
| symbol | Yes | yfinance ticker of an existing holding. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |