Skip to content

2KAbhishek/limit-order-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

39 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

License People Stars Forks Watches Last Updated

Order Book API in Python πŸ“ˆπŸ’°

limit-order-api is an api that provides order book functionality for trading.

  • Easy to use REST API.
  • OpenAPI documentation included.
  • Easy setup and package management with Poetry.
  • Implemented with Test Driven Development (>90% Coverage).
  • Fast and powerful CI with GitHub actions.

⚑ Setup

βš™οΈ Requirements

  • Python 3.10+
  • Poetry (run curl -sSL https://install.python-poetry.org | python3 -)

πŸ’» Setup

Setting up limit-order-api is as simple as cloning and running the server.

git clone https://github.com/2kabhishek/limit-order-api
cd limit-order-api

# install dependencies
poetry install

# database migrations
poetry run alembic upgrade head

# run tests
poetry run pytest

# run server
poetry run uvicorn limit_order_api.main:app --reload
# or
poetry run dev

The Open API documentation is available at http://localhost:8000/docs once the server is running.

πŸš€ Usage

πŸ“¦ More Commands

# create a new migration
poetry run alembic revision --autogenerate -m "migration message"

# migration history
poetry run alembic history

# run tests with coverage
poetry run pytest --cov=limit_order_api

πŸ—οΈ What's Next

βœ… To-Do

  • Add a trade execution and publisher system as a separate service.
  • Setup docker compose for easy deployment and testing.

πŸ§‘β€πŸ’» Behind The Code

🌈 Inspiration

Learning more about trading systems and trying out some python libs.

πŸ’‘ Challenges/Learnings

  • FastAPI with Poetry, Alembic, and SQLAlchemy was interesting to setup.

🧰 Tooling

  • dots2k β€” Dev Environment
  • nvim2k β€” Personalized Editor

⭐ hit the star button if you found this useful ⭐

Source | Blog | Twitter | LinkedIn | More Links | Other Projects

About

Order Book API in Python πŸ“ˆπŸ’°

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published