https://github.com/danielgatis/go-orderbook
The pkg go-orderbook implements a limit order book for high-frequency trading (HFT), as described by WK Selph.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (7.9%) to scientific vocabulary
Keywords
Repository
The pkg go-orderbook implements a limit order book for high-frequency trading (HFT), as described by WK Selph.
Basic Info
Statistics
- Stars: 22
- Watchers: 2
- Forks: 8
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Go - Orderbook
The pkg go-orderbook implements a limit order book for high-frequency trading (HFT), as described by WK Selph.
Based on WK Selph's Blogpost: https://goo.gl/KF1SRm
Install
bash
go get -u github.com/danielgatis/go-orderbook
And then import the package in your code:
go
import "github.com/danielgatis/go-orderbook"
Example
An example described below is one of the use cases.
```go package main
import ( "bytes" "encoding/json" "fmt" "math/rand" "time"
"github.com/danielgatis/go-orderbook"
"github.com/google/uuid"
"github.com/shopspring/decimal"
)
func main() { book := orderbook.NewOrderBook("BTC/BRL")
for i := 0; i < 10; i++ {
rand.Seed(time.Now().UnixNano())
side := []orderbook.Side{orderbook.Buy, orderbook.Sell}[rand.Intn(2)]
book.ProcessPostOnlyOrder(uuid.New().String(), uuid.New().String(), side, decimal.NewFromInt(rand.Int63n(1000)), decimal.NewFromInt(rand.Int63n(1000)))
}
depth, _ := json.Marshal(book.Depth())
var buf bytes.Buffer
json.Indent(&buf, depth, "", " ")
fmt.Println(buf.String())
} ```
❯ go run main.go
{
"bids": [
{
"amount": "392",
"price": "930"
},
{
"amount": "872",
"price": "907"
},
{
"amount": "859",
"price": "790"
},
{
"amount": "643",
"price": "424"
},
{
"amount": "269",
"price": "244"
},
{
"amount": "160",
"price": "83"
},
{
"amount": "74",
"price": "65"
}
],
"asks": [
{
"amount": "178",
"price": "705"
},
{
"amount": "253",
"price": "343"
},
{
"amount": "805",
"price": "310"
}
]
}
License
Copyright (c) 2020-present Daniel Gatis
Licensed under MIT License
Buy me a coffee
Liked some of my work? Buy me a coffee (or more likely a beer)
Owner
- Name: Daniel Gatis
- Login: danielgatis
- Kind: user
- Location: Recife - PE
- Repositories: 37
- Profile: https://github.com/danielgatis
GitHub Events
Total
- Watch event: 1
- Fork event: 1
Last Year
- Watch event: 1
- Fork event: 1
Committers
Last synced: 10 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Daniel Gatis | d****s@g****m | 10 |
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 1
- Total pull requests: 0
- Average time to close issues: 7 months
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 3.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- vahidalvandi (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 1
- Total dependent repositories: 1
- Total versions: 2
proxy.golang.org: github.com/danielgatis/go-orderbook
Package orderbook is a Limit Order Book for high-frequency trading.
- Homepage: https://github.com/danielgatis/go-orderbook
- Documentation: https://pkg.go.dev/github.com/danielgatis/go-orderbook#section-documentation
- License: MIT
-
Latest release: v0.0.0-20230808024110-7640955559eb
published almost 3 years ago
Rankings
Dependencies
- github.com/danielgatis/go-orderbook v0.0.0-20211221232158-a76adcecdd12
- github.com/emirpasic/gods v1.12.0
- github.com/google/uuid v1.3.0
- github.com/shopspring/decimal v1.3.1
- github.com/bradleyjkemp/cupaloy/v2 v2.7.0
- github.com/danielgatis/go-orderbook v0.0.0-20211221232158-a76adcecdd12
- github.com/davecgh/go-spew v1.1.0
- github.com/davecgh/go-spew v1.1.1
- github.com/emirpasic/gods v1.12.0
- github.com/google/uuid v1.3.0
- github.com/pmezard/go-difflib v1.0.0
- github.com/shopspring/decimal v1.3.1
- github.com/stretchr/objx v0.1.0
- github.com/stretchr/objx v0.1.1
- github.com/stretchr/testify v1.6.1
- github.com/stretchr/testify v1.7.0
- gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
- gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
- github.com/bradleyjkemp/cupaloy/v2 v2.8.0
- github.com/davecgh/go-spew v1.1.1
- github.com/emirpasic/gods v1.18.1
- github.com/google/uuid v1.3.0
- github.com/pmezard/go-difflib v1.0.0
- github.com/shopspring/decimal v1.3.1
- github.com/stretchr/testify v1.8.4
- gopkg.in/yaml.v3 v3.0.1
- github.com/bradleyjkemp/cupaloy/v2 v2.8.0
- github.com/davecgh/go-spew v1.1.0
- github.com/davecgh/go-spew v1.1.1
- github.com/emirpasic/gods v1.18.1
- github.com/google/uuid v1.3.0
- github.com/pmezard/go-difflib v1.0.0
- github.com/shopspring/decimal v1.3.1
- github.com/stretchr/objx v0.1.0
- github.com/stretchr/objx v0.1.1
- github.com/stretchr/testify v1.6.1
- github.com/stretchr/testify v1.8.4
- gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
- gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
- gopkg.in/yaml.v3 v3.0.1
