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.
- Python 3.10+
- Poetry (run
curl -sSL https://install.python-poetry.org | python3 -
)
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.
# 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
- Add a trade execution and publisher system as a separate service.
- Setup docker compose for easy deployment and testing.
Learning more about trading systems and trying out some python libs.
- FastAPI with Poetry, Alembic, and SQLAlchemy was interesting to setup.
β hit the star button if you found this useful β
Source | Blog | Twitter | LinkedIn | More Links | Other Projects