Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ammario/kalshi
Go client for the Kalshi API
https://github.com/ammario/kalshi
algorithmic-trading go golang kalshi trading-algorithms trading-bot
Last synced: 25 days ago
JSON representation
Go client for the Kalshi API
- Host: GitHub
- URL: https://github.com/ammario/kalshi
- Owner: ammario
- License: cc0-1.0
- Created: 2023-02-18T05:11:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-20T18:39:03.000Z (9 months ago)
- Last Synced: 2024-06-20T12:38:32.944Z (5 months ago)
- Topics: algorithmic-trading, go, golang, kalshi, trading-algorithms, trading-bot
- Language: Go
- Homepage:
- Size: 112 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# kalshi
[![Go Reference](https://pkg.go.dev/badge/github.com/ammario/kalshi.svg)](https://pkg.go.dev/github.com/ammario/kalshi)
![Go workflow status](https://github.com/ammario/kalshi/actions/workflows/go.yaml/badge.svg)
[![codecov](https://codecov.io/gh/ammario/kalshi/branch/main/graph/badge.svg?token=1SBIWOG23L)](https://codecov.io/gh/ammario/kalshi)Package `kalshi` provides a Go implementation of [the Kalshi API](https://trading-api.readme.io/reference/getting-started).
```
go get github.com/ammario/kalshi
```Supports:
* Streaming market data feed
* All core API endpoints
* Rate-limits
* Cursor-based pagination## Basic Usage
See the `_test.go` files for more examples.```go
func main() {
client := New(kalshi.APIProdURL)
ctx := context.Background()
err := client.Login(
ctx,
"[email protected]", "hunter12",
)
if err != nil {
panic(err)
}
defer client.Logout(ctx)// Get all S&P 500 markets.
markets, err := client.Markets(ctx, kalshi.MarketsRequest{
SeriesTicker: "INX"
})
if err != nil {
panic(err)
}for _, market := range markets {
fmt.Println("found market", market)
}
}
```## Endpoint Support
### Markets
`kalshi` supports all Market endpoints.
| Endpoint | Support Status |
| ------------------ | -------------- |
| GetSeries | ✅ |
| GetEvent | ✅ |
| GetMarkets | ✅ |
| GetTrades | ✅ |
| GetMarket | ✅ |
| GetMarketHistory | ✅ |
| GetMarketOrderbook | ✅ |
| GetSeries | ✅ |### Exchange
`kalshi` supports all Exchange endpoints.| Endpoint | Support Status |
|---------------------| -------------- |
| GetExchangeSchedule | ✅ |
| GetExchangeStatus | ✅ |### Auth
`kalshi` supports all Auth endpoints.
| Endpoint | Support Status |
| -------- | -------------- |
| Login | ✅ |
| Logout | ✅ |### Portfolio
`kalshi` has mixed support for Portfolio endpoints.
| Endpoint | Support Status |
| ---------------------- | -------------- |
| GetBalance | ✅ |
| GetFills | ✅ |
| GetOrders | ✅ |
| CreateOrder | ✅ |
| GetOrder | ✅ |
| CancelOrder | ✅ |
| BatchCreateOrders | ❌ |
| BatchCancelOrders | ❌ |
| DecreaseOrder | ✅ |
| GetPositions | ✅ |
| GetPortolioSettlements | ✅ |### Market Data Feed
[Market Data Feed](https://trading-api.readme.io/reference/introduction) is supported, although it hasn't been thoroughly tested. You may open a feed through `(*Client).OpenFeed()`.