POST /v1/quotes
主要端點。為一個可選的**臨時(ad-hoc)**工具池,加上一份以 id 引用工具(池中的臨時工具或已儲存工具)的 quotes 清單進行定價。回傳一個批次結果——每筆報價對應一個項目,各自帶有其自身的狀態。
Request body
{
"instruments": [ /* optional ad-hoc pool; each item needs an id */ ],
"quotes": [ /* one or more quotes */ ]
}
Quote fields
| Field | Required | Description |
|---|---|---|
instrument_id | yes | 池中臨時工具或已儲存工具的 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 |
Response — batch envelope
{
"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。
The five input scenarios
input_kind × amount_kind 涵蓋了各種交易組合:
input_kind | amount_kind | Use |
|---|---|---|
yield | nominal | 殖利率 + 面額 → 價格與交割現金 |
yield | transacted | 殖利率 + 現金 → 隱含面額 |
clean_price | nominal | 價格 + 面額 → 殖利率與現金 |
clean_price | transacted | 價格 + 現金 → 殖利率與面額 |
transacted | nominal | 現金 + 面額 → 價格與殖利率 |
完整的 request body 請參閱 範例。