optionchain_simulator 0.0.0

OptionChain-Simulator is a lightweight REST API service that simulates an evolving option chain with every request. It is designed for developers building or testing trading systems, backtesters, and visual tools that depend on option data streams but want to avoid relying on live data feeds.
Documentation

optionchain_simulator

OptionChain-Simulator

License Build Crates.io Downloads Stars Issues

OptionChain-Simulator: RESTful Option Chain Time Simulator

Table of Contents

  1. Introduction
  2. Features
  3. Project Structure
  4. Setup Instructions
  5. API Usage
  6. Development
  7. Contribution and Contact

Introduction

OptionChain-Simulator is a lightweight REST API service that simulates an evolving option chain with every request. It is designed for developers building or testing trading systems, backtesters, and visual tools that depend on option data streams but want to avoid relying on live data feeds.

Features

  • 📡 REST API to fetch a simulated option chain.
  • ⏱ Each API request advances the simulation one time step.
  • 🧮 Option pricing using Black-Scholes or configurable models.
  • 🔄 Internal state memory with market evolution.
  • ⚙️ Easily configurable initial parameters (IV, strikes, steps).
  • 📦 JSON output for easy integration with other tools.
  • 📁 Static data support (CSV/JSON-based initial chains).

Setup Instructions

  1. Clone the repository:
git clone https://github.com/joaquinbejar/OptionChain-Simulator.git
cd OptionChain-Simulator
  1. Build the project:
cargo build --release
  1. Run the API server:
cargo run
  1. Access the API:
GET http://localhost:8080/chain

API Usage

GET /chain

Returns the current option chain and advances the simulation.

Response Example:
{
  "underlying_price": 102.5,
  "options": [
    {
      "strike": 100,
      "type": "Call",
      "expiration_days": 30,
      "implied_volatility": 0.2,
      "price": 4.32
    }
  ]
}

Development

Run the server with:

cargo run

Run tests:

cargo test

Run formatting and linting:

cargo fmt
cargo clippy

Contribution and Contact

Contributions are welcome! Please submit pull requests, issues, or suggestions.

Maintainer: Joaquín Béjar García 📧 jb@taunais.com 🔗 GitHub Profile


License: MIT