Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/ramasbeinaty/trading-chart-service

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/ramasbeinaty/trading-chart-service

  • v0.0.0-20240903021542-62f982bb67dc
  • Source
  • Go
  • Socket score

Version published
Created
Source

README for Trading Chart Service

App Functionalities

  • Reads tick data from binance data stream
  • Aggregates this data into OHLC Candlesticks with timeframe of 1 minute
  • Serves a GRPC server
  • Broadcasts the current symbol Candlestick bar to its subscribers
  • Stores complete Candlestick bars in a Postgres database

Start Here

1. Run the App

To run the app, use the command:

docker-compose up

2. Use grpcurl to Query the gRPC Server

Note: Below commands have been tested with bash. Might need to format for other terminals.

List Available Methods
grpcurl -plaintext localhost:50051 list candlestick.CandlestickService
Describe Available Methods
grpcurl -plaintext localhost:50051 describe candlestick.CandlestickService.SubscribeToCandlesticks

grpcurl -plaintext localhost:50051 describe candlestick.CandlestickService.UnsubscribeFromCandlesticks

3. Start Testing gRPC Server

For testing, set ENV_ISDEVMODE=true in docker-compose.yaml. The subscriber_id would then be set using a counter, meaning the first subscriber will have the ID 1, the second subscriber will have the id 2, etc.

SubscribeToCandlesticks

To subscribe to a single or multiple symbols

grpcurl -plaintext -d '{"symbols": ["BTCUSDT", "ETHUSDT", "PEPEUSDT"]}' localhost:50051 candlestick.CandlestickService.SubscribeToCandlesticks
UnsubscribeFromCandlesticks

To unsubscribe from specific symbol(s)

grpcurl -plaintext -d '{"symbols": ["BTCUSDT", "ETHUSDT"], "subscriber_id": 1}' localhost:50051 candlestick.CandlestickService.UnsubscribeFromCandlesticks

To unsubscribe from all symbols

grpcurl -plaintext -d '{"subscriber_id": 1}' localhost:50051 candlestick.CandlestickService.UnsubscribeFromCandlesticks

FAQs

Package last updated on 03 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc