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

https://github.com/stockmq/stockmq-server

High-Performance message broker for the market data
https://github.com/stockmq/stockmq-server

binance market-data nats stocks

Last synced: 5 months ago
JSON representation

High-Performance message broker for the market data

Awesome Lists containing this project

README

          

# StockMQ Server

![build status](https://github.com/stockmq/stockmq-server/actions/workflows/build.yml/badge.svg)
![build status](https://github.com/stockmq/stockmq-server/actions/workflows/docker-build.yml/badge.svg)

High-Performance message broker for the market data.

This repository provides core functionality including WebSocket connector for Binance.

# Requirements

NATS Server

```
go install github.com/nats-io/nats-server/v2@latest
$(GOPATH)/bin/nats-server
```

# Example configuration

```xml


Binance-BTCUSD
true
wss://stream.binance.com:9443/ws
Binance
4
3
60
655350
{"id": 0, "method": "SUBSCRIBE", "params": ["btcusdt@kline_1s", "btcusdt@depth"]}

```

# Persistence

It's possible to persist messages to MongoDB and InfluxDB. See stockmq-config.xml for details.

For MongoDB database and collections will be created automatically.

```xml

true
mongodb://localhost:27017
5
stockmq
candles
quotes

```

InfluxDB requires organization and access token with write access.

```xml

false
http://127.0.0.1:8086

stockmq
stockmq-data

```

# Start the server

Configure all required feeds in stockmq-server.xml

```
go build
./stockmq-server -c stockmq-server.xml
```

# Listen for updates

```
cd cmd/stockmq-nats
go build
./stockmq-nats -debug
```