{"id":36459175,"url":"https://github.com/konimarti/fixedincome","last_synced_at":"2026-01-24T20:15:06.971Z","repository":{"id":57577202,"uuid":"358406972","full_name":"konimarti/fixedincome","owner":"konimarti","description":"Fixed income valuation with term structure models and Monte Carlo simulations: Pricing straight, floating and callable bonds, swaps, swaptions, forward rate agreements, and more exotic securities such as inverse or range floaters","archived":false,"fork":false,"pushed_at":"2023-03-31T14:08:34.000Z","size":274,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-12T01:33:29.177Z","etag":null,"topics":["bonds","finance","financial-analysis","fintech","fixed-income","forwardrateagreement","forwards","ho-lee","interestrateswaps","montecarlo-simulation","options","options-pricing","quantitative-finance","termstructure","valuation","vasicek"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/konimarti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security.go","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-15T22:18:59.000Z","updated_at":"2025-03-19T05:01:48.000Z","dependencies_parsed_at":"2024-06-19T19:13:48.317Z","dependency_job_id":null,"html_url":"https://github.com/konimarti/fixedincome","commit_stats":null,"previous_names":["konimarti/bonds"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/konimarti/fixedincome","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konimarti%2Ffixedincome","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konimarti%2Ffixedincome/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konimarti%2Ffixedincome/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konimarti%2Ffixedincome/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/konimarti","download_url":"https://codeload.github.com/konimarti/fixedincome/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konimarti%2Ffixedincome/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28736502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T19:23:36.361Z","status":"ssl_error","status_checked_at":"2026-01-24T19:23:28.966Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bonds","finance","financial-analysis","fintech","fixed-income","forwardrateagreement","forwards","ho-lee","interestrateswaps","montecarlo-simulation","options","options-pricing","quantitative-finance","termstructure","valuation","vasicek"],"created_at":"2026-01-11T23:51:39.422Z","updated_at":"2026-01-24T20:15:06.966Z","avatar_url":"https://github.com/konimarti.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Valuation of Fixed Income Securities\n\n[![License](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://github.com/konimarti/fixedincome/blob/master/LICENSE)\n[![GoDoc](https://godoc.org/github.com/konimarti/observer?status.svg)](https://godoc.org/github.com/konimarti/fixedincome)\n[![goreportcard](https://goreportcard.com/badge/github.com/konimarti/observer)](https://goreportcard.com/report/github.com/konimarti/fixedincome)\n\nValuation of fixed income securities with a spot-rate term structure or continuous-time interest-rate models.\nThis package can handle and optimize Nelson-Siegel-Svensson or cubic splines term structures from a list of bonds.\nMonte Carlo simulations can be used to price exotic securities with an interest rate model. Currently, the Ho-Lee and Vasicek models are implemented.\n\nFinancial instruments covered:\n\n- Fixed-coupon and floating rate bonds\n- Foward contracts and forward rate agreeements\n- Interest rate swaps\n- European options (with Black-Scholes)\n- European, Asian, American options with Monte Carlo\n- Ho-Lee and Vasicek interest rate models\n\n`go get github.com/konimarti/fixedincome`\n\n## Apps\n\n- `termfit` fits a spot-rate curve to a set of bonds given their quoted prices and maturity dates.\n- `bonds-cli` can be used to value a simple straight fixed-coupon bond\n- `swaprate-cli` provides the swap rates for a set of maturities for the given spot-rate curve\n- `option-cli` is pricing plain vanilla European call or put options and calculates all the 'Greeks'\n\n## Nelson-Siegel-Svensson parameters\n\nMany central banks offer daily updates of the fitted parameters for the Nelson-Siegel-Svensson model:\n\n- Swiss National Bank (SNB) for [CHF risk-free spot rates](https://data.snb.ch/en/topics/ziredev#!/cube/rendopar)\n\n- European Central Bank (ECB) for [EUR risk-free spot rates](https://www.ecb.europa.eu/stats/financial_markets_and_interest_rates/euro_area_yield_curves/html/index.en.html)\n\n## Code example for a straight bond\n\n- Valuation of more exoctic securities are given in the example folder\n\n```go\n\t// define straight bond\n\tstraightBond := bond.Straight{\n\t\tSchedule: maturity.Schedule{\n\t\t\tSettlement: time.Date(2021,4,17,0,0,0,0,time.UTC),\n\t\t\tMaturity:   time.Date(2026,5,25,0,0,0,0,time.UTC),\n\t\t\tFrequency:  1,\n\t\t},\n\t\tCoupon:     1.25,\n\t\tRedemption: 100.0,\n\t}\n\n\t// define term structure\n        // Nelson-Siegel-Svensson parameters as 2021-03-31 for Swiss government bonds\n\tterm := term.NelsonSiegelSvensson{\n\t\t-0.266372,\n\t\t-0.471343,\n\t\t5.68789,\n\t\t-5.12324,\n\t\t5.74881,\n\t\t4.14426,\n\t\t0.0,\n\t}\n```\n\n```go\n\t// price risk-free bond\n\tvalue := straightBond.PresentValue(\u0026term)\n\n\t// modified duration\n\tduration := straightBond.Duration( \u0026term)\n\n\t// accrued interest (30/360 day convention) and \"dirty\" price of bond\n\taccrued := straightBond.Accrued()\n\tcleanPrice := value - accrued\n\n\t// internal rate of return given a market price\n\tirr, _ := fixedincome.IRR(109.70, straightBond)\n\n\t// implied static spread\n\tspread, _ := fixedincome.Spread(109.70, straightBond, \u0026term)\n```\n\n## Further reading\n\n- [Nelson-Siegel-Svensson model at SNB](https://www.snb.ch/de/mmr/reference/quartbul_2002_2_komplett/source/quartbul_2002_2_komplett.de.pdf) on page 64\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonimarti%2Ffixedincome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonimarti%2Ffixedincome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonimarti%2Ffixedincome/lists"}