https://github.com/yzimhao/trading_engine
Go开发的金融证券交易系统
https://github.com/yzimhao/trading_engine
matching matching-engine trading
Last synced: about 1 year ago
JSON representation
Go开发的金融证券交易系统
- Host: GitHub
- URL: https://github.com/yzimhao/trading_engine
- Owner: yzimhao
- License: bsd-2-clause
- Created: 2022-05-24T08:29:19.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T15:11:26.000Z (over 1 year ago)
- Last Synced: 2024-11-02T06:58:35.916Z (over 1 year ago)
- Topics: matching, matching-engine, trading
- Language: Go
- Homepage: https://yzimhao.github.io/trading_engine/
- Size: 32.5 MB
- Stars: 211
- Watchers: 8
- Forks: 59
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- my-awesome - yzimhao/trading_engine - engine,trading pushed_at:2025-12 star:0.3k fork:0.1k Go开发的金融证券交易所系统 (Go)
README
#### 贡献代码
全新重构,希望更多开源爱好者能加入共同开发练手,共同进步,请联系下方wx
#### 撮合
```
go get github.com/yzimhao/trading_engine/v2/pkg/matching
```
#### pkg example
```go
ctx := context.Background()
opts := []matching.Option{
matching.WithPriceDecimals(2),
matching.WithQuantityDecimals(2),
}
btcusdt = matching.NewEngine(ctx, "btcusdt", opts...)
//添加订单
btcusdt.AddItem(...)
//移除订单
btcusdt.RemoveItem(...)
//监听事件结果
btcusdt.OnTradeResult(func(result types.TradeResult) {
//TODO
})
btcusdt.OnRemoveResult(func(result types.RemoveResult) {
//TODO
})
//获取深度
btcusdt.GetAskOrderBook(10) // [][2]string [["1.01","4.00"],["1.10","2.00"]]
btcusdt.GetBidOrderBook(10)
```
#### 交流

#### Star History
[](https://star-history.com/#yzimhao/trading_engine&Date)
