Solve for the yield to maturity (YTM) of a bond given its market price, coupon rate, and maturity. The YTM is the internal rate of return assuming the bond is held to maturity and all payments are made as scheduled. Uses iterative root-finding methods to solve the bond pricing equation. Essential for bond valuation, portfolio analysis, and comparing bonds with different characteristics.
API key for authentication. Get your key at https://finceptbackend.share.zrok.io/auth/register
Current market price of the bond (clean price)
98.5
Annual coupon rate as a decimal (e.g., 0.05 for 5%)
0.05
Time to maturity in years
5
Face value (par value) of the bond
100
Coupon payment frequency per year (1=annual, 2=semi-annual, 4=quarterly, 12=monthly)
1, 2, 4, 12 2
Initial guess for the yield (used by the solver)
0.05