POST /v1/quotes
主要端点。可对一组可选的临时(ad-hoc)工具进行定价,外加一组通过 id 引用工具的报价(quotes)(引用的可以是临时工具池中的工具,也可以是已存储的工具)。返回一个批量结果——每条报价对应一个条目,每个条目都有各自的状态。
请求体
{
"instruments": [ /* optional ad-hoc pool; each item needs an id */ ],
"quotes": [ /* one or more quotes */ ]
}
报价字段
| Field | Required | Description |
|---|---|---|
instrument_id | yes | 临时工具池中某工具的 id,或某个已存储工具的 id |
input_kind | yes | yield · clean_price · dirty_price · transacted |
input_value | yes | 收益率(小数)或价格(每 100 面值),或成交现金额 |
amount_kind | no | nominal 或 transacted(交易规模) |
amount_value | no | 当设置了 amount_kind 时必填(> 0) |
settlement_date | no | ISO 日期;默认为当天 |
options | no | 见下文 |
input_kind
| Value | You supply | emrgex returns |
|---|---|---|
yield | 一个收益率 | 价格 + 指标 |
clean_price | 一个净价 | 求解出的收益率 + 指标 |
dirty_price | 一个全价 | 求解出的收益率 + 指标 |
transacted | 一笔全价现金额(需配合 amount_kind: nominal) | 先推导出价格,再求解 |
options
| Option | Type | Description |
|---|---|---|
round | int (0–12) | 将货币/利率输出四舍五入到 N 位小数 |
with_cashflows | bool | 包含完整的折现现金流计划表 |
yield_worst | bool | 为可赎回债券计算最差收益率(yield-to-worst) |
coupon_type | FIXED/ACCRUAL | 按报价覆盖票息机制(情景假设/what-if) |
index_ratio | number | 指数挂钩债券公布的指数化名义本金(VNA);每一项货币输出都会乘以 index_ratio/100 |
响应——批量信封结构
{
"data": [
{
"index": 0,
"id": "MH12034",
"status": "ok",
"data": {
"instrument_id": "MH12034",
"convention": "NOMINAL · ACT/ACT.DRMH",
"calculation_code": "ACT/ACT.DRMH|NOMINAL",
"coupon_type": "ACCRUAL",
"settlement_date": "2026-06-09T00:00:00Z",
"metrics": { "yield": 0.1, "dirty_price": 112.547645, "clean_price": 107.853124, "...": "..." },
"next_coupon": { "date": "...", "interest": 5.75, "total": 5.75, "present_value": 5.7 }
}
}
],
"warnings": []
}
- 每个条目要么是
status: "ok"并带有data载荷,要么是status: "failed"并带有一个符合 RFC 7807 的error对象——单条报价出错绝不会导致整个批次失败。 - 价格→收益率求解未收敛时,会针对该条目返回
422。
五种输入场景
input_kind × amount_kind 覆盖了各种成交组合:
input_kind | amount_kind | Use |
|---|---|---|
yield | nominal | 收益率 + 面值 → 价格与结算现金 |
yield | transacted | 收益率 + 现金 → 隐含名义本金 |
clean_price | nominal | 价格 + 面值 → 收益率与现金 |
clean_price | transacted | 价格 + 现金 → 收益率与名义本金 |
transacted | nominal | 现金 + 面值 → 价格与收益率 |
完整请求体请参见 示例。