create_price
Record a commodity price (stock, NAV, or exchange rate) and update any existing entry matching commodity, date, and source.
Instructions
Record a price for a commodity (stock, NAV, exchange rate).
An existing price with the same commodity/currency/date/source is updated rather than duplicated.
Args:
commodity: Symbol (e.g., "VTSAX").
namespace: Commodity namespace (e.g., "FUND", "NASDAQ").
value: Price per unit as decimal string (e.g., "250.45").
currency: ISO currency code. Defaults to the book's default
currency — so create_price(commodity="USD", value="7.30")
on a CNY-default book stores "1 USD = 7.30 CNY" (the
natural reading). Pass explicitly for cross-currency
pairs that don't involve the book default.
date: ISO date (YYYY-MM-DD). Defaults to today.
price_type: "nav" (default, mutual funds), "last", "bid",
"ask", or "unknown".
source: Source identifier. Default "user:price".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | ||
| value | Yes | ||
| source | No | user:price | |
| currency | No | ||
| commodity | Yes | ||
| namespace | Yes | ||
| price_type | No | nav |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |