Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yzimhao/trading_engine

Go开发的金融证券交易系统
https://github.com/yzimhao/trading_engine

matching matching-engine trading

Last synced: about 1 month ago
JSON representation

Go开发的金融证券交易系统

Awesome Lists containing this project

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

[![Star History Chart](https://api.star-history.com/svg?repos=yzimhao/trading_engine&type=Date)](https://star-history.com/#yzimhao/trading_engine&Date)

![Visitor's Count](https://profile-counter.glitch.me/yzimhao_trading_engine/count.svg)