Skip to content

PersonaNormale/orderbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Orderbook Microservice

A simple order book implementation with HTTP API for managing orders and matching trades.

Features

  • Order placement and cancellation
  • Order book snapshots
  • Best bid/ask queries
  • Order matching engine
  • Real-time trade execution

Quick Start

  1. Start the server:
go run cmd/api/main.go
  1. Place an order:
curl -X POST http://localhost:8080/orders/place \
  -H "Content-Type: application/json" \
  -d '{"side": "BUY", "price": 100.0, "amount": 1.0}'

API Endpoints

  • POST /orders/place - Place new order
  • DELETE /orders/cancel - Cancel existing order
  • PATCH /orders/modify - Modify order
  • GET /orderbook/snapshot - Get orderbook state
  • GET /orderbook/best-bid - Get best bid
  • GET /orderbook/best-ask - Get best ask
  • POST /orders/process - Process order

TODO List

Priority items:

  • Better Performance Implementation
  • Add authentication
  • Add logging system

Future enhancements:

  • Add persistence layer
  • Implement websocket for real-time updates
  • Support for different order types (market, limit)
  • Trade history

About

A simple orderbook microservice implemented in Go.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages