curve_from_pasted_table
Build discount, zero, or par curves from pasted market-data tables by parsing rows, validating quotes, and reporting unparsed data for pricing workflows.
Instructions
A curve from a table the user pasted (a vendor curve screen, a spreadsheet, a ticket): parses it and calls build_value_curve (discount / zero) or build_curve (par quotes). No engine call; no arithmetic on the values.
Args:
text: the pasted rows. CSV / TSV / ';' / '|' / whitespace separated, header
optional. Each row: a date (2034-09-18, 18-Sep-2034,
09/18/2034 with date_format) or a tenor (10Y), then the
value. % values are divided by 100; 1,000.5 loses its commas.
An optional word per row (ois, swap, deposit) tags a par
quote's type.
id: curve id to register.
kind: discount (discount factors -> InterpolatedDiscount), zero
(zero rates -> InterpolatedZero) or par (market quotes -> bootstrap
helpers of the preset).
market_data_source: where the market numbers in this call come from. user_pasted
(the user pasted or typed the numbers in this conversation), user_file (the
user attached a file/screenshot the numbers were read from), engine_example
(an engine example's pricing block, only when the user explicitly asked to run
an example), session (a market previously stored in this session, which
itself came from one of the above). There is no value for estimated, recalled or
placeholder data. If you would have to invent numbers, do not call this tool:
ask the user for the data.
preset: supplies the curve day counter and point calendar/convention
(USD_SOFR_OIS...); required for par; or give conventions.
reference_date: the curve / as-of date. For discount it may be omitted
when the first row is that date with value 1.0.
quote_type: par tables only: the helper type when the rows do not name one
and the preset offers several.
percent: true = every value is a percentage; default: only values
written with %.
date_format: mdy / dmy for slash dates; inferred when a field exceeds
12, otherwise required.
compounding, frequency: zero tables only (default Continuous / Annual).
interpolator: override the builder default.
Returns the builder result ({ok, curve, indices, preset, notes}) plus
parsed_rows (line, label, value as read), unparsed (line, text,
reason) and header. For a discount table whose first row is not the
reference date, the anchor point {reference_date: 1.0} the engine
requires is added in front and said so in notes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| kind | Yes | ||
| text | Yes | ||
| preset | No | ||
| percent | No | ||
| frequency | No | ||
| quote_type | No | ||
| compounding | No | ||
| conventions | No | ||
| date_format | No | ||
| interpolator | No | ||
| reference_date | No | ||
| market_data_source | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||