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.
- Health check endpoint
- Monte Carlo simulation of stock prices
- Callable bond valuation
- Convertible bond valuation
- Modular and extensible code 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
- Python 3.8+
- pip
git clone https://github.com/Louie-AL/callable_bond_api.git
cd callable_bond_api
pip install -r requirements.txtpython run.pyThe server will start at http://localhost:5000.
GET /
Returns a simple message confirming the API is live.
{ "message": "Callable Bond Pricing API is running!" }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.
POST /price-callable-bond
(Coming Soon) Prices a callable bond based on simulated interest rates and call schedule.
POST /price-convertible-bond
(Coming Soon) Prices a convertible bond using stock simulation and bond cash flows.
- Python
- Flask
- NumPy / SciPy / Pandas
- Monte Carlo Simulation
MIT License