Price a Treasury security
price_treasury_securityConvert between price and yield for a Treasury bill, note or bond. Supply exactly one side — a price or a yield (a discount rate for a bill) — and the other is returned, with accrued interest, dirty price and the investment rate as applicable. For a note or bond, a CUSIP looks the terms up instead of restating them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cusip | No | CUSIP of a note or bond; its terms are looked up. | |
| frequency | No | Coupon payments per year. Defaults to 2. | |
| instrument | Yes | "bill" for a discount instrument under a year, "coupon" for a note or bond. The maths differs; the wrong choice returns a plausible wrong number. | |
| trade_date | No | Settlement date. Defaults to the most recent trading day. | |
| clean_price | No | Price per 100 of face, excluding accrued interest. | |
| maturity_date | No | Maturity, YYYY-MM-DD. Required for a bill. | |
| yield_percent | No | Yield to maturity for a coupon security. | |
| coupon_rate_percent | No | Annual coupon rate. Required for a coupon security without a CUSIP. | |
| discount_rate_percent | No | Bank discount rate for a bill. |