Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ayush272002/exchange
Cryptocurrency exchange platform designed to handle high-frequency trading and real-time market interactions.
https://github.com/ayush272002/exchange
expressjs monorepo nextjs postgresql pubsub redis turborepo websocket
Last synced: 5 days ago
JSON representation
Cryptocurrency exchange platform designed to handle high-frequency trading and real-time market interactions.
- Host: GitHub
- URL: https://github.com/ayush272002/exchange
- Owner: Ayush272002
- License: mit
- Created: 2024-08-31T21:45:05.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-08T12:22:36.000Z (about 2 months ago)
- Last Synced: 2024-10-31T13:04:20.104Z (5 days ago)
- Topics: expressjs, monorepo, nextjs, postgresql, pubsub, redis, turborepo, websocket
- Language: TypeScript
- Homepage: https://exchange-ayush.vercel.app
- Size: 40.9 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Exchange
This project is a fully-featured cryptocurrency exchange platform designed to handle high-frequency trading and real-time market interactions. It includes an API server for user requests, a memory-based engine for order book management and balance tracking, and a WebSocket server for live updates. The platform integrates a DB Processor for persistent data storage, a frontend built with Next.js, and a Market Maker for liquidity. Redis is used for queuing and pub/sub messaging, while TimescaleDB handles time-series data for advanced kline charting. Together, these components create a robust, scalable trading environment for both developers and users.
## Tech Stack
- Typescript
- Monorepo/ Turborepo
- Next.js
- Expressjs
- Redis
- Redis Pub Subs
- Websockets
- Timescale Db
- Docker
- CI/CD
- Husky## Architecture
![workflow](images/workflow.png)
1. API - An API Server the user sends HTTP requests to
2. Engine - Runs various market orderbooks, stores user balances in memory
3. Websocket - Websocket server that user subscribes to real time events from
4. DB Processor - Processes messages from the `Engine` and persists them in the DB
5. Frontend - NextJS app (same as last week, only the URLs would change)
6. Market maker (mm) - Places random orders to keep the book liquid
7. Redis - Queue and pub sub
8. TimescaleDB - Creates buckets of klines based on price feed## Preview
## Running the project locally
There is a [docker-compose.yml](./docker-compose.yml) in each of the services fill in the environment variables after that in the project's root dir run
```shell
git clone https://github.com/Ayush272002/Exchange.git
cd Exchange
docker-compose up
```## Contributing
Contributions are welcome! If you have suggestions for new features, bug fixes, or improvements, please fork the repository and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Contact
If you have any questions or suggestions, please feel free to contact.