A proof of concept of an electronic trading system written in Golang
GoTrade is a FIX protocol electronic trading and order management system written in Golang, structured for typical multi-asset instituional use
This project is currently more of a proof of concept. It is no where near in completeness of a commerical product. This public repo serves as mostly for the purpose of experimenting and share of ideas.
$ go get -u github.com/cyanly/gotrade
└─ gotrade/ ├─ core/ -> The low-level API that gives consumers all the knobs they need │ ├─ order/ │ │ └─ execution/ │ ├─ service/ └─ proto/... -> Protobuf messaging protocol of various entities └─ services/ -> Core services managing multi-asset order flow │ ├─ orderrouter/ -> Centralized management facility for multi-asset global order flow │ ├─ marketconnectors/ -> Managing FIX connection to each trading venue, also performs pre-trade risk checks │ └─cmd/... -> Command-line executables, binary build targets
The best way to see goTrade in action is to take a look at tests (see Benchmark section below):
Pre-Requisites: - Go 1.4 or higher - get dependencies:
$ cd $GOPATH/src/github.com/cyanly/gotrade $ go get -u -t ./...
OrderRouter and MarketConnector test cases will mock a testdb and messaging bus for end-to-end, message to message test. ``` $ cd $GOPATH/src/github.com/cyanly/gotrade/services/orderrouter $ go test -v
$ cd $GOPATH/src/github.com/cyanly/gotrade/services/marketconnectors/simulator $ go test -v ```
Intel Core i5 CPU @ 2.80GHz+
Ubuntu 14.04 Desktop x86_64
Included: - from order to FIX to a fully fill execution message to execution protobuf published back - serialsing/deserialsing mock order into protobuf messages - Request/Publish and Response/Subscribe via NATS.io message bus - Time spent in the Linux TCP/IP stack - Decode FIX messages and reply by a simulated broker
Excluded: - Database transaction time (hard-wired to an inline mock DB driver)
0.176ms per op, 5670 order+fill pairs per sec