Skip to content

Louie-AL/callable_bond_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Callable Bond API

This project is a Flask-based API for simulating financial instruments and pricing callable and convertible bonds using Monte Carlo methods. It is designed to support integration with front-end interfaces or other systems that require access to advanced bond pricing computations.


Features

  • Health check endpoint
  • Monte Carlo simulation of stock prices
  • Callable bond valuation
  • Convertible bond valuation
  • Modular and extensible code structure

📁 Project Structure

.
├── app/                    # Core logic for pricing and simulations
├── backend/                # API route definitions and handlers
├── callable_bond_ui/       # (Optional) Front-end or UI-related code
├── run.py                  # App entry point
├── config.py               # Configuration file
├── requirements.txt        # Python dependencies
└── README.md               # Project documentation

Setup

Prerequisites

  • Python 3.8+
  • pip

Installation

git clone https://github.com/Louie-AL/callable_bond_api.git
cd callable_bond_api
pip install -r requirements.txt

Running the API

python run.py

The server will start at http://localhost:5000.


API Endpoints

Health Check

GET /
Returns a simple message confirming the API is live.

{ "message": "Callable Bond Pricing API is running!" }

Simulate Stock Price

POST /simulate-stock

Simulates stock price paths using geometric Brownian motion.

Request Body:

{
  "n_simulations": 1000,
  "n_steps": 252,
  "initial_price": 100,
  "mu": 0.07,
  "sigma": 0.2,
  "time_interval": 1
}

Response:

A JSON object containing simulated price paths.


[Planned] Price Callable Bond

POST /price-callable-bond

(Coming Soon) Prices a callable bond based on simulated interest rates and call schedule.


[Planned] Price Convertible Bond

POST /price-convertible-bond

(Coming Soon) Prices a convertible bond using stock simulation and bond cash flows.


Technologies

  • Python
  • Flask
  • NumPy / SciPy / Pandas
  • Monte Carlo Simulation

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages