https://github.com/bsdz/rest_opt_pricer

A simple REST based option pricer.

https://github.com/bsdz/rest_opt_pricer

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.2%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

A simple REST based option pricer.

Basic Info
  • Host: GitHub
  • Owner: bsdz
  • Language: Python
  • Default Branch: master
  • Size: 31.3 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 3 years ago · Last pushed about 3 years ago
Metadata Files
Readme

README.md

restoptpricer

Price vanilla options using simple REST API.

Run following commands. You'll need poetry.

```bash

clone repo or unzip source

...

create venv

$ python3.10 -mvenv .venv

activate

$ . .venv/bin/activate

install deps

$ poetry install

run app

$ poetry run python webapp.py ```

You should see:

bash ======== Running on http://0.0.0.0:8080 ======== (Press CTRL+C to quit)

In a separate terminal you can do:

```bash

see uploaded market data

$ curl http://0.0.0.0:8080/marketdata/get; echo {}

upload json market data

$ curl -F data=@./market_data.json http://0.0.0.0:8080/marketdata/put; echo {"message": "success"}

check market data uploaded okay

$ curl http://0.0.0.0:8080/marketdata/get; echo [{"Symbol": "BRN", "Tenors": ["Jan24", "Feb24"], "FuturesPrice": [100, 120], "SmileCallDeltas": [0.1, 0.25, 0.5, 0.75, 0.9], "VolatilitySurface": [[50, 49, 48, 49, 50], [51, 50, 49, 50, 51]]}, {"Symbol": "HH", "Tenors": ["Feb24", "Mar24"], "FuturesPrice": [100, 120], "SmileCallDeltas": [0.1, 0.25, 0.5, 0.75, 0.9], "VolatilitySurface": [[50, 49, 48, 49, 50], [51, 50, 49, 50, 51]]}]

price an option

$ curl http://0.0.0.0:8080/optionpricing/european/BRN/Jan24/Call/100; echo {"premium": 15.951506051334627}

price an option

$ curl http://0.0.0.0:8080/optionpricing/european/BRN/Jan24/Put/110; echo {"premium": 22.122937284478322}

some basic error handling.

$ curl http://0.0.0.0:8080/optionpricing/european/BRN/Jan24/PutX/100; echo {"error": "option must be either put or call"} ```

Owner

  • Name: Blair Azzopardi
  • Login: bsdz
  • Kind: user
  • Location: London

Amateur mathematician. I enjoy researching different fields from applied maths to number theory. I like building RaspberryPi projects. Quant developer by day.

GitHub Events

Total
Last Year

Dependencies

poetry.lock pypi
  • black 23.1.0 develop
  • click 8.1.3 develop
  • colorama 0.4.6 develop
  • isort 5.12.0 develop
  • mypy 1.1.1 develop
  • mypy-extensions 1.0.0 develop
  • packaging 23.0 develop
  • pathspec 0.11.1 develop
  • platformdirs 3.1.1 develop
  • tomli 2.0.1 develop
  • typing-extensions 4.5.0 develop
  • aiohttp 3.8.4
  • aiosignal 1.3.1
  • async-timeout 4.0.2
  • attrs 22.2.0
  • charset-normalizer 3.1.0
  • frozenlist 1.3.3
  • idna 3.4
  • multidict 6.0.4
  • numpy 1.24.2
  • pandas 1.5.3
  • python-dateutil 2.8.2
  • pytz 2022.7.1
  • scipy 1.10.1
  • six 1.16.0
  • yarl 1.8.2
pyproject.toml pypi
  • black ^23.1.0 develop
  • isort ^5.12.0 develop
  • mypy ^1.1.1 develop
  • aiohttp ^3.8.4
  • numpy ^1.24.2
  • pandas ^1.5.3
  • python ^3.10,<3.12
  • scipy ^1.10.1